diff --git a/testing/config/tooltool-manifests/linux32/nodejs.manifest b/testing/config/tooltool-manifests/linux32/nodejs.manifest deleted file mode 100644 index f0411e811c..0000000000 --- a/testing/config/tooltool-manifests/linux32/nodejs.manifest +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "size": 13426698, - "visibility": "internal", - "digest": "d2b45d3e2fab867152e2063785af48ead3f4d34b4dd614c1e0867f3eeef0c8088a4ffe811400234827293ff8b75f34f45b45eca991e4eed7de37934a7400a9ac", - "algorithm": "sha512", - "filename": "node-linux-x86.tar.gz", - "unpack": true - } -] diff --git a/testing/config/tooltool-manifests/linux64/nodejs.manifest b/testing/config/tooltool-manifests/linux64/nodejs.manifest deleted file mode 100644 index ac16eb077e..0000000000 --- a/testing/config/tooltool-manifests/linux64/nodejs.manifest +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "size": 13958999, - "visibility": "internal", - "digest": "ce5c0c20dfa83821284a1b69b226fe13224b82345622fc43d216332484ec8c89a2f171ad3dd2ac83cd5777510306d349bc4fbf00fc692e3542dfb7db70876489", - "algorithm": "sha512", - "filename": "node-linux-x64.tar.gz", - "unpack": true - } -] diff --git a/testing/config/tooltool-manifests/macosx64/nodejs.manifest b/testing/config/tooltool-manifests/macosx64/nodejs.manifest deleted file mode 100644 index 05623f7e70..0000000000 --- a/testing/config/tooltool-manifests/macosx64/nodejs.manifest +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "size": 12148545, - "visibility": "internal", - "digest": "a79b5efc30b560fbfb48210b4e0b4c6418ebc8472b07460c7cb2042db6ea1b7a6473cb9fa35604b8abbc93df3d3689b91919dd21e8d4f382033d3c07c7ec6a3f", - "algorithm": "sha512", - "filename": "node-osx.tar.gz", - "unpack": true - } -] diff --git a/testing/config/tooltool-manifests/win32/nodejs.manifest b/testing/config/tooltool-manifests/win32/nodejs.manifest deleted file mode 100644 index 0715363a0e..0000000000 --- a/testing/config/tooltool-manifests/win32/nodejs.manifest +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "size": 15066656, - "visibility": "internal", - "digest": "edf96781042db513700c4a092ef367c05933967b036db9b0f716b75da613a7eaea055d0f60b1e12f6e41a545962cec97a7b78c6b86363ee1ec7a9f42699a5531", - "algorithm": "sha512", - "filename": "node-win32.exe" - } -] diff --git a/testing/mochitest/ssltunnel/ssltunnel.cpp b/testing/mochitest/ssltunnel/ssltunnel.cpp index 4fe54db0a9..55fcb86af4 100644 --- a/testing/mochitest/ssltunnel/ssltunnel.cpp +++ b/testing/mochitest/ssltunnel/ssltunnel.cpp @@ -30,6 +30,7 @@ #include "sslproto.h" #include "plhash.h" #include "mozilla/Sprintf.h" +#include "mozilla/Unused.h" using namespace mozilla; using namespace mozilla::psm; @@ -381,6 +382,32 @@ bool ConfigureSSLServerSocket(PRFileDesc* socket, server_info_t* si, SSL_OptionSet(ssl_socket, SSL_HANDSHAKE_AS_SERVER, true); if (clientAuth != caNone) { + // If we're requesting or requiring a client certificate, we should + // configure NSS to include the "certificate_authorities" field in the + // certificate request message. That way we can test that gecko properly + // takes note of it. + UniqueCERTCertificate issuer( + CERT_FindCertIssuer(cert.get(), PR_Now(), certUsageAnyCA)); + if (!issuer) { + LOG_DEBUG(("Failed to find issuer for %s\n", certnick)); + return false; + } + UniqueCERTCertList issuerList(CERT_NewCertList()); + if (!issuerList) { + LOG_ERROR(("Failed to allocate new CERTCertList\n")); + return false; + } + if (CERT_AddCertToListTail(issuerList.get(), issuer.get()) != SECSuccess) { + LOG_ERROR(("Failed to add issuer to issuerList\n")); + return false; + } + Unused << issuer.release(); // Ownership transferred to issuerList. + if (SSL_SetTrustAnchors(ssl_socket, issuerList.get()) != SECSuccess) { + LOG_ERROR( + ("Failed to set certificate_authorities list for client " + "authentication\n")); + return false; + } SSL_OptionSet(ssl_socket, SSL_REQUEST_CERTIFICATE, true); SSL_OptionSet(ssl_socket, SSL_REQUIRE_CERTIFICATE, clientAuth == caRequire); } diff --git a/testing/mozharness/configs/remove_executables.py b/testing/mozharness/configs/remove_executables.py index 7e6332cbe8..cf022dc356 100644 --- a/testing/mozharness/configs/remove_executables.py +++ b/testing/mozharness/configs/remove_executables.py @@ -1,6 +1,5 @@ config = { # We bake this directly into the tester image now... - "download_nodejs": False, "nodejs_path": "/usr/local/bin/node", "exes": {} } diff --git a/testing/mozharness/configs/unittests/linux_unittest.py b/testing/mozharness/configs/unittests/linux_unittest.py index 6cefd75ffb..e50c9fc625 100644 --- a/testing/mozharness/configs/unittests/linux_unittest.py +++ b/testing/mozharness/configs/unittests/linux_unittest.py @@ -13,6 +13,10 @@ ADJUST_MOUSE_AND_SCREEN = False # Note: keep these Valgrind .sup file names consistent with those # in testing/mochitest/mochitest_options.py. VALGRIND_SUPP_DIR = os.path.join(os.getcwd(), "build/tests/mochitest") +NODEJS_PATH = None +if 'MOZ_FETCHES_DIR' in os.environ: + NODEJS_PATH = os.path.join(os.environ["MOZ_FETCHES_DIR"], "node/bin/node") + VALGRIND_SUPP_CROSS_ARCH = os.path.join(VALGRIND_SUPP_DIR, "cross-architecture.sup") VALGRIND_SUPP_ARCH = None @@ -22,14 +26,11 @@ if platform.architecture()[0] == "64bit": MINIDUMP_STACKWALK_PATH = "linux64-minidump_stackwalk" VALGRIND_SUPP_ARCH = os.path.join(VALGRIND_SUPP_DIR, "x86_64-pc-linux-gnu.sup") - NODEJS_PATH = "node-linux-x64/bin/node" - NODEJS_TOOLTOOL_MANIFEST_PATH = "config/tooltool-manifests/linux64/nodejs.manifest" else: TOOLTOOL_MANIFEST_PATH = "config/tooltool-manifests/linux32/releng.manifest" MINIDUMP_STACKWALK_PATH = "linux32-minidump_stackwalk" VALGRIND_SUPP_ARCH = os.path.join(VALGRIND_SUPP_DIR, "i386-pc-linux-gnu.sup") - NODEJS_PATH = "node-linux-x86/bin/node" NODEJS_TOOLTOOL_MANIFEST_PATH = "config/tooltool-manifests/linux32/nodejs.manifest" ##### @@ -260,8 +261,6 @@ config = { "minidump_stackwalk_path": MINIDUMP_STACKWALK_PATH, "minidump_tooltool_manifest_path": TOOLTOOL_MANIFEST_PATH, "tooltool_cache": "/builds/worker/tooltool-cache", - "download_nodejs": True, "nodejs_path": NODEJS_PATH, - "nodejs_tooltool_manifest_path": NODEJS_TOOLTOOL_MANIFEST_PATH, # "log_format": "%(levelname)8s - %(message)s", } diff --git a/testing/mozharness/configs/unittests/mac_unittest.py b/testing/mozharness/configs/unittests/mac_unittest.py index 171e071bee..339bc15f92 100644 --- a/testing/mozharness/configs/unittests/mac_unittest.py +++ b/testing/mozharness/configs/unittests/mac_unittest.py @@ -2,6 +2,10 @@ import os # OS Specifics INSTALLER_PATH = os.path.join(os.getcwd(), "installer.dmg") +NODEJS_PATH = None +if 'MOZ_FETCHES_DIR' in os.environ: + NODEJS_PATH = os.path.join(os.environ["MOZ_FETCHES_DIR"], "node/bin/node") + XPCSHELL_NAME = 'xpcshell' EXE_SUFFIX = '' DISABLE_SCREEN_SAVER = False @@ -209,7 +213,5 @@ config = { "minidump_stackwalk_path": "macosx64-minidump_stackwalk", "minidump_tooltool_manifest_path": "config/tooltool-manifests/macosx64/releng.manifest", "tooltool_cache": "/builds/tooltool_cache", - "download_nodejs": True, - "nodejs_path": "node-osx/bin/node", - "nodejs_tooltool_manifest_path": "config/tooltool-manifests/macosx64/nodejs.manifest", + "nodejs_path": NODEJS_PATH, } diff --git a/testing/mozharness/configs/unittests/win_unittest.py b/testing/mozharness/configs/unittests/win_unittest.py index 555c42bd76..faf346df4d 100644 --- a/testing/mozharness/configs/unittests/win_unittest.py +++ b/testing/mozharness/configs/unittests/win_unittest.py @@ -6,6 +6,10 @@ import sys ABS_WORK_DIR = os.path.join(os.getcwd(), "build") BINARY_PATH = os.path.join(ABS_WORK_DIR, "firefox", "firefox.exe") INSTALLER_PATH = os.path.join(ABS_WORK_DIR, "installer.zip") +NODEJS_PATH = None +if 'MOZ_FETCHES_DIR' in os.environ: + NODEJS_PATH = os.path.join(os.environ["MOZ_FETCHES_DIR"], "node/node.exe") + XPCSHELL_NAME = 'xpcshell.exe' EXE_SUFFIX = '.exe' DISABLE_SCREEN_SAVER = False @@ -282,7 +286,5 @@ config = { }, "minidump_stackwalk_path": "win32-minidump_stackwalk.exe", "minidump_tooltool_manifest_path": "config/tooltool-manifests/win32/releng.manifest", - "download_nodejs": True, - "nodejs_path": "node-win32.exe", - "nodejs_tooltool_manifest_path": "config/tooltool-manifests/win32/nodejs.manifest", + "nodejs_path": NODEJS_PATH, } diff --git a/testing/mozharness/mozharness/mozilla/testing/testbase.py b/testing/mozharness/mozharness/mozilla/testing/testbase.py index b392757f7e..8764281017 100644 --- a/testing/mozharness/mozharness/mozilla/testing/testbase.py +++ b/testing/mozharness/mozharness/mozilla/testing/testbase.py @@ -118,7 +118,6 @@ class TestingMixin(VirtualenvMixin, AutomationMixin, ResourceMonitoringMixin, symbols_path = None jsshell_url = None minidump_stackwalk_path = None - nodejs_path = None default_tools_repo = 'https://hg.mozilla.org/build/tools' def query_build_dir_url(self, file_name): @@ -572,69 +571,6 @@ Did you run with --create-virtualenv? Is mozinstall in virtualenv_modules?""") else: self.fatal('We could not determine the minidump\'s filename.') - def query_nodejs_tooltool_manifest(self): - if self.config.get('nodejs_tooltool_manifest_path'): - return self.config['nodejs_tooltool_manifest_path'] - - self.info('NodeJS tooltool manifest unknown. Determining based upon ' - 'platform and architecture.') - platform_name = self.platform_name() - - if platform_name: - tooltool_path = "config/tooltool-manifests/%s/nodejs.manifest" % \ - TOOLTOOL_PLATFORM_DIR[platform_name] - return tooltool_path - else: - self.fatal('Could not determine nodejs manifest filename') - - def query_nodejs_filename(self): - if self.config.get('nodejs_path'): - return self.config['nodejs_path'] - - self.fatal('Could not determine nodejs filename') - - def query_nodejs(self, manifest=None): - if self.nodejs_path: - return self.nodejs_path - - c = self.config - dirs = self.query_abs_dirs() - - nodejs_path = self.query_nodejs_filename() - if not self.config.get('download_nodejs'): - self.nodejs_path = nodejs_path - return self.nodejs_path - - if not manifest: - tooltool_manifest_path = self.query_nodejs_tooltool_manifest() - manifest = os.path.join(dirs.get('abs_test_install_dir', - os.path.join(dirs['abs_work_dir'], 'tests')), - tooltool_manifest_path) - - self.info('grabbing nodejs binary from tooltool') - try: - self.tooltool_fetch( - manifest=manifest, - output_dir=dirs['abs_work_dir'], - cache=c.get('tooltool_cache') - ) - except KeyError: - self.error('missing a required key') - - abs_nodejs_path = os.path.join(dirs['abs_work_dir'], nodejs_path) - - if os.path.exists(abs_nodejs_path): - if self.platform_name() not in ('win32', 'win64'): - self.chmod(abs_nodejs_path, 0755) - self.nodejs_path = abs_nodejs_path - else: - msg = """nodejs path was given but couldn't be found. Tried looking in '%s'""" % \ - abs_nodejs_path - self.warning(msg) - self.record_status(TBPL_WARNING, WARNING) - - return self.nodejs_path - def query_minidump_stackwalk(self, manifest=None): if self.minidump_stackwalk_path: return self.minidump_stackwalk_path diff --git a/testing/mozharness/scripts/desktop_unittest.py b/testing/mozharness/scripts/desktop_unittest.py index 0f2d3a0950..9a4f121f4b 100644 --- a/testing/mozharness/scripts/desktop_unittest.py +++ b/testing/mozharness/scripts/desktop_unittest.py @@ -862,8 +862,8 @@ class DesktopUnittest(TestingMixin, MercurialScript, MozbaseMixin, if self.query_minidump_stackwalk(): env['MINIDUMP_STACKWALK'] = self.minidump_stackwalk_path - if self.query_nodejs(): - env['MOZ_NODE_PATH'] = self.nodejs_path + if self.config['nodejs_path']: + env['MOZ_NODE_PATH'] = self.config['nodejs_path'] env['MOZ_UPLOAD_DIR'] = self.query_abs_dirs()['abs_blob_upload_dir'] env['MINIDUMP_SAVE_PATH'] = self.query_abs_dirs()['abs_blob_upload_dir'] env['RUST_BACKTRACE'] = 'full' diff --git a/testing/profiles/web-platform/user.js b/testing/profiles/web-platform/user.js index 265c75c904..674af99a81 100644 --- a/testing/profiles/web-platform/user.js +++ b/testing/profiles/web-platform/user.js @@ -23,7 +23,7 @@ user_pref("places.history.enabled", false); // Suppress automatic safe mode after crashes user_pref("toolkit.startup.max_resumed_crashes", -1); // Disable antialiasing for the Ahem font. -user_pref("gfx.font_ahem_antialias_none", true); +user_pref("gfx.font_rendering.ahem_antialias_none", true); // Disable antiphishing popup user_pref("network.http.phishy-userpass-length", 255); // Disable safebrowsing components @@ -34,3 +34,13 @@ user_pref("browser.safebrowsing.malware.enabled", false); user_pref("browser.safebrowsing.phishing.enabled", false); // Automatically unload beforeunload alerts user_pref("dom.disable_beforeunload", true); +// Enable implicit keyframes since the common animation interpolation test +// function assumes this is available. +user_pref("dom.animations-api.implicit-keyframes.enabled", true); +// sometime wpt runs test even before the document becomes visible, which would +// delay video.play() and cause play() running in wrong order. +user_pref("media.block-autoplay-until-in-foreground", false); +user_pref("media.block-autoplay-until-in-foreground", false); +// Enable AppCache globally for now whilst it's being removed in Bug 1584984 +user_pref("browser.cache.offline.storage.enable", true); +user_pref("browser.cache.offline.enable", true); diff --git a/testing/web-platform/meta/css/CSS2/bidi-text/bidi-001.xht.ini b/testing/web-platform/meta/css/CSS2/bidi-text/bidi-001.xht.ini new file mode 100644 index 0000000000..f5aab79f77 --- /dev/null +++ b/testing/web-platform/meta/css/CSS2/bidi-text/bidi-001.xht.ini @@ -0,0 +1,3 @@ +[bidi-001.xht] + fuzzy: + if os == "mac": maxDifference=3;totalPixels=0-1 diff --git a/testing/web-platform/meta/css/CSS2/bidi-text/bidi-002.xht.ini b/testing/web-platform/meta/css/CSS2/bidi-text/bidi-002.xht.ini new file mode 100644 index 0000000000..a606245391 --- /dev/null +++ b/testing/web-platform/meta/css/CSS2/bidi-text/bidi-002.xht.ini @@ -0,0 +1,3 @@ +[bidi-002.xht] + fuzzy: + if os == "mac": maxDifference=1;totalPixels=0-1 diff --git a/testing/web-platform/meta/css/CSS2/css1/c43-rpl-ibx-000.xht.ini b/testing/web-platform/meta/css/CSS2/css1/c43-rpl-ibx-000.xht.ini index 35dec9c4d2..cf2293fca3 100644 --- a/testing/web-platform/meta/css/CSS2/css1/c43-rpl-ibx-000.xht.ini +++ b/testing/web-platform/meta/css/CSS2/css1/c43-rpl-ibx-000.xht.ini @@ -1,5 +1,4 @@ [c43-rpl-ibx-000.xht] expected: - if os == "mac": FAIL if (os == "android") and not e10s: FAIL if (os == "android") and e10s: FAIL diff --git a/testing/web-platform/meta/css/CSS2/floats-clear/clear-applies-to-008.xht.ini b/testing/web-platform/meta/css/CSS2/floats-clear/clear-applies-to-008.xht.ini deleted file mode 100644 index 2e006a9b0d..0000000000 --- a/testing/web-platform/meta/css/CSS2/floats-clear/clear-applies-to-008.xht.ini +++ /dev/null @@ -1,3 +0,0 @@ -[clear-applies-to-008.xht] - expected: - if (os == "mac"): FAIL diff --git a/testing/web-platform/meta/css/css-contain/contain-paint-independent-formatting-context-002.html.ini b/testing/web-platform/meta/css/css-contain/contain-paint-independent-formatting-context-002.html.ini deleted file mode 100644 index 4cf4d64a19..0000000000 --- a/testing/web-platform/meta/css/css-contain/contain-paint-independent-formatting-context-002.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[contain-paint-independent-formatting-context-002.html] - expected: - if (os == "mac"): FAIL diff --git a/testing/web-platform/meta/css/css-display/display-contents-details.html.ini b/testing/web-platform/meta/css/css-display/display-contents-details.html.ini deleted file mode 100644 index bd1f88b4e7..0000000000 --- a/testing/web-platform/meta/css/css-display/display-contents-details.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[display-contents-details.html] - expected: - if (os == "mac"): PASS - FAIL diff --git a/testing/web-platform/meta/css/css-display/display-contents-fieldset.html.ini b/testing/web-platform/meta/css/css-display/display-contents-fieldset.html.ini deleted file mode 100644 index 1c0e742370..0000000000 --- a/testing/web-platform/meta/css/css-display/display-contents-fieldset.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[display-contents-fieldset.html] - expected: - if os == "mac": FAIL diff --git a/testing/web-platform/meta/css/css-flexbox/flex-lines/multi-line-wrap-reverse-column-reverse.html.ini b/testing/web-platform/meta/css/css-flexbox/flex-lines/multi-line-wrap-reverse-column-reverse.html.ini deleted file mode 100644 index bb68d795f1..0000000000 --- a/testing/web-platform/meta/css/css-flexbox/flex-lines/multi-line-wrap-reverse-column-reverse.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[multi-line-wrap-reverse-column-reverse.html] - expected: - if (os == "mac") and (version == "OS X 10.14.5") and (processor == "x86_64") and (bits == 64): FAIL - if (os == "mac") and (version == "OS X 10.14") and (processor == "x86_64") and (bits == 64): FAIL - \ No newline at end of file diff --git a/testing/web-platform/meta/css/css-flexbox/flex-lines/multi-line-wrap-with-column-reverse.html.ini b/testing/web-platform/meta/css/css-flexbox/flex-lines/multi-line-wrap-with-column-reverse.html.ini deleted file mode 100644 index 9e7d683ba7..0000000000 --- a/testing/web-platform/meta/css/css-flexbox/flex-lines/multi-line-wrap-with-column-reverse.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[multi-line-wrap-with-column-reverse.html] - expected: - if (os == "mac") and (version == "OS X 10.14.5") and (processor == "x86_64") and (bits == 64): FAIL - if (os == "mac") and (version == "OS X 10.14") and (processor == "x86_64") and (bits == 64): FAIL diff --git a/testing/web-platform/meta/css/css-text-decor/text-emphasis-style-006.html.ini b/testing/web-platform/meta/css/css-text-decor/text-emphasis-style-006.html.ini index 91d35eae39..282074fe27 100644 --- a/testing/web-platform/meta/css/css-text-decor/text-emphasis-style-006.html.ini +++ b/testing/web-platform/meta/css/css-text-decor/text-emphasis-style-006.html.ini @@ -1,4 +1,5 @@ [text-emphasis-style-006.html] disabled: if (os == "android") and e10s: bug 1550895 (frequently fails on geckoview) + fuzzy: if os == "mac": maxDifference=0-96;totalPixels=0-12 diff --git a/testing/web-platform/meta/css/css-text/word-break/word-break-break-all-004.html.ini b/testing/web-platform/meta/css/css-text/word-break/word-break-break-all-004.html.ini deleted file mode 100644 index 7d42ee5ee3..0000000000 --- a/testing/web-platform/meta/css/css-text/word-break/word-break-break-all-004.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[word-break-break-all-004.html] - expected: - if (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL diff --git a/testing/web-platform/meta/fetch/http-cache/heuristic.html.ini b/testing/web-platform/meta/fetch/http-cache/heuristic.html.ini index 17b2b48eba..6984591b0e 100644 --- a/testing/web-platform/meta/fetch/http-cache/heuristic.html.ini +++ b/testing/web-platform/meta/fetch/http-cache/heuristic.html.ini @@ -2,9 +2,6 @@ [HTTP cache reuses an unknown response with Last-Modified based upon heuristic freshness when Cache-Control: public is present.] expected: FAIL - [HTTP cache reuses a 204 No Content response with Last-Modified based upon heuristic freshness.] - expected: FAIL - [HTTP cache reuses a 404 Not Found response with Last-Modified based upon heuristic freshness.] expected: FAIL @@ -20,9 +17,6 @@ [HTTP cache reuses an unknown response with Last-Modified based upon heuristic freshness when Cache-Control: public is present] expected: FAIL - [HTTP cache reuses a 204 No Content response with Last-Modified based upon heuristic freshness] - expected: FAIL - [HTTP cache reuses a 404 Not Found response with Last-Modified based upon heuristic freshness] expected: FAIL diff --git a/testing/web-platform/meta/fetch/http-cache/status.html.ini b/testing/web-platform/meta/fetch/http-cache/status.html.ini index 50255f7305..44ba6a37c5 100644 --- a/testing/web-platform/meta/fetch/http-cache/status.html.ini +++ b/testing/web-platform/meta/fetch/http-cache/status.html.ini @@ -1,7 +1,4 @@ [status.html] - [HTTP cache avoids going to the network if it has a fresh 204 response.] - expected: FAIL - [HTTP cache avoids going to the network if it has a fresh 299 response.] expected: FAIL @@ -29,9 +26,6 @@ [HTTP cache avoids going to the network if it has a fresh 599 response.] expected: FAIL - [HTTP cache avoids going to the network if it has a fresh 204 response] - expected: FAIL - [HTTP cache avoids going to the network if it has a fresh 299 response] expected: FAIL diff --git a/testing/web-platform/meta/fetch/metadata/appcache.tentative.https.sub.html.ini b/testing/web-platform/meta/fetch/metadata/appcache.tentative.https.sub.html.ini new file mode 100644 index 0000000000..c60048add4 --- /dev/null +++ b/testing/web-platform/meta/fetch/metadata/appcache.tentative.https.sub.html.ini @@ -0,0 +1,5 @@ +[appcache.tentative.https.sub.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] + [Appcache!] + expected: FAIL + diff --git a/testing/web-platform/meta/fetch/metadata/redirect/redirect-http-upgrade.tentative.sub.html.ini b/testing/web-platform/meta/fetch/metadata/redirect/redirect-http-upgrade.tentative.sub.html.ini new file mode 100644 index 0000000000..ee901042b7 --- /dev/null +++ b/testing/web-platform/meta/fetch/metadata/redirect/redirect-http-upgrade.tentative.sub.html.ini @@ -0,0 +1,35 @@ +[redirect-http-upgrade.tentative.sub.html] + expected: TIMEOUT + [Http upgrade embed] + expected: FAIL + + [Http upgrade top level navigation] + expected: FAIL + + [Http upgrade iframe] + expected: FAIL + + [Http upgrade script => No headers] + expected: FAIL + + [Http upgrade image => No headers] + expected: NOTRUN + + [Http upgrade font => No headers] + expected: NOTRUN + + [Http upgrade object] + expected: FAIL + + [Http upgrade stylesheet] + expected: TIMEOUT + + [Http upgrade prefetch => No headers] + expected: [FAIL, TIMEOUT] + + [Http upgrade track] + expected: NOTRUN + + [Http upgrade fetch() api] + expected: FAIL + diff --git a/testing/web-platform/meta/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub.html.ini b/testing/web-platform/meta/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub.html.ini new file mode 100644 index 0000000000..8fab04e775 --- /dev/null +++ b/testing/web-platform/meta/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub.html.ini @@ -0,0 +1,3 @@ +[redirect-https-downgrade.tentative.sub.html] + [redirect-https-downgrade] + expected: FAIL diff --git a/testing/web-platform/meta/fetch/sec-metadata/fetch.tentative.sub.html.ini b/testing/web-platform/meta/fetch/sec-metadata/fetch.tentative.sub.html.ini new file mode 100644 index 0000000000..4e912bd50f --- /dev/null +++ b/testing/web-platform/meta/fetch/sec-metadata/fetch.tentative.sub.html.ini @@ -0,0 +1,3 @@ +[fetch.tentative.sub.html] + [http->https fetch (cross-scheme => cross-site)] + expected: FAIL diff --git a/testing/web-platform/meta/fetch/sec-metadata/iframe.tentative.sub.html.ini b/testing/web-platform/meta/fetch/sec-metadata/iframe.tentative.sub.html.ini new file mode 100644 index 0000000000..6130bc332f --- /dev/null +++ b/testing/web-platform/meta/fetch/sec-metadata/iframe.tentative.sub.html.ini @@ -0,0 +1,3 @@ +[iframe.tentative.sub.html] + [Secure, cross-site (cross-scheme, same-host) iframe] + expected: FAIL diff --git a/testing/web-platform/meta/fetch/sec-metadata/redirect/__dir__.ini b/testing/web-platform/meta/fetch/sec-metadata/redirect/__dir__.ini new file mode 100644 index 0000000000..0023ae85ce --- /dev/null +++ b/testing/web-platform/meta/fetch/sec-metadata/redirect/__dir__.ini @@ -0,0 +1,2 @@ +lsan-allowed: [Alloc, Create, Malloc, Realloc, mozilla::BasePrincipal::CreateContentPrincipal, mozilla::SchedulerGroup::CreateEventTargetFor, mozilla::WeakPtr, mozilla::net::CookieSettings::Create, mozilla::net::nsStandardURL::TemplatedMutator, nsNodeSupportsWeakRefTearoff::GetWeakReference, nsPrefetchService::EnqueueURI] +leak-threshold: [tab:51200] diff --git a/testing/web-platform/meta/fetch/sec-metadata/redirect/multiple-redirect-https-downgrade-upgrade.tentative.sub.html.ini b/testing/web-platform/meta/fetch/sec-metadata/redirect/multiple-redirect-https-downgrade-upgrade.tentative.sub.html.ini new file mode 100644 index 0000000000..27467bdc79 --- /dev/null +++ b/testing/web-platform/meta/fetch/sec-metadata/redirect/multiple-redirect-https-downgrade-upgrade.tentative.sub.html.ini @@ -0,0 +1,46 @@ +[multiple-redirect-https-downgrade-upgrade.tentative.sub.html] + expected: TIMEOUT + [Https downgrade-upgrade stylesheet => No headers] + expected: TIMEOUT + + [Https downgrade-upgrade iframe => No headers] + expected: FAIL + + [Https downgrade-upgrade top level navigation => No headers] + expected: FAIL + + [Https downgrade-upgrade image => No headers] + expected: NOTRUN + + [Https downgrade-upgrade script => No headers] + expected: FAIL + + [Https downgrade-upgrade track => No headers] + expected: NOTRUN + + [Https downgrade-upgrade fetch() api => No headers] + expected: FAIL + + [Https downgrade-upgrade font => No headers] + expected: NOTRUN + + [Https downgrade-upgrade prefetch => No headers] + disabled: + if (os == "win") and debug and webrender: wpt-sync Bug 1565002 + if (os == "linux") and webrender and debug: wpt-sync Bug 1565002 + if (os == "linux") and webrender and not debug: wpt-sync Bug 1565002 + if (os == "linux") and not webrender and not debug and (processor == "x86_64"): wpt-sync Bug 1565002 + if (os == "linux") and not webrender and not debug and (processor == "x86"): wpt-sync Bug 1565002 + if (os == "linux") and not webrender and debug and sw-e10s: wpt-sync Bug 1565002 + if (os == "linux") and not webrender and debug and not sw-e10s: wpt-sync Bug 1565002 + wpt-sync Bug 1565002 + expected: FAIL + + [Https downgrade-upgrade embed => No headers] + expected: FAIL + + [Https downgrade-upgrade object => No headers] + expected: FAIL + + [multiple-redirect-https-downgrade-upgrade] + expected: FAIL diff --git a/testing/web-platform/meta/fetch/sec-metadata/redirect/redirect-https-downgrade.tentative.sub.html.ini b/testing/web-platform/meta/fetch/sec-metadata/redirect/redirect-https-downgrade.tentative.sub.html.ini deleted file mode 100644 index 85ae9be1a7..0000000000 --- a/testing/web-platform/meta/fetch/sec-metadata/redirect/redirect-https-downgrade.tentative.sub.html.ini +++ /dev/null @@ -1,19 +0,0 @@ -[redirect-https-downgrade.tentative.sub.html] - expected: TIMEOUT - [Https downgrade track => No headers] - expected: NOTRUN - - [Https downgrade font => No headers] - expected: NOTRUN - - [Https downgrade prefetch => No headers] - expected: - if (os == "linux"): ["FAIL", "TIMEOUT"] - if os == "android": PASS - FAIL - - [Https downgrade stylesheet => No headers] - expected: TIMEOUT - - [Https downgrade image => No headers] - expected: NOTRUN diff --git a/testing/web-platform/meta/html/browsers/offline/appcache/appcache-iframe.https.html.ini b/testing/web-platform/meta/html/browsers/offline/appcache/appcache-iframe.https.html.ini new file mode 100644 index 0000000000..334779ac49 --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/appcache/appcache-iframe.https.html.ini @@ -0,0 +1,2 @@ +[appcache-iframe.https.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/appcache/workers/appcache-worker.https.html.ini b/testing/web-platform/meta/html/browsers/offline/appcache/workers/appcache-worker.https.html.ini index 5d87618ca0..9cff70457f 100644 --- a/testing/web-platform/meta/html/browsers/offline/appcache/workers/appcache-worker.https.html.ini +++ b/testing/web-platform/meta/html/browsers/offline/appcache/workers/appcache-worker.https.html.ini @@ -1,4 +1,5 @@ [appcache-worker.https.html] + prefs: [browser.cache.offline.storage.enable:true] disabled: if verify: fails in verify mode expected: TIMEOUT diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_checking-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_checking-manual.html.ini new file mode 100644 index 0000000000..809a0297ca --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_checking-manual.html.ini @@ -0,0 +1,2 @@ +[api_status_checking-manual.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_downloading-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_downloading-manual.html.ini new file mode 100644 index 0000000000..6c0b0f1e5e --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_downloading-manual.html.ini @@ -0,0 +1,2 @@ +[api_status_downloading-manual.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_idle.https.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_idle.https.html.ini new file mode 100644 index 0000000000..113be6a1a8 --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_idle.https.html.ini @@ -0,0 +1,2 @@ +[api_status_idle.https.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html.ini new file mode 100644 index 0000000000..08a33bd291 --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html.ini @@ -0,0 +1,2 @@ +[api_status_obsolete-manual.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_uncached.https.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_uncached.https.html.ini new file mode 100644 index 0000000000..80d726fc7b --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_uncached.https.html.ini @@ -0,0 +1,2 @@ +[api_status_uncached.https.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_updateready-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_updateready-manual.html.ini new file mode 100644 index 0000000000..875d63c141 --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_status_updateready-manual.html.ini @@ -0,0 +1,2 @@ +[api_status_updateready-manual.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache-manual.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache-manual.html.ini new file mode 100644 index 0000000000..4e5317feb2 --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache-manual.html.ini @@ -0,0 +1,2 @@ +[api_swapcache-manual.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache_error.https.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache_error.https.html.ini new file mode 100644 index 0000000000..043473bdee --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_swapcache_error.https.html.ini @@ -0,0 +1,2 @@ +[api_swapcache_error.https.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_update.https.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_update.https.html.ini new file mode 100644 index 0000000000..5db9746be9 --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_update.https.html.ini @@ -0,0 +1,2 @@ +[api_update.https.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_update_error.https.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_update_error.https.html.ini index b46176cbf9..8713842068 100644 --- a/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_update_error.https.html.ini +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/api_update_error.https.html.ini @@ -1,4 +1,5 @@ [api_update_error.https.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] [INVALID_STATE_ERR error test] expected: FAIL diff --git a/testing/web-platform/meta/html/browsers/offline/application-cache-api/secure_context.html.ini b/testing/web-platform/meta/html/browsers/offline/application-cache-api/secure_context.html.ini index c7992f55fd..ee0e90ae9c 100644 --- a/testing/web-platform/meta/html/browsers/offline/application-cache-api/secure_context.html.ini +++ b/testing/web-platform/meta/html/browsers/offline/application-cache-api/secure_context.html.ini @@ -1,2 +1,2 @@ [secure_context.html] - prefs: [browser.cache.offline.insecure.enable:false] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/manifest_url_check.https.https.html.ini b/testing/web-platform/meta/html/browsers/offline/manifest_url_check.https.https.html.ini new file mode 100644 index 0000000000..9c18286313 --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/manifest_url_check.https.https.html.ini @@ -0,0 +1,2 @@ +[manifest_url_check.https.https.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] diff --git a/testing/web-platform/meta/html/browsers/offline/no-appcache-in-shared-workers-historical.https.html.ini b/testing/web-platform/meta/html/browsers/offline/no-appcache-in-shared-workers-historical.https.html.ini new file mode 100644 index 0000000000..ab450952b7 --- /dev/null +++ b/testing/web-platform/meta/html/browsers/offline/no-appcache-in-shared-workers-historical.https.html.ini @@ -0,0 +1,4 @@ +[no-appcache-in-shared-workers-historical.https.html] + prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true] + disabled: + if (os == "win"): Bug 1581711 diff --git a/testing/web-platform/meta/html/dom/idlharness.https.html.ini b/testing/web-platform/meta/html/dom/idlharness.https.html.ini index 6858ac7ae6..5f256a4c47 100644 --- a/testing/web-platform/meta/html/dom/idlharness.https.html.ini +++ b/testing/web-platform/meta/html/dom/idlharness.https.html.ini @@ -480,9 +480,6 @@ prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.head [External interface: operation IsSearchProviderInstalled()] expected: FAIL - [SVGElement interface: attribute nonce] - expected: FAIL - [TextMetrics interface: attribute fontBoundingBoxAscent] expected: FAIL @@ -723,6 +720,9 @@ prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.head [OffscreenCanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean)] expected: FAIL + [Navigator interface: operation registerProtocolHandler(DOMString, USVString)] + expected: FAIL + [idlharness.https.html?include=(Document|Window)] [Document interface: documentWithHandlers must inherit property "onsecuritypolicyviolation" with the proper type] @@ -921,9 +921,6 @@ prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.head [HTMLInputElement interface: createInput("week") must inherit property "dirName" with the proper type] expected: FAIL - [HTMLLinkElement interface: attribute imageSizes] - expected: FAIL - [HTMLVideoElement interface: document.createElement("video") must inherit property "playsInline" with the proper type] expected: FAIL @@ -939,9 +936,6 @@ prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.head [HTMLDialogElement interface: attribute open] expected: FAIL - [HTMLLinkElement interface: document.createElement("link") must inherit property "imageSizes" with the proper type] - expected: FAIL - [HTMLInputElement interface: createInput("tel") must inherit property "dirName" with the proper type] expected: FAIL @@ -999,18 +993,12 @@ prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.head [HTMLDialogElement interface: attribute returnValue] expected: FAIL - [HTMLLinkElement interface: document.createElement("link") must inherit property "imageSrcset" with the proper type] - expected: FAIL - [HTMLMediaElement interface: document.createElement("video") must inherit property "videoTracks" with the proper type] expected: FAIL [HTMLMediaElement interface: new Audio() must inherit property "getStartDate()" with the proper type] expected: FAIL - [HTMLElement interface: attribute nonce] - expected: FAIL - [HTMLMediaElement interface: document.createElement("video") must inherit property "audioTracks" with the proper type] expected: FAIL @@ -1020,15 +1008,9 @@ prefs: [dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.head [HTMLElement interface: attribute autocapitalize] expected: FAIL - [HTMLLinkElement interface: attribute imageSrcset] - expected: FAIL - [HTMLMediaElement interface: document.createElement("audio") must inherit property "getStartDate()" with the proper type] expected: FAIL - [HTMLElement interface: document.createElement("noscript") must inherit property "nonce" with the proper type] - expected: FAIL - [HTMLInputElement interface: createInput("month") must inherit property "dirName" with the proper type] expected: FAIL diff --git a/testing/web-platform/meta/html/semantics/embedded-content/media-elements/autoplay-with-broken-track.html.ini b/testing/web-platform/meta/html/semantics/embedded-content/media-elements/autoplay-with-broken-track.html.ini deleted file mode 100644 index 973a390764..0000000000 --- a/testing/web-platform/meta/html/semantics/embedded-content/media-elements/autoplay-with-broken-track.html.ini +++ /dev/null @@ -1,13 +0,0 @@ -[autoplay-with-broken-track.html] - expected: TIMEOUT - disabled: - if debug and (os == "linux") and (processor == "x86"): https://bugzilla.mozilla.org/show_bug.cgi?id=1482405 - [ diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change.html index 34a53d1531..f3c78668b4 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change.html @@ -18,9 +18,7 @@ assert_equals(cues[cues.length-1].text, 'I said Bear is coming now!!!! Tab separators.', "Last cue content check"); ++stage; testTrack.src = "resources/entities.vtt"; - // CuesList will be cleared in a microtask. Spec claims that this should happen immediately, - // but all known implementations are doing this asynchronously. - assert_equals(cues.length, 4, "Number of cues immediately after 'src' mutation with the new URL"); + assert_equals(cues.length, 0, "cues list is reset immediately after 'src' mutation with the new URL"); break; case 1: assert_equals(testTrack.readyState, HTMLTrackElement.LOADED), "readyState after loading of the second track"; @@ -54,4 +52,4 @@ testTrack.onerror = t.unreached_func("'error' event should not fire"); }); - \ No newline at end of file + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-mode-not-changed-by-new-track.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-mode-not-changed-by-new-track.html index 2902ba90bc..3ec47a39e2 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-mode-not-changed-by-new-track.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-mode-not-changed-by-new-track.html @@ -33,11 +33,12 @@ async_test(function(t) { assert_equals(track1.track.cues.length, 12); assert_equals(track1.track.cues[11].startTime, 22); - // Add a caption track, configured to load automatically. + // Add a caption track, and explicitly enable it. track2 = document.createElement('track'); track2.setAttribute('kind', 'captions'); track2.setAttribute('default', 'default'); track2.setAttribute('src', 'resources/webvtt-file.vtt'); + track2.track.mode = 'showing'; track2.onload = t.step_func(captionsTrackLoaded); video.appendChild(track2); } @@ -56,7 +57,7 @@ async_test(function(t) { track3.mode = 'showing'; } - function trackAdded() { + function trackAdded(event) { // Check that metadata track state has not changed. assert_equals(track1.readyState, HTMLTrackElement.LOADED); assert_equals(track1.track.mode, 'hidden'); diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-selection-task-order.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-selection-task-order.html new file mode 100644 index 0000000000..522d067adf --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-selection-task-order.html @@ -0,0 +1,36 @@ + +HTMLTrackElement Text Track Selection Task Order + + + diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/currentSrc-blob-cache.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/currentSrc-blob-cache.html new file mode 100644 index 0000000000..a5e108dcd6 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/currentSrc-blob-cache.html @@ -0,0 +1,45 @@ + + +currentSrc is right even if underlying image is a shared blob + + + + + + + + diff --git a/testing/web-platform/tests/interfaces/fullscreen.idl b/testing/web-platform/tests/interfaces/fullscreen.idl index 491aa7af13..677b2e116f 100644 --- a/testing/web-platform/tests/interfaces/fullscreen.idl +++ b/testing/web-platform/tests/interfaces/fullscreen.idl @@ -14,15 +14,15 @@ dictionary FullscreenOptions { }; partial interface Element { - Promise requestFullscreen(optional FullscreenOptions options); + Promise requestFullscreen(optional FullscreenOptions options = {}); attribute EventHandler onfullscreenchange; attribute EventHandler onfullscreenerror; }; partial interface Document { - [LenientSetter] readonly attribute boolean fullscreenEnabled; - [LenientSetter, Unscopable] readonly attribute boolean fullscreen; // historical + [LegacyLenientSetter] readonly attribute boolean fullscreenEnabled; + [LegacyLenientSetter, Unscopable] readonly attribute boolean fullscreen; // historical Promise exitFullscreen(); @@ -31,5 +31,5 @@ partial interface Document { }; partial interface mixin DocumentOrShadowRoot { - [LenientSetter] readonly attribute Element? fullscreenElement; + [LegacyLenientSetter] readonly attribute Element? fullscreenElement; }; diff --git a/testing/web-platform/tests/interfaces/html.idl b/testing/web-platform/tests/interfaces/html.idl index 3a5c8f0e25..c9018f1b63 100644 --- a/testing/web-platform/tests/interfaces/html.idl +++ b/testing/web-platform/tests/interfaces/html.idl @@ -1,7 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT // Content was automatically extracted by Reffy into reffy-reports // (https://github.com/tidoust/reffy-reports) -// Source: HTML Standard (https://html.spec.whatwg.org/) +// Source: HTML Standard (https://html.spec.whatwg.org/multipage/) [Exposed=Window, LegacyUnenumerableNamedProperties] @@ -45,10 +45,10 @@ interface DOMStringList { enum DocumentReadyState { "loading", "interactive", "complete" }; typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement; -[OverrideBuiltins] +[LegacyOverrideBuiltIns] partial interface Document { // resource metadata management - [PutForwards=href, Unforgeable] readonly attribute Location? location; + [PutForwards=href, LegacyUnforgeable] readonly attribute Location? location; attribute USVString domain; readonly attribute USVString referrer; attribute USVString cookie; @@ -89,7 +89,7 @@ partial interface Document { DOMString queryCommandValue(DOMString commandId); // special event handler IDL attributes that only apply to Document objects - [LenientThis] attribute EventHandler onreadystatechange; + [LegacyLenientThis] attribute EventHandler onreadystatechange; // also has obsolete members }; @@ -119,7 +119,7 @@ interface HTMLElement : Element { [CEReactions] attribute boolean spellcheck; [CEReactions] attribute DOMString autocapitalize; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString innerText; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText; ElementInternals attachInternals(); }; @@ -145,7 +145,7 @@ interface mixin HTMLOrSVGElement { }; [Exposed=Window, - OverrideBuiltins] + LegacyOverrideBuiltIns] interface DOMStringMap { getter DOMString (DOMString name); [CEReactions] setter void (DOMString name, DOMString value); @@ -155,8 +155,6 @@ interface DOMStringMap { [Exposed=Window] interface HTMLHtmlElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] @@ -196,8 +194,6 @@ interface HTMLLinkElement : HTMLElement { [CEReactions] attribute USVString imageSrcset; [CEReactions] attribute DOMString imageSizes; [CEReactions] attribute DOMString referrerPolicy; - - // also has obsolete members }; HTMLLinkElement includes LinkStyle; @@ -208,8 +204,6 @@ interface HTMLMetaElement : HTMLElement { [CEReactions] attribute DOMString name; [CEReactions] attribute DOMString httpEquiv; [CEReactions] attribute DOMString content; - - // also has obsolete members }; [Exposed=Window] @@ -217,16 +211,12 @@ interface HTMLStyleElement : HTMLElement { [HTMLConstructor] constructor(); [CEReactions] attribute DOMString media; - - // also has obsolete members }; HTMLStyleElement includes LinkStyle; [Exposed=Window] interface HTMLBodyElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; HTMLBodyElement includes WindowEventHandlers; @@ -234,29 +224,21 @@ HTMLBodyElement includes WindowEventHandlers; [Exposed=Window] interface HTMLHeadingElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] interface HTMLParagraphElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] interface HTMLHRElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] interface HTMLPreElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] @@ -273,22 +255,16 @@ interface HTMLOListElement : HTMLElement { [CEReactions] attribute boolean reversed; [CEReactions] attribute long start; [CEReactions] attribute DOMString type; - - // also has obsolete members }; [Exposed=Window] interface HTMLUListElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] interface HTMLMenuElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] @@ -296,22 +272,16 @@ interface HTMLLIElement : HTMLElement { [HTMLConstructor] constructor(); [CEReactions] attribute long value; - - // also has obsolete members }; [Exposed=Window] interface HTMLDListElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] interface HTMLDivElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] @@ -329,8 +299,6 @@ interface HTMLAnchorElement : HTMLElement { [CEReactions] attribute DOMString text; [CEReactions] attribute DOMString referrerPolicy; - - // also has obsolete members }; HTMLAnchorElement includes HTMLHyperlinkElementUtils; @@ -356,8 +324,6 @@ interface HTMLSpanElement : HTMLElement { [Exposed=Window] interface HTMLBRElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; interface mixin HTMLHyperlinkElementUtils { @@ -399,7 +365,7 @@ interface HTMLSourceElement : HTMLElement { }; [Exposed=Window, - NamedConstructor=Image(optional unsigned long width, optional unsigned long height)] + LegacyFactoryFunction=Image(optional unsigned long width, optional unsigned long height)] interface HTMLImageElement : HTMLElement { [HTMLConstructor] constructor(); @@ -421,8 +387,6 @@ interface HTMLImageElement : HTMLElement { [CEReactions] attribute DOMString loading; Promise decode(); - - // also has obsolete members }; [Exposed=Window] @@ -442,8 +406,6 @@ interface HTMLIFrameElement : HTMLElement { readonly attribute Document? contentDocument; readonly attribute WindowProxy? contentWindow; Document? getSVGDocument(); - - // also has obsolete members }; [Exposed=Window] @@ -455,8 +417,6 @@ interface HTMLEmbedElement : HTMLElement { [CEReactions] attribute DOMString width; [CEReactions] attribute DOMString height; Document? getSVGDocument(); - - // also has obsolete members }; [Exposed=Window] @@ -480,8 +440,6 @@ interface HTMLObjectElement : HTMLElement { boolean checkValidity(); boolean reportValidity(); void setCustomValidity(DOMString error); - - // also has obsolete members }; [Exposed=Window] @@ -490,8 +448,6 @@ interface HTMLParamElement : HTMLElement { [CEReactions] attribute DOMString name; [CEReactions] attribute DOMString value; - - // also has obsolete members }; [Exposed=Window] @@ -507,7 +463,7 @@ interface HTMLVideoElement : HTMLMediaElement { }; [Exposed=Window, - NamedConstructor=Audio(optional DOMString src)] + LegacyFactoryFunction=Audio(optional DOMString src)] interface HTMLAudioElement : HTMLMediaElement { [HTMLConstructor] constructor(); }; @@ -737,8 +693,6 @@ interface HTMLAreaElement : HTMLElement { [CEReactions] attribute DOMString rel; [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; [CEReactions] attribute DOMString referrerPolicy; - - // also has obsolete members }; HTMLAreaElement includes HTMLHyperlinkElementUtils; @@ -764,15 +718,11 @@ interface HTMLTableElement : HTMLElement { [SameObject] readonly attribute HTMLCollection rows; HTMLTableRowElement insertRow(optional long index = -1); [CEReactions] void deleteRow(long index); - - // also has obsolete members }; [Exposed=Window] interface HTMLTableCaptionElement : HTMLElement { [HTMLConstructor] constructor(); - - // also has obsolete members }; [Exposed=Window] @@ -780,8 +730,6 @@ interface HTMLTableColElement : HTMLElement { [HTMLConstructor] constructor(); [CEReactions] attribute unsigned long span; - - // also has obsolete members }; [Exposed=Window] @@ -791,8 +739,6 @@ interface HTMLTableSectionElement : HTMLElement { [SameObject] readonly attribute HTMLCollection rows; HTMLTableRowElement insertRow(optional long index = -1); [CEReactions] void deleteRow(long index); - - // also has obsolete members }; [Exposed=Window] @@ -804,8 +750,6 @@ interface HTMLTableRowElement : HTMLElement { [SameObject] readonly attribute HTMLCollection cells; HTMLTableCellElement insertCell(optional long index = -1); [CEReactions] void deleteCell(long index); - - // also has obsolete members }; [Exposed=Window] @@ -819,12 +763,10 @@ interface HTMLTableCellElement : HTMLElement { [CEReactions] attribute DOMString scope; // only conforming for th elements [CEReactions] attribute DOMString abbr; // only conforming for th elements - - // also has obsolete members }; [Exposed=Window, - OverrideBuiltins, + LegacyOverrideBuiltIns, LegacyUnenumerableNamedProperties] interface HTMLFormElement : HTMLElement { [HTMLConstructor] constructor(); @@ -898,7 +840,7 @@ interface HTMLInputElement : HTMLElement { [CEReactions] attribute DOMString step; [CEReactions] attribute DOMString type; [CEReactions] attribute DOMString defaultValue; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString value; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString value; attribute object? valueAsDate; attribute unrestricted double valueAsNumber; [CEReactions] attribute unsigned long width; @@ -922,8 +864,6 @@ interface HTMLInputElement : HTMLElement { void setRangeText(DOMString replacement); void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve"); void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); - - // also has obsolete members }; [Exposed=Window] @@ -1004,7 +944,7 @@ interface HTMLOptGroupElement : HTMLElement { }; [Exposed=Window, - NamedConstructor=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false)] + LegacyFactoryFunction=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false)] interface HTMLOptionElement : HTMLElement { [HTMLConstructor] constructor(); @@ -1039,7 +979,7 @@ interface HTMLTextAreaElement : HTMLElement { readonly attribute DOMString type; [CEReactions] attribute DOMString defaultValue; - attribute [TreatNullAs=EmptyString] DOMString value; + attribute [LegacyNullToEmptyString] DOMString value; readonly attribute unsigned long textLength; readonly attribute boolean willValidate; @@ -1130,8 +1070,6 @@ interface HTMLLegendElement : HTMLElement { [HTMLConstructor] constructor(); readonly attribute HTMLFormElement? form; - - // also has obsolete members }; enum SelectionMode { @@ -1210,7 +1148,6 @@ interface HTMLScriptElement : HTMLElement { [CEReactions] attribute DOMString integrity; [CEReactions] attribute DOMString referrerPolicy; - // also has obsolete members }; [Exposed=Window] @@ -1332,7 +1269,7 @@ interface mixin CanvasFillStrokeStyles { attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black) CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1); CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1); - CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition); + CanvasPattern? createPattern(CanvasImageSource image, [LegacyNullToEmptyString] DOMString repetition); }; @@ -1656,11 +1593,11 @@ dictionary DragEventInit : MouseEventInit { LegacyUnenumerableNamedProperties] interface Window : EventTarget { // the current browsing context - [Unforgeable] readonly attribute WindowProxy window; + [LegacyUnforgeable] readonly attribute WindowProxy window; [Replaceable] readonly attribute WindowProxy self; - [Unforgeable] readonly attribute Document document; + [LegacyUnforgeable] readonly attribute Document document; attribute DOMString name; - [PutForwards=href, Unforgeable] readonly attribute Location location; + [PutForwards=href, LegacyUnforgeable] readonly attribute Location location; readonly attribute History history; readonly attribute CustomElementRegistry customElements; [Replaceable] readonly attribute BarProp locationbar; @@ -1679,11 +1616,11 @@ interface Window : EventTarget { // other browsing contexts [Replaceable] readonly attribute WindowProxy frames; [Replaceable] readonly attribute unsigned long length; - [Unforgeable] readonly attribute WindowProxy? top; + [LegacyUnforgeable] readonly attribute WindowProxy? top; attribute any opener; [Replaceable] readonly attribute WindowProxy? parent; readonly attribute Element? frameElement; - WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank", optional [TreatNullAs=EmptyString] DOMString features = ""); + WindowProxy? open(optional USVString url = "", optional DOMString target = "_blank", optional [LegacyNullToEmptyString] DOMString features = ""); getter object (DOMString name); // Since this is the global object, the IDL named getter adds a NamedPropertiesObject exotic // object on the prototype chain. Indeed, this does not make the global object an exotic object. @@ -1731,21 +1668,21 @@ interface History { [Exposed=Window] interface Location { // but see also additional creation steps and overridden internal methods - [Unforgeable] stringifier attribute USVString href; - [Unforgeable] readonly attribute USVString origin; - [Unforgeable] attribute USVString protocol; - [Unforgeable] attribute USVString host; - [Unforgeable] attribute USVString hostname; - [Unforgeable] attribute USVString port; - [Unforgeable] attribute USVString pathname; - [Unforgeable] attribute USVString search; - [Unforgeable] attribute USVString hash; + [LegacyUnforgeable] stringifier attribute USVString href; + [LegacyUnforgeable] readonly attribute USVString origin; + [LegacyUnforgeable] attribute USVString protocol; + [LegacyUnforgeable] attribute USVString host; + [LegacyUnforgeable] attribute USVString hostname; + [LegacyUnforgeable] attribute USVString port; + [LegacyUnforgeable] attribute USVString pathname; + [LegacyUnforgeable] attribute USVString search; + [LegacyUnforgeable] attribute USVString hash; - [Unforgeable] void assign(USVString url); - [Unforgeable] void replace(USVString url); - [Unforgeable] void reload(); + [LegacyUnforgeable] void assign(USVString url); + [LegacyUnforgeable] void replace(USVString url); + [LegacyUnforgeable] void reload(); - [Unforgeable, SameObject] readonly attribute DOMStringList ancestorOrigins; + [LegacyUnforgeable, SameObject] readonly attribute DOMStringList ancestorOrigins; }; [Exposed=Window, @@ -1850,15 +1787,15 @@ dictionary PromiseRejectionEventInit : EventInit { any reason; }; -[TreatNonObjectAsNull] +[LegacyTreatNonObjectAsNull] callback EventHandlerNonNull = any (Event event); typedef EventHandlerNonNull? EventHandler; -[TreatNonObjectAsNull] +[LegacyTreatNonObjectAsNull] callback OnErrorEventHandlerNonNull = any ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long colno, optional any error); typedef OnErrorEventHandlerNonNull? OnErrorEventHandler; -[TreatNonObjectAsNull] +[LegacyTreatNonObjectAsNull] callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event); typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; @@ -1899,13 +1836,12 @@ interface mixin GlobalEventHandlers { attribute EventHandler onloadedmetadata; attribute EventHandler onloadstart; attribute EventHandler onmousedown; - [LenientThis] attribute EventHandler onmouseenter; - [LenientThis] attribute EventHandler onmouseleave; + [LegacyLenientThis] attribute EventHandler onmouseenter; + [LegacyLenientThis] attribute EventHandler onmouseleave; attribute EventHandler onmousemove; attribute EventHandler onmouseout; attribute EventHandler onmouseover; attribute EventHandler onmouseup; - attribute EventHandler onwheel; attribute EventHandler onpause; attribute EventHandler onplay; attribute EventHandler onplaying; @@ -1926,6 +1862,11 @@ interface mixin GlobalEventHandlers { attribute EventHandler ontoggle; attribute EventHandler onvolumechange; attribute EventHandler onwaiting; + attribute EventHandler onwebkitanimationend; + attribute EventHandler onwebkitanimationiteration; + attribute EventHandler onwebkitanimationstart; + attribute EventHandler onwebkittransitionend; + attribute EventHandler onwheel; }; interface mixin WindowEventHandlers { @@ -1978,6 +1919,21 @@ interface mixin WindowOrWorkerGlobalScope { Window includes WindowOrWorkerGlobalScope; WorkerGlobalScope includes WindowOrWorkerGlobalScope; +[Exposed=Window] +interface DOMParser { + constructor(); + + [NewObject] Document parseFromString(DOMString string, DOMParserSupportedType type); +}; + +enum DOMParserSupportedType { + "text/html", + "text/xml", + "application/xml", + "application/xhtml+xml", + "image/svg+xml" +}; + [Exposed=Window] interface Navigator { // objects implementing this interface also implement the interfaces given below @@ -2013,7 +1969,7 @@ interface mixin NavigatorLanguage { }; interface mixin NavigatorContentUtils { - [SecureContext] void registerProtocolHandler(DOMString scheme, USVString url, DOMString title); + [SecureContext] void registerProtocolHandler(DOMString scheme, USVString url); [SecureContext] void unregisterProtocolHandler(DOMString scheme, USVString url); }; @@ -2405,8 +2361,8 @@ interface HTMLFrameElement : HTMLElement { readonly attribute Document? contentDocument; readonly attribute WindowProxy? contentWindow; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString marginHeight; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString marginWidth; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString marginHeight; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString marginWidth; }; partial interface HTMLAnchorElement { @@ -2422,11 +2378,11 @@ partial interface HTMLAreaElement { }; partial interface HTMLBodyElement { - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString text; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString link; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString vLink; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString aLink; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString text; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString link; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString vLink; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString aLink; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor; [CEReactions] attribute DOMString background; }; @@ -2470,7 +2426,7 @@ partial interface HTMLEmbedElement { interface HTMLFontElement : HTMLElement { [HTMLConstructor] constructor(); - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString color; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString color; [CEReactions] attribute DOMString face; [CEReactions] attribute DOMString size; }; @@ -2497,8 +2453,8 @@ partial interface HTMLIFrameElement { [CEReactions] attribute DOMString frameBorder; [CEReactions] attribute USVString longDesc; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString marginHeight; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString marginWidth; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString marginHeight; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString marginWidth; }; partial interface HTMLImageElement { @@ -2509,7 +2465,7 @@ partial interface HTMLImageElement { [CEReactions] attribute unsigned long vspace; [CEReactions] attribute USVString longDesc; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString border; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString border; }; partial interface HTMLInputElement { @@ -2550,7 +2506,7 @@ partial interface HTMLObjectElement { [CEReactions] attribute DOMString codeBase; [CEReactions] attribute DOMString codeType; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString border; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString border; }; partial interface HTMLOListElement { @@ -2588,9 +2544,9 @@ partial interface HTMLTableElement { [CEReactions] attribute DOMString summary; [CEReactions] attribute DOMString width; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString cellPadding; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString cellSpacing; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString cellPadding; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString cellSpacing; }; partial interface HTMLTableSectionElement { @@ -2611,7 +2567,7 @@ partial interface HTMLTableCellElement { [CEReactions] attribute boolean noWrap; [CEReactions] attribute DOMString vAlign; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor; }; partial interface HTMLTableRowElement { @@ -2620,7 +2576,7 @@ partial interface HTMLTableRowElement { [CEReactions] attribute DOMString chOff; [CEReactions] attribute DOMString vAlign; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor; }; partial interface HTMLUListElement { @@ -2629,11 +2585,11 @@ partial interface HTMLUListElement { }; partial interface Document { - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString fgColor; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString linkColor; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString vlinkColor; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString alinkColor; - [CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString fgColor; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString linkColor; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString vlinkColor; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString alinkColor; + [CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor; [SameObject] readonly attribute HTMLCollection anchors; [SameObject] readonly attribute HTMLCollection applets; diff --git a/testing/web-platform/tests/mixed-content/generic/expect.py b/testing/web-platform/tests/mixed-content/generic/expect.py deleted file mode 100644 index 2c360c1d93..0000000000 --- a/testing/web-platform/tests/mixed-content/generic/expect.py +++ /dev/null @@ -1,106 +0,0 @@ -import json, os, urllib, urlparse - -def redirect(url, response): - response.add_required_headers = False - response.writer.write_status(301) - response.writer.write_header("access-control-allow-origin", "*") - response.writer.write_header("location", url) - response.writer.end_headers() - response.writer.write("") - -def create_redirect_url(request, swap_scheme = False): - parsed = urlparse.urlsplit(request.url) - destination_netloc = parsed.netloc - scheme = parsed.scheme - - if swap_scheme: - scheme = "http" if parsed.scheme == "https" else "https" - hostname = parsed.netloc.split(':')[0] - port = request.server.config["ports"][scheme][0] - destination_netloc = ":".join([hostname, str(port)]) - - # Remove "redirection" from query to avoid redirect loops. - parsed_query = dict(urlparse.parse_qsl(parsed.query)) - assert "redirection" in parsed_query - del parsed_query["redirection"] - - destination_url = urlparse.urlunsplit(urlparse.SplitResult( - scheme = scheme, - netloc = destination_netloc, - path = parsed.path, - query = urllib.urlencode(parsed_query), - fragment = None)) - - return destination_url - -def main(request, response): - if "redirection" in request.GET: - redirection = request.GET["redirection"] - if redirection == "no-redirect": - pass - elif redirection == "keep-scheme-redirect": - redirect(create_redirect_url(request, swap_scheme=False), response) - return - elif redirection == "swap-scheme-redirect": - redirect(create_redirect_url(request, swap_scheme=True), response) - return - else: - raise ValueError ("Invalid redirect type: %s" % redirection) - - content_type = "text/plain" - response_data = "" - - if "action" in request.GET: - action = request.GET["action"] - - if "content_type" in request.GET: - content_type = request.GET["content_type"] - - key = request.GET["key"] - stash = request.server.stash - path = request.GET.get("path", request.url.split('?'))[0] - - if action == "put": - value = request.GET["value"] - stash.take(key=key, path=path) - stash.put(key=key, value=value, path=path) - response_data = json.dumps({"status": "success", "result": key}) - elif action == "purge": - value = stash.take(key=key, path=path) - if content_type == "image/png": - response_data = open(os.path.join(request.doc_root, - "images", - "smiley.png"), "rb").read() - elif content_type == "audio/wav": - response_data = open(os.path.join(request.doc_root, - "webaudio", "resources", "sin_440Hz_-6dBFS_1s.wav"), "rb").read() - elif content_type == "video/ogg": - response_data = open(os.path.join(request.doc_root, - "media", - "movie_5.ogv"), "rb").read() - elif content_type == "application/javascript": - response_data = open(os.path.join(request.doc_root, - "mixed-content", - "generic", - "worker.js"), "rb").read() - elif content_type == "text/javascript": - response_data = open(os.path.join(request.doc_root, - "mixed-content", - "generic", - "script.js"), "rb").read() - else: - response_data = "/* purged */" - elif action == "take": - value = stash.take(key=key, path=path) - if value is None: - status = "allowed" - else: - status = "blocked" - response_data = json.dumps({"status": status, "result": value}) - - response.add_required_headers = False - response.writer.write_status(200) - response.writer.write_header("content-type", content_type) - response.writer.write_header("cache-control", "no-cache; must-revalidate") - response.writer.end_headers() - response.writer.write(response_data) diff --git a/testing/web-platform/tests/mixed-content/generic/mixed-content-test-case.js b/testing/web-platform/tests/mixed-content/generic/mixed-content-test-case.js index b2c0bcdea1..eb9fc13f7c 100644 --- a/testing/web-platform/tests/mixed-content/generic/mixed-content-test-case.js +++ b/testing/web-platform/tests/mixed-content/generic/mixed-content-test-case.js @@ -3,9 +3,48 @@ * @author burnik@google.com (Kristijan Burnik) */ -function wrapResult(server_data) { - // Currently the returned value is not used in mixed-content tests. - return null; +// TODO: This function is currently placed and duplicated at: +// - mixed-content/generic/mixed-content-test-case.js +// - referrer-policy/generic/referrer-policy-test-case.js +// but should be moved to /common/security-features/resources/common.js. +function getSubresourceOrigin(originType) { + const httpProtocol = "http"; + const httpsProtocol = "https"; + const wsProtocol = "ws"; + const wssProtocol = "wss"; + + const sameOriginHost = "{{host}}"; + const crossOriginHost = "{{domains[www1]}}"; + + // These values can evaluate to either empty strings or a ":port" string. + const httpPort = getNormalizedPort(parseInt("{{ports[http][0]}}", 10)); + const httpsPort = getNormalizedPort(parseInt("{{ports[https][0]}}", 10)); + const wsPort = getNormalizedPort(parseInt("{{ports[ws][0]}}", 10)); + const wssPort = getNormalizedPort(parseInt("{{ports[wss][0]}}", 10)); + + /** + @typedef OriginType + @type {string} + + Represents the origin of the subresource request URL. + The keys of `originMap` below are the valid values. + + Note that there can be redirects from the specified origin + (see RedirectionType), and thus the origin of the subresource + response URL might be different from what is specified by OriginType. + */ + const originMap = { + "same-https": httpsProtocol + "://" + sameOriginHost + httpsPort, + "same-http": httpProtocol + "://" + sameOriginHost + httpPort, + "cross-https": httpsProtocol + "://" + crossOriginHost + httpsPort, + "cross-http": httpProtocol + "://" + crossOriginHost + httpPort, + "same-wss": wssProtocol + "://" + sameOriginHost + wssPort, + "same-ws": wsProtocol + "://" + sameOriginHost + wsPort, + "cross-wss": wssProtocol + "://" + crossOriginHost + wssPort, + "cross-ws": wsProtocol + "://" + crossOriginHost + wsPort, + }; + + return originMap[originType]; } /** @@ -21,156 +60,65 @@ function wrapResult(server_data) { * @return {object} Object wrapping the start method used to run the test. */ function MixedContentTestCase(scenario, description, sanityChecker) { - var httpProtocol = "http"; - var httpsProtocol = "https"; - var wsProtocol = "ws"; - var wssProtocol = "wss"; + sanityChecker.checkScenario(scenario, subresourceMap); - var sameOriginHost = location.hostname; - var crossOriginHost = "{{domains[www1]}}"; - - // These values can evaluate to either empty strings or a ":port" string. - var httpPort = getNormalizedPort(parseInt("{{ports[http][0]}}", 10)); - var httpsPort = getNormalizedPort(parseInt("{{ports[https][0]}}", 10)); - var wsPort = getNormalizedPort(parseInt("{{ports[ws][0]}}", 10)); - var wssPort = getNormalizedPort(parseInt("{{ports[wss][0]}}", 10)); - - var resourcePath = "/mixed-content/generic/expect.py"; - var wsResourcePath = "/stash_responder"; - - // Map all endpoints to scenario for use in the test. - var endpoint = { - "same-origin": - location.origin + resourcePath, - "same-host-https": - httpsProtocol + "://" + sameOriginHost + httpsPort + resourcePath, - "same-host-http": - httpProtocol + "://" + sameOriginHost + httpPort + resourcePath, - "cross-origin-https": - httpsProtocol + "://" + crossOriginHost + httpsPort + resourcePath, - "cross-origin-http": - httpProtocol + "://" + crossOriginHost + httpPort + resourcePath, - "same-host-wss": - wssProtocol + "://" + sameOriginHost + wssPort + wsResourcePath, - "same-host-ws": - wsProtocol + "://" + sameOriginHost + wsPort + wsResourcePath, - "cross-origin-wss": - wssProtocol + "://" + crossOriginHost + wssPort + wsResourcePath, - "cross-origin-ws": - wsProtocol + "://" + crossOriginHost + wsPort + wsResourcePath - }; - - // Mapping all the resource requesting methods to the scenario. - var resourceMap = { - "a-tag": requestViaAnchor, - "area-tag": requestViaArea, - "beacon-request": requestViaSendBeacon, - "fetch-request": requestViaFetch, - "form-tag": requestViaForm, - "iframe-tag": requestViaIframe, - "img-tag": requestViaImage, - "script-tag": requestViaScript, - "worker-request": - url => requestViaDedicatedWorker(url), - "module-worker-top-level": - url => requestViaDedicatedWorker(url, {type: "module"}), - "module-data-worker-import": - url => requestViaDedicatedWorker(workerUrlThatImports(url), {type: "module"}), - "classic-data-worker-fetch": - url => requestViaDedicatedWorker(dedicatedWorkerUrlThatFetches(url), {}), - "xhr-request": requestViaXhr, - "audio-tag": requestViaAudio, - "video-tag": requestViaVideo, - "picture-tag": requestViaPicture, - "object-tag": requestViaObject, - "link-css-tag": requestViaLinkStylesheet, - "link-prefetch-tag": requestViaLinkPrefetch, - "websocket-request": requestViaWebSocket - }; - - // Mapping all expected MIME types to the scenario. - var contentType = { - "a-tag": "text/html", - "area-tag": "text/html", - "beacon-request": "text/plain", - "fetch-request": "application/json", - "form-tag": "text/html", - "iframe-tag": "text/html", - "img-tag": "image/png", - "script-tag": "text/javascript", - - "worker-request": "application/javascript", - "module-worker-top-level": "application/javascript", - "module-data-worker-import": "application/javascript", - "classic-data-worker-fetch": "application/javascript", - - "xhr-request": "application/json", - "audio-tag": "audio/wav", - "video-tag": "video/ogg", - "picture-tag": "image/png", - "object-tag": "text/html", - "link-css-tag": "text/css", - "link-prefetch-tag": "text/html", - "websocket-request": "application/json" - }; - - for (const workletType of ['animation', 'audio', 'layout', 'paint']) { - resourceMap[`worklet-${workletType}-top-level`] = - url => requestViaWorklet(workletType, url); - contentType[`worklet-${workletType}-top-level`] = - "application/javascript"; - - resourceMap[`worklet-${workletType}-data-import`] = - url => requestViaWorklet(workletType, workerUrlThatImports(url)); - contentType[`worklet-${workletType}-data-import`] = - "application/javascript"; + let sourceContextList = []; + let subresourceType = scenario.subresource; + if (subresourceType === 'classic-data-worker-fetch') { + // Currently 'classic-data-worker-fetch' (fetch API from inside classic + // data: worker) is handled as a kind of subresource request + // on the genarator side, but should be processed using the combination of + // SourceContext list (classic data: worker) + Subresource (fetch API) + // on the JavaScript side. + // We bridge this inconsistency here, and will later pass these information + // directly from the generated tests and remove this conversion here. + subresourceType = 'fetch-request'; + sourceContextList = [{sourceContextType: 'classic-data-worker'}]; } - sanityChecker.checkScenario(scenario, resourceMap); + const originTypeConversion = { + "same-host-https": "same-https", + "same-host-http": "same-http", + "cross-origin-https": "cross-https", + "cross-origin-http": "cross-http", + "same-host-wss": "same-wss", + "same-host-ws": "same-ws", + "cross-origin-wss": "cross-wss", + "cross-origin-ws": "cross-ws", + }; - var mixed_content_test = async_test(description); + const urls = getRequestURLs(subresourceType, + originTypeConversion[scenario.origin], + scenario.redirection); + const checkResult = _ => { + // Send request to check if the key has been torn down. + return xhrRequest(urls.assertUrl) + .then(assertResult => { + // Now check if the value has been torn down. If it's still there, + // we have blocked the request to mixed-content. + assert_equals(assertResult.status, scenario.expectation, + "The resource request should be '" + scenario.expectation + "'."); + }); + }; function runTest() { - sanityChecker.setFailTimeout(mixed_content_test); + /** @type {Subresource} */ + const subresource = { + subresourceType: subresourceType, + url: urls.testUrl, + policyDeliveries: [] + }; - var key = guid(); - var value = guid(); - // We use the same path for both HTTP/S and WS/S stash requests. - var stash_path = encodeURIComponent("/mixed-content"); - var announceResourceRequestUrl = endpoint['same-origin'] + - "?action=put&key=" + key + - "&value=" + value + - "&path=" + stash_path; - var assertResourceRequestUrl = endpoint['same-origin'] + - "?action=take&key=" + key + - "&path=" + stash_path; - var resourceRequestUrl = endpoint[scenario.origin] + "?redirection=" + - scenario.redirection + "&action=purge&key=" + key + - "&path=" + stash_path + "&content_type=" + - contentType[scenario.subresource]; - - xhrRequest(announceResourceRequestUrl) - .then(mixed_content_test.step_func(_ => { + promise_test(() => { + return xhrRequest(urls.announceUrl) // Send out the real resource request. // This should tear down the key if it's not blocked. - return resourceMap[scenario.subresource](resourceRequestUrl); - })) - .then(mixed_content_test.step_func(_ => { - // Send request to check if the key has been torn down. - return xhrRequest(assertResourceRequestUrl); - })) - .catch(mixed_content_test.step_func(e => { - // When requestResource fails, we also check the key state. - return xhrRequest(assertResourceRequestUrl); - })) - .then(mixed_content_test.step_func_done(response => { - // Now check if the value has been torn down. If it's still there, - // we have blocked the request to mixed-content. - assert_equals(response.status, scenario.expectation, - "The resource request should be '" + scenario.expectation + "'."); - })); - + .then(_ => invokeRequest(subresource, sourceContextList)) + // We check the key state, regardless of whether the main request + // succeeded or failed. + .then(checkResult, checkResult); + }, description); } // runTest - return {start: mixed_content_test.step_func(runTest) }; + return {start: runTest}; } // MixedContentTestCase diff --git a/testing/web-platform/tests/mixed-content/generic/script.js b/testing/web-platform/tests/mixed-content/generic/script.js deleted file mode 100644 index 2d1cdf0a4b..0000000000 --- a/testing/web-platform/tests/mixed-content/generic/script.js +++ /dev/null @@ -1 +0,0 @@ -postMessage("", "*"); diff --git a/testing/web-platform/tests/mixed-content/generic/worker.js b/testing/web-platform/tests/mixed-content/generic/worker.js deleted file mode 100644 index 7e2168bcc0..0000000000 --- a/testing/web-platform/tests/mixed-content/generic/worker.js +++ /dev/null @@ -1 +0,0 @@ -postMessage('done'); diff --git a/testing/web-platform/tests/referrer-policy/README.md b/testing/web-platform/tests/referrer-policy/README.md index 164db5ef84..303362df92 100644 --- a/testing/web-platform/tests/referrer-policy/README.md +++ b/testing/web-platform/tests/referrer-policy/README.md @@ -223,7 +223,6 @@ var scenario = { "source_protocol": "http", "target_protocol": "http", "subresource": "iframe-tag", - "subresource_path": "/referrer-policy/generic/subresource/document.py", "referrer_url": "origin" }; ``` diff --git a/testing/web-platform/tests/referrer-policy/css-integration/README.md b/testing/web-platform/tests/referrer-policy/css-integration/README.md index 14da25c4d9..150b0e6526 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/README.md +++ b/testing/web-platform/tests/referrer-policy/css-integration/README.md @@ -1,7 +1,7 @@ These tests exercise different ways to fetch a resource (image, font-face, svg references), generated via the sub-resource python script in ```./generic/subresource/``` (for example, loading an image: -```/referrer-policy/generic/subresource/image.py?id=```) and later verify +```/common/security-features/subresource/image.py?id=```) and later verify the headers used to fetch the resource. Since there is no way to wait for a resource referenced from CSS to be loaded, @@ -11,4 +11,4 @@ after the resource (hopefully) was loaded. Since there is also no way to retrieve headers (or other information) from resources loaded via CSS, we store the headers with the given ```UUID``` as key on the server, and retrieve them later via an XHR, for example: -```/referrer-policy/generic/subresource/image.py?id=&report-headers```. +```/common/security-features/subresource/image.py?id=&report-headers```. diff --git a/testing/web-platform/tests/referrer-policy/css-integration/child-css/external-import-stylesheet.html b/testing/web-platform/tests/referrer-policy/css-integration/child-css/external-import-stylesheet.html index 2efb8000bc..0d26645aa7 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/child-css/external-import-stylesheet.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/child-css/external-import-stylesheet.html @@ -21,9 +21,9 @@ let id = token(); let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; let css_url = url_prefix + - "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + + "/common/security-features/subresource/stylesheet.py?id=" + id + "&import-rule" + "&referrer-policy=no-referrer"; - let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" + + let check_url = url_prefix + "/common/security-features/subresource/stylesheet.py" + "?id=" + id + "&report-headers"; return new Promise(resolve => { diff --git a/testing/web-platform/tests/referrer-policy/css-integration/child-css/internal-import-stylesheet.html b/testing/web-platform/tests/referrer-policy/css-integration/child-css/internal-import-stylesheet.html index 75db8b6a73..5e0ac6b270 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/child-css/internal-import-stylesheet.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/child-css/internal-import-stylesheet.html @@ -20,8 +20,8 @@ promise_test(function(css_test) { let id = token(); let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; - let css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&import-rule"; - let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" + + let css_url = url_prefix + "/common/security-features/subresource/stylesheet.py?id=" + id + "&import-rule"; + let check_url = url_prefix + "/common/security-features/subresource/stylesheet.py" + "?id=" + id + "&report-headers"; let style = document.createElement("style"); diff --git a/testing/web-platform/tests/referrer-policy/css-integration/child-css/processing-instruction.html b/testing/web-platform/tests/referrer-policy/css-integration/child-css/processing-instruction.html index fed3d17b33..88474aae73 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/child-css/processing-instruction.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/child-css/processing-instruction.html @@ -20,7 +20,7 @@ let id = token(); let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port + - "/referrer-policy/generic/subresource/stylesheet.py?id=" + + "/common/security-features/subresource/stylesheet.py?id=" + id; let css_url = url_prefix + "&import-rule"; let expected = url_prefix + "&import-rule"; diff --git a/testing/web-platform/tests/referrer-policy/css-integration/css-test-helper.js b/testing/web-platform/tests/referrer-policy/css-integration/css-test-helper.js index 0afa9e1b87..dc97ccc063 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/css-test-helper.js +++ b/testing/web-platform/tests/referrer-policy/css-integration/css-test-helper.js @@ -1,6 +1,6 @@ var svg_ns = "http://www.w3.org/2000/svg"; var url_prefix = location.protocol + "//" + location.hostname + ":" + - location.port + "/referrer-policy/generic/subresource/"; + location.port + "/common/security-features/subresource/"; var svg_test_properties = [ 'fill', diff --git a/testing/web-platform/tests/referrer-policy/css-integration/font-face/external-import-stylesheet.html b/testing/web-platform/tests/referrer-policy/css-integration/font-face/external-import-stylesheet.html index 998a467755..164f8a5d1e 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/font-face/external-import-stylesheet.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/font-face/external-import-stylesheet.html @@ -22,12 +22,12 @@ let id = token(); let css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + - "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + + "/common/security-features/subresource/stylesheet.py?id=" + id + "&import-rule" + "&type=font"; let url_prefix = location.protocol + "//" + location.hostname + ":" + location.port; let css_referrer = url_prefix + - "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&type=font"; - let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" + + "/common/security-features/subresource/stylesheet.py?id=" + id + "&type=font"; + let font_url = url_prefix + "/common/security-features/subresource/font.py" + "?id=" + id + "&report-headers" + "&type=font"; return new Promise(resolve => { diff --git a/testing/web-platform/tests/referrer-policy/css-integration/font-face/external-stylesheet.html b/testing/web-platform/tests/referrer-policy/css-integration/font-face/external-stylesheet.html index d300e1445a..c7908939cc 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/font-face/external-stylesheet.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/font-face/external-stylesheet.html @@ -20,8 +20,8 @@ promise_test(function(css_test) { let id = token(); let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; - let css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&type=font"; - let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" + + let css_url = url_prefix + "/common/security-features/subresource/stylesheet.py?id=" + id + "&type=font"; + let font_url = url_prefix + "/common/security-features/subresource/font.py" + "?id=" + id + "&report-headers"; return new Promise(resolve => { diff --git a/testing/web-platform/tests/referrer-policy/css-integration/font-face/internal-import-stylesheet.html b/testing/web-platform/tests/referrer-policy/css-integration/font-face/internal-import-stylesheet.html index 47d160bc20..74a3cbde0a 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/font-face/internal-import-stylesheet.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/font-face/internal-import-stylesheet.html @@ -21,7 +21,7 @@ promise_test(function(css_test) { let id = token(); let url_prefix = location.protocol + "//www1." + location.hostname + ":" + - location.port + "/referrer-policy/generic/subresource/"; + location.port + "/common/security-features/subresource/"; let css_url = url_prefix + "stylesheet.py?id=" + id + "&type=font"; let font_url = url_prefix + "font.py?report-headers&id=" + id; diff --git a/testing/web-platform/tests/referrer-policy/css-integration/font-face/internal-stylesheet.html b/testing/web-platform/tests/referrer-policy/css-integration/font-face/internal-stylesheet.html index c05d08e391..078536ee38 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/font-face/internal-stylesheet.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/font-face/internal-stylesheet.html @@ -21,7 +21,7 @@ let id = token(); let css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + - "/referrer-policy/generic/subresource/font.py" + "?id=" + + "/common/security-features/subresource/font.py" + "?id=" + id + "&type=font"; let font_url = css_url + "&report-headers"; diff --git a/testing/web-platform/tests/referrer-policy/css-integration/font-face/processing-instruction.html b/testing/web-platform/tests/referrer-policy/css-integration/font-face/processing-instruction.html index e254743c49..bae74857f3 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/font-face/processing-instruction.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/font-face/processing-instruction.html @@ -22,12 +22,12 @@ let id = token(); let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; let css_url = url_prefix + - "/referrer-policy/generic/subresource/stylesheet.py?id=" + + "/common/security-features/subresource/stylesheet.py?id=" + id + "&type=font"; let expected = url_prefix + - "/referrer-policy/generic/subresource/stylesheet.py?id=" + + "/common/security-features/subresource/stylesheet.py?id=" + id + "&type=font"; - let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" + + let font_url = url_prefix + "/common/security-features/subresource/font.py" + "?id=" + id + "&report-headers"; let processingInstruction = diff --git a/testing/web-platform/tests/referrer-policy/css-integration/image/external-import-stylesheet.html b/testing/web-platform/tests/referrer-policy/css-integration/image/external-import-stylesheet.html index f572ab5c65..5f5069b715 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/image/external-import-stylesheet.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/image/external-import-stylesheet.html @@ -21,13 +21,13 @@ promise_test(function(css_test) { var id = token(); var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + - "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + + "/common/security-features/subresource/stylesheet.py?id=" + id + "&import-rule" + "&type=image"; var url_prefix = location.protocol + "//" + location.hostname + ":" + location.port; var css_referrer = url_prefix + - "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + + "/common/security-features/subresource/stylesheet.py?id=" + id + "&type=image"; - var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" + + var img_url = url_prefix + "/common/security-features/subresource/image.py" + "?id=" + id + "&report-headers"; return new Promise(resolve => { diff --git a/testing/web-platform/tests/referrer-policy/css-integration/image/external-stylesheet.html b/testing/web-platform/tests/referrer-policy/css-integration/image/external-stylesheet.html index 9c0d8b5ac1..a3b061d79e 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/image/external-stylesheet.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/image/external-stylesheet.html @@ -20,8 +20,8 @@ promise_test(function(css_test) { var id = token(); var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; - var css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id; - var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" + + var css_url = url_prefix + "/common/security-features/subresource/stylesheet.py?id=" + id; + var img_url = url_prefix + "/common/security-features/subresource/image.py" + "?id=" + id + "&report-headers"; return new Promise(resolve => { diff --git a/testing/web-platform/tests/referrer-policy/css-integration/image/inline-style.html b/testing/web-platform/tests/referrer-policy/css-integration/image/inline-style.html index 9a2d3bdf1d..a0e9daabbc 100644 --- a/testing/web-platform/tests/referrer-policy/css-integration/image/inline-style.html +++ b/testing/web-platform/tests/referrer-policy/css-integration/image/inline-style.html @@ -19,7 +19,7 @@ - +

Check that resources loaded via link rel prefetch use the referrer and referrer policy from the document.

@@ -58,12 +57,6 @@ "properties": {}, "message": "assert_true: Original dictionary should be defined expected true got false" }, - { - "name": "Partial dictionary B: original dictionary defined", - "status_string": "PASS", - "properties": {}, - "message": null - }, { "name": "Partial dictionary B[2]: original dictionary defined", "status_string": "PASS", @@ -76,6 +69,12 @@ "properties": {}, "message": null }, + { + "name": "Partial dictionary B[4]: original dictionary defined", + "status_string": "PASS", + "properties": {}, + "message": null + }, { "name": "Partial dictionary C: original dictionary defined", "status_string": "FAIL", diff --git a/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html b/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html index 7a5b17751b..40f5dbfcc7 100644 --- a/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html +++ b/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html @@ -89,7 +89,7 @@ idlArray.test(); "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError", "status_string": "FAIL", "properties": {}, - "message": "assert_throws: function \"function() {\n Object.setPrototypeOf(obj, newValue);\n }\" did not throw" + "message": "assert_throws_js: function \"function() {\n Object.setPrototypeOf(obj, newValue);\n }\" did not throw" }, { "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false", @@ -101,7 +101,7 @@ idlArray.test(); "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError", "status_string": "FAIL", "properties": {}, - "message": "assert_throws: function \"function() {\n obj.__proto__ = newValue;\n }\" did not throw" + "message": "assert_throws_js: function \"function() {\n obj.__proto__ = newValue;\n }\" did not throw" }, { "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw", @@ -125,7 +125,7 @@ idlArray.test(); "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError", "status_string": "FAIL", "properties": {}, - "message": "assert_throws: function \"function() {\n Object.setPrototypeOf(obj, newValue);\n }\" did not throw" + "message": "assert_throws_js: function \"function() {\n Object.setPrototypeOf(obj, newValue);\n }\" did not throw" }, { "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false", @@ -137,7 +137,7 @@ idlArray.test(); "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError", "status_string": "FAIL", "properties": {}, - "message": "assert_throws: function \"function() {\n obj.__proto__ = newValue;\n }\" did not throw" + "message": "assert_throws_js: function \"function() {\n obj.__proto__ = newValue;\n }\" did not throw" }, { "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw", diff --git a/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_interface_mixin.html b/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_interface_mixin.html new file mode 100644 index 0000000000..a9a9094fe3 --- /dev/null +++ b/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_interface_mixin.html @@ -0,0 +1,83 @@ + + + + + + + idlharness: interface mixins + + + + + + + + +

Verify the series of sub-tests that are executed for "interface mixin" objects.

+ + + + + diff --git a/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_partial_interface_of.html b/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_partial_interface_of.html index 0c752bdc6c..d0e83af966 100644 --- a/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_partial_interface_of.html +++ b/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_partial_interface_of.html @@ -4,8 +4,7 @@ - - idlharness: Partail interface + idlharness: Partial interface @@ -94,6 +93,15 @@ assert_false('L' in idlArray.members, 'L should be picked up'); }, 'partial mixin dep implications'); })(); + + // Name clash (partials) + (() => { + const idlArray = new IdlArray(); + idlArray.add_idls(` + interface M { attribute any A; }; + partial interface M { attribute any A; };`); + idlArray.collapse_partials(); + })(); + + + + diff --git a/testing/web-platform/tests/svg/styling/presentation-attributes-relevant.html b/testing/web-platform/tests/svg/styling/presentation-attributes-relevant.html new file mode 100644 index 0000000000..b5f9343690 --- /dev/null +++ b/testing/web-platform/tests/svg/styling/presentation-attributes-relevant.html @@ -0,0 +1,20 @@ + + +SVG presentation attributes - on relevant elements + + + + + + diff --git a/testing/web-platform/tests/svg/styling/presentation-attributes-special-cases.html b/testing/web-platform/tests/svg/styling/presentation-attributes-special-cases.html new file mode 100644 index 0000000000..c544c9c7a6 --- /dev/null +++ b/testing/web-platform/tests/svg/styling/presentation-attributes-special-cases.html @@ -0,0 +1,149 @@ + + +SVG presentation attributes - special cases + + + + + + diff --git a/testing/web-platform/tests/svg/styling/presentation-attributes-unknown.html b/testing/web-platform/tests/svg/styling/presentation-attributes-unknown.html new file mode 100644 index 0000000000..487175b144 --- /dev/null +++ b/testing/web-platform/tests/svg/styling/presentation-attributes-unknown.html @@ -0,0 +1,20 @@ + + +SVG presentation attributes - on unknown SVG elements + + + + + + diff --git a/testing/web-platform/tests/svg/styling/presentation-attributes.js b/testing/web-platform/tests/svg/styling/presentation-attributes.js new file mode 100644 index 0000000000..c9dc14ad49 --- /dev/null +++ b/testing/web-platform/tests/svg/styling/presentation-attributes.js @@ -0,0 +1,385 @@ +const PROPERTIES = { + "alignment-baseline": { + value: "middle", + relevantElement: "text", + irrelevantElement: "rect", + }, + "baseline-shift": { + value: "1", + relevantElement: "text", + irrelevantElement: "rect", + }, + "clip-path": { + value: "url(#e)", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "clip-rule": { + value: "evenodd", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "color": { + value: "blue", + relevantElement: "g", + irrelevantElement: "image", + }, + "color-interpolation-filters": { + value: "sRGB", + relevantElement: "filter", + irrelevantElement: "linearGradient", + }, + "color-interpolation": { + value: "linearRGB", + relevantElement: "linearGradient", + irrelevantElement: "image", + }, + "cursor": { + value: "pointer", + relevantElement: "g", + irrelevantElement: "defs", + }, + "cx": { + value: "1", + relevantElement: "circle", + irrelevantElement: null, + }, + "cy": { + value: "1", + relevantElement: "circle", + irrelevantElement: null, + }, + "direction": { + value: "rtl", + relevantElement: "text", + irrelevantElement: "rect", + }, + "display": { + value: "block", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "d": { + value: "M0,0 L1,1", + relevantElement: "path", + irrelevantElement: "image", + }, + "dominant-baseline": { + value: "middle", + relevantElement: "text", + irrelevantElement: "rect", + }, + "fill": { + value: "blue", + relevantElement: "g", + irrelevantElement: "image", + }, + "fill-opacity": { + value: "0.5", + relevantElement: "g", + irrelevantElement: "image", + }, + "fill-rule": { + value: "evenodd", + relevantElement: "path", + irrelevantElement: "image", + }, + "filter": { + value: "url(#e)", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "flood-color": { + value: "blue", + relevantElement: "feFlood", + irrelevantElement: "rect", + }, + "flood-opacity": { + value: "0.5", + relevantElement: "feFlood", + irrelevantElement: "rect", + }, + "font-family": { + value: "Test Family", + relevantElement: "text", + irrelevantElement: "rect", + }, + "font-size": { + value: "50", + relevantElement: "text", + irrelevantElement: "rect", + }, + "font-size-adjust": { + value: "0.5", + relevantElement: "text", + irrelevantElement: "rect", + }, + "font-stretch": { + value: "expanded", + relevantElement: "text", + irrelevantElement: "rect", + }, + "font-style": { + value: "italic", + relevantElement: "text", + irrelevantElement: "rect", + }, + "font-variant": { + value: "small-caps", + relevantElement: "text", + irrelevantElement: "rect", + }, + "font-weight": { + value: "900", + relevantElement: "text", + irrelevantElement: "rect", + }, + "glyph-orientation-vertical": { + value: "90", + relevantElement: "text", + irrelevantElement: "rect", + }, + "height": { + value: "1", + relevantElement: "rect", + irrelevantElement: "path", + }, + "image-rendering": { + value: "optimizeSpeed", + relevantElement: "image", + irrelevantElement: "path", + }, + "letter-spacing": { + value: "1px", + relevantElement: "text", + irrelevantElement: "rect", + }, + "lighting-color": { + value: "blue", + relevantElement: "feDiffuseLighting", + irrelevantElement: "rect", + }, + "marker-end": { + value: "url(#e)", + relevantElement: "path", + irrelevantElement: "image", + }, + "marker-mid": { + value: "url(#e)", + relevantElement: "path", + irrelevantElement: "image", + }, + "marker-start": { + value: "url(#e)", + relevantElement: "path", + irrelevantElement: "image", + }, + "mask-type": { + value: "alpha", + relevantElement: "mask", + irrelevantElement: "rect", + }, + "mask": { + value: "url(#e)", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "opacity": { + value: "0.5", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "overflow": { + value: "scroll", + relevantElement: "svg", + irrelevantElement: "rect", + }, + "paint-order": { + value: "fill stroke", + relevantElement: "path", + irrelevantElement: "image", + }, + "pointer-events": { + value: "none", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "r": { + value: "1", + relevantElement: "circle", + irrelevantElement: "rect", + }, + "rx": { + value: "1", + relevantElement: "rect", + irrelevantElement: "path", + }, + "ry": { + value: "1", + relevantElement: "rect", + irrelevantElement: "path", + }, + "shape-rendering": { + value: "geometricPrecision", + relevantElement: "path", + irrelevantElement: "image", + }, + "stop-color": { + value: "blue", + relevantElement: "stop", + irrelevantElement: "rect", + }, + "stop-opacity": { + value: "0.5", + relevantElement: "stop", + irrelevantElement: "rect", + }, + "stroke": { + value: "blue", + relevantElement: "path", + irrelevantElement: "image", + }, + "stroke-dasharray": { + value: "1 1", + relevantElement: "path", + irrelevantElement: "image", + }, + "stroke-dashoffset": { + value: "1", + relevantElement: "path", + irrelevantElement: "image", + }, + "stroke-linecap": { + value: "round", + relevantElement: "path", + irrelevantElement: "image", + }, + "stroke-linejoin": { + value: "round", + relevantElement: "path", + irrelevantElement: "image", + }, + "stroke-miterlimit": { + value: "1", + relevantElement: "path", + irrelevantElement: "image", + }, + "stroke-opacity": { + value: "0.5", + relevantElement: "path", + irrelevantElement: "image", + }, + "stroke-width": { + value: "2", + relevantElement: "path", + irrelevantElement: "image", + }, + "text-anchor": { + value: "middle", + relevantElement: "text", + irrelevantElement: "rect", + }, + "text-decoration": { + value: "underline", + relevantElement: "text", + irrelevantElement: "rect", + }, + "text-overflow": { + value: "ellipsis", + relevantElement: "text", + irrelevantElement: "rect", + }, + "text-rendering": { + value: "geometricPrecision", + relevantElement: "text", + irrelevantElement: "rect", + }, + "transform-origin": { + value: "1px 1px", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "transform": { + value: "scale(2)", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "unicode-bidi": { + value: "embed", + relevantElement: "text", + irrelevantElement: "rect", + }, + "vector-effect": { + value: "non-scaling-stroke", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "visibility": { + value: "hidden", + relevantElement: "g", + irrelevantElement: "linearGradient", + }, + "white-space": { + value: "pre", + relevantElement: "text", + irrelevantElement: "rect", + }, + "width": { + value: "1", + relevantElement: "rect", + irrelevantElement: "path", + }, + "word-spacing": { + value: "1", + relevantElement: "text", + irrelevantElement: "rect", + }, + "writing-mode": { + value: "vertical-rl", + relevantElement: "text", + irrelevantElement: "rect", + }, + "x": { + value: "1", + relevantElement: "rect", + irrelevantElement: "path", + }, + "y": { + value: "1", + relevantElement: "rect", + irrelevantElement: "path", + }, +}; + +function presentationAttributeIsSupported(element, attribute, value, property) { + let e = document.createElementNS("http://www.w3.org/2000/svg", element); + svg.append(e); + let propertyValueBefore = getComputedStyle(e).getPropertyValue(property); + e.setAttribute(attribute, value); + let propertyValueAfter = getComputedStyle(e).getPropertyValue(property); + e.remove(); + return propertyValueBefore != propertyValueAfter; +} + +function assertPresentationAttributeIsSupported(element, attribute, value, property) { + assert_true( + presentationAttributeIsSupported(element, attribute, value, property), + `Presentation attribute ${attribute}="${value}" should be supported on ${element} element` + ); +} + +function assertPresentationAttributeIsNotSupported(element, attribute, value, property) { + assert_false( + presentationAttributeIsSupported(element, attribute, value, property), + `Presentation attribute ${attribute}="${value}" should be supported on ${element} element` + ); +} + +function propertiesAreSupported(properties) { + for (let p of properties) { + if (!CSS.supports(p, "initial")) { + return false; + } + } + return true; +} diff --git a/testing/web-platform/tests/upgrade-insecure-requests/support/testharness-helper.sub.js b/testing/web-platform/tests/upgrade-insecure-requests/support/testharness-helper.sub.js index 70378edd15..8b58eb9560 100644 --- a/testing/web-platform/tests/upgrade-insecure-requests/support/testharness-helper.sub.js +++ b/testing/web-platform/tests/upgrade-insecure-requests/support/testharness-helper.sub.js @@ -1,9 +1,3 @@ -// Used by common.js. -function wrapResult(server_data) { - // Currently the returned value is not used in mixed-content tests. - return null; -} - const Host = { SAME_ORIGIN: "same-origin", CROSS_ORIGIN: "cross-origin", diff --git a/testing/web-platform/tests/webgl/webgl1-idlharness.any.js b/testing/web-platform/tests/webgl/idlharness.any.js similarity index 91% rename from testing/web-platform/tests/webgl/webgl1-idlharness.any.js rename to testing/web-platform/tests/webgl/idlharness.any.js index 2cf8039523..d6131f4884 100644 --- a/testing/web-platform/tests/webgl/webgl1-idlharness.any.js +++ b/testing/web-platform/tests/webgl/idlharness.any.js @@ -7,7 +7,7 @@ 'use strict'; idl_test( - ['webgl1'], + ['webgl1', 'webgl2'], ['dom'], idl_array => { // TODO: objects diff --git a/testing/web-platform/tests/webgl/webgl2-idlharness.any.js b/testing/web-platform/tests/webgl/webgl2-idlharness.any.js deleted file mode 100644 index c8efcd031f..0000000000 --- a/testing/web-platform/tests/webgl/webgl2-idlharness.any.js +++ /dev/null @@ -1,15 +0,0 @@ -// META: script=/resources/WebIDLParser.js -// META: script=/resources/idlharness.js -// META: timeout=long - -// https://www.khronos.org/registry/webgl/specs/latest/1.0/ - -'use strict'; - -idl_test( - ['webgl2'], - ['webgl1', 'dom'], - idl_array => { - // TODO: objects - } -); diff --git a/testing/web-platform/tests/xhr/send-redirect-to-cors.htm b/testing/web-platform/tests/xhr/send-redirect-to-cors.htm index 04a2a1ffe8..54d7eb550d 100644 --- a/testing/web-platform/tests/xhr/send-redirect-to-cors.htm +++ b/testing/web-platform/tests/xhr/send-redirect-to-cors.htm @@ -12,11 +12,11 @@ if (body === null) { return { body: "", type: "NO" }; } - if (typeof body == "string") { + if (typeof body === "string") { return { body: body, type: "text/plain;charset=UTF-8" }; } if (body instanceof Uint8Array) { - var arr = Array.prototype.slice.call(body); + const arr = Array.prototype.slice.call(body); return { body: String.fromCharCode.apply(null, arr), type: "NO" } } return { body: "EXTRACT NOT IMPLEMENTED", type: "EXTRACT NOT IMPLEMENTED" } @@ -24,49 +24,54 @@ function redirect(code, name = code, method = "GET", body = null, explicitType = null, safelistContentType = false) { async_test(t => { - var client = new XMLHttpRequest() + let { body: expectedBody, type: expectedType } = extractBody(body); + if (explicitType !== null) { + expectedType = explicitType; + } + let expectedMethod = method; + if (((code === "301" || code === "302") && method === "POST") || (code === "303" && method !== "GET" && method !== "HEAD")) { + expectedMethod = "GET"; + expectedBody = ""; + expectedType = "NO"; + } + const client = new XMLHttpRequest(); client.onreadystatechange = t.step_func(() => { - if (client.readyState == 4) { - if (explicitType !== "application/x-pony" || safelistContentType) { - var { body: expectedBody, type: expectedType } = extractBody(body); - if (explicitType !== null) { - expectedType = explicitType - } - if (((code === "301" || code === "302") && method === "POST") || code === "303") { - method = "GET" - expectedBody = "" - } + if (client.readyState === 4) { + if ((expectedMethod === "GET" && expectedType === "NO") || explicitType !== "application/x-pony" || safelistContentType) { assert_equals(client.status, 200); - assert_equals(client.getResponseHeader("x-request-method"), method); + assert_equals(client.getResponseHeader("x-request-method"), expectedMethod); assert_equals(client.getResponseHeader("x-request-content-type"), expectedType); assert_equals(client.getResponseHeader("x-request-data"), expectedBody); } else { // "application/x-pony" is not safelisted by corsenabled.py -> network error - assert_equals(client.status, 0) - assert_equals(client.statusText, "") - assert_equals(client.responseText, "") - assert_equals(client.responseXML, null) + assert_equals(client.status, 0); + assert_equals(client.statusText, ""); + assert_equals(client.responseText, ""); + assert_equals(client.responseXML, null); } t.done(); } - }) - let safelist = "" + }); + let safelist = ""; if (safelistContentType) { - safelist = "?safelist_content_type" + safelist = "?safelist_content_type"; } - client.open(method, "resources/redirect.py?location="+encodeURIComponent("http://www2."+location.host+(location.pathname.replace(/[^\/]+$/, ''))+'resources/corsenabled.py')+safelist+"&code=" + code) + client.open(method, "resources/redirect.py?location="+encodeURIComponent("http://www2."+location.host+(location.pathname.replace(/[^\/]+$/, ''))+'resources/corsenabled.py')+safelist+"&code=" + code); if (explicitType !== null) { - client.setRequestHeader("Content-Type", explicitType) + client.setRequestHeader("Content-Type", explicitType); } - client.send(body) - }, document.title + " (" + name + ")") + client.send(body); + }, document.title + " (" + name + ")"); } + // corsenabled.py safelists methods GET, POST, PUT, and FOO redirect("301") redirect("301", "301 GET with explicit Content-Type", "GET", null, "application/x-pony") redirect("301", "301 GET with explicit Content-Type safelisted", "GET", null, "application/x-pony", true) + redirect("303", "303 GET with explicit Content-Type safelisted", "GET", null, "application/x-pony", true) redirect("302") redirect("303") - redirect("303", "303 LALA with string and explicit Content-Type safelisted", "LALA", "test", "application/x-pony", true) + redirect("302", "302 FOO with string and explicit Content-Type safelisted", "FOO", "test", "application/x-pony", true) + redirect("303", "303 FOO with string and explicit Content-Type safelisted", "FOO", "test", "application/x-pony", true) redirect("307") redirect("307", "307 post with null", "POST", null) redirect("307", "307 post with string", "POST", "hello") diff --git a/testing/xpcshell/moz-http2/moz-http2-child.js b/testing/xpcshell/moz-http2/moz-http2-child.js new file mode 100644 index 0000000000..4d4cdc276d --- /dev/null +++ b/testing/xpcshell/moz-http2/moz-http2-child.js @@ -0,0 +1,29 @@ +/* eslint-env node */ + +function sendBackResponse(evalResult, e) { + const output = { result: evalResult, error: "", errorStack: "" }; + if (e) { + output.error = e.toString(); + output.errorStack = e.stack; + } + process.send(output); +} + +process.on("message", msg => { + const code = msg.code; + let evalResult = null; + try { + // eslint-disable-next-line no-eval + evalResult = eval(code); + if (evalResult instanceof Promise) { + evalResult + .then(x => sendBackResponse(x)) + .catch(e => sendBackResponse(undefined, e)); + return; + } + } catch (e) { + sendBackResponse(undefined, e); + return; + } + sendBackResponse(evalResult); +}); diff --git a/testing/xpcshell/moz-http2/moz-http2.js b/testing/xpcshell/moz-http2/moz-http2.js index 7ff6133312..310ac836b9 100644 --- a/testing/xpcshell/moz-http2/moz-http2.js +++ b/testing/xpcshell/moz-http2/moz-http2.js @@ -5,24 +5,20 @@ // This module is the stateful server side of test_http2.js and is meant // to have node be restarted in between each invocation -var node_http2_root = '../node-http2'; +/* eslint-env node */ + +var node_http2_root = "../node-http2"; if (process.env.NODE_HTTP2_ROOT) { node_http2_root = process.env.NODE_HTTP2_ROOT; } var http2 = require(node_http2_root); -var fs = require('fs'); -var net = require('net'); -var url = require('url'); -var crypto = require('crypto'); +var fs = require("fs"); +var url = require("url"); +var crypto = require("crypto"); const dnsPacket = require(`${node_http2_root}/../dns-packet`); const ip = require(`${node_http2_root}/../node-ip`); - -let http2_internal = null; -try { - http2_internal = require('http2'); -} catch (_) { - // silently ignored -} +const { fork } = require("child_process"); +const path = require("path"); // Hook into the decompression code to log the decompressed name-value pairs var compression_module = node_http2_root + "/lib/protocol/compressor"; @@ -41,34 +37,34 @@ HeaderSetDecompressor.prototype.read = function() { decompressedPairs.push(pair); } return pair; -} +}; var connection_module = node_http2_root + "/lib/protocol/connection"; var http2_connection = require(connection_module); var Connection = http2_connection.Connection; var originalClose = Connection.prototype.close; -Connection.prototype.close = function (error, lastId) { +Connection.prototype.close = function(error, lastId) { if (lastId !== undefined) { this._lastIncomingStream = lastId; } originalClose.apply(this, arguments); -} +}; var framer_module = node_http2_root + "/lib/protocol/framer"; var http2_framer = require(framer_module); var Serializer = http2_framer.Serializer; var originalTransform = Serializer.prototype._transform; -var newTransform = function (frame, encoding, done) { - if (frame.type == 'DATA') { +var newTransform = function(frame, encoding, done) { + if (frame.type == "DATA") { // Insert our empty DATA frame - emptyFrame = {}; - emptyFrame.type = 'DATA'; - emptyFrame.data = new Buffer(0); + const emptyFrame = {}; + emptyFrame.type = "DATA"; + emptyFrame.data = Buffer.alloc(0); emptyFrame.flags = []; emptyFrame.stream = frame.stream; var buffers = []; - Serializer['DATA'](emptyFrame, buffers); + Serializer.DATA(emptyFrame, buffers); Serializer.commonHeader(emptyFrame, buffers); for (var i = 0; i < buffers.length; i++) { this.push(buffers[i]); @@ -80,20 +76,23 @@ var newTransform = function (frame, encoding, done) { originalTransform.apply(this, arguments); }; -function getHttpContent(path) { - var content = '' + - '' + - 'HOORAY!' + - // 'You Win!' used in tests to check we reached this server - 'You Win! (by requesting' + path + ')' + - ''; +function getHttpContent(pathName) { + var content = + "" + + "" + + "HOORAY!" + + // 'You Win!' used in tests to check we reached this server + "You Win! (by requesting" + + pathName + + ")" + + ""; return content; } function generateContent(size) { - var content = ''; + var content = ""; for (var i = 0; i < size; i++) { - content += '0'; + content += "0"; } return content; } @@ -106,9 +105,9 @@ var m = { mp1start: 0, mp2start: 0, - checkReady: function() { + checkReady() { if (this.mp1res != null && this.mp2res != null) { - this.buf = generateContent(30*1024); + this.buf = generateContent(30 * 1024); this.mp1start = 0; this.mp2start = 0; this.send(this.mp1res, 0); @@ -116,7 +115,7 @@ var m = { } }, - send: function(res, start) { + send(res, start) { var end = Math.min(start + 1024, this.buf.length); var content = this.buf.substring(start, end); res.write(content); @@ -125,29 +124,29 @@ var m = { } else { res.end(); } - } + }, }; var runlater = function() {}; runlater.prototype = { - req : null, - resp : null, + req: null, + resp: null, - onTimeout : function onTimeout() { + onTimeout: function onTimeout() { this.resp.writeHead(200); this.resp.end("It's all good 750ms."); - } + }, }; var moreData = function() {}; moreData.prototype = { - req : null, - resp : null, + req: null, + resp: null, iter: 3, - onTimeout : function onTimeout() { + onTimeout: function onTimeout() { // 1mb of data - content = generateContent(1024*1024); + const content = generateContent(1024 * 1024); this.resp.write(content); // 1mb chunk this.iter--; if (!this.iter) { @@ -155,7 +154,7 @@ moreData.prototype = { } else { setTimeout(executeRunLater, 1, this); } - } + }, }; function executeRunLater(arg) { @@ -168,16 +167,38 @@ var originalCompressHeaders = Compressor.prototype.compress; function insertSoftIllegalHpack(headers) { var originalCompressed = originalCompressHeaders.apply(this, headers); - var illegalLiteral = new Buffer([ - 0x00, // Literal, no index - 0x08, // Name: not huffman encoded, 8 bytes long - 0x3a, 0x69, 0x6c, 0x6c, 0x65, 0x67, 0x61, 0x6c, // :illegal - 0x10, // Value: not huffman encoded, 16 bytes long - // REALLY NOT LEGAL - 0x52, 0x45, 0x41, 0x4c, 0x4c, 0x59, 0x20, 0x4e, 0x4f, 0x54, 0x20, 0x4c, 0x45, 0x47, 0x41, 0x4c + var illegalLiteral = Buffer.from([ + 0x00, // Literal, no index + 0x08, // Name: not huffman encoded, 8 bytes long + 0x3a, + 0x69, + 0x6c, + 0x6c, + 0x65, + 0x67, + 0x61, + 0x6c, // :illegal + 0x10, // Value: not huffman encoded, 16 bytes long + // REALLY NOT LEGAL + 0x52, + 0x45, + 0x41, + 0x4c, + 0x4c, + 0x59, + 0x20, + 0x4e, + 0x4f, + 0x54, + 0x20, + 0x4c, + 0x45, + 0x47, + 0x41, + 0x4c, ]); var newBufferLength = originalCompressed.length + illegalLiteral.length; - var concatenated = new Buffer(newBufferLength); + var concatenated = Buffer.alloc(newBufferLength); originalCompressed.copy(concatenated, 0); illegalLiteral.copy(concatenated, originalCompressed.length); return concatenated; @@ -193,7 +214,7 @@ function insertHardIllegalHpack(headers) { // Set the first bit to 1 to signal this is an indexed representation illegalIndexed[0] |= 0x80; var newBufferLength = originalCompressed.length + illegalIndexed.length; - var concatenated = new Buffer(newBufferLength); + var concatenated = Buffer.alloc(newBufferLength); originalCompressed.copy(concatenated, 0); illegalIndexed.copy(concatenated, originalCompressed.length); return concatenated; @@ -205,9 +226,9 @@ var didRst = false; var rstConnection = null; var illegalheader_conn = null; -var ns_confirm = 0; var cname_confirm = 0; +// eslint-disable-next-line complexity function handleRequest(req, res) { // We do this first to ensure nothing goes wonky in our tests that don't want // the headers to have something illegal in them @@ -221,549 +242,579 @@ function handleRequest(req, res) { var pushPushServer1, pushPushServer2, pushPushServer3, pushPushServer4; if (req.httpVersionMajor === 2) { - res.setHeader('X-Connection-Http2', 'yes'); - res.setHeader('X-Http2-StreamId', '' + req.stream.id); + res.setHeader("X-Connection-Http2", "yes"); + res.setHeader("X-Http2-StreamId", "" + req.stream.id); } else { - res.setHeader('X-Connection-Http2', 'no'); + res.setHeader("X-Connection-Http2", "no"); } - if (u.pathname === '/exit') { - res.setHeader('Content-Type', 'text/plain'); - res.setHeader('Connection', 'close'); + if (u.pathname === "/exit") { + res.setHeader("Content-Type", "text/plain"); + res.setHeader("Connection", "close"); res.writeHead(200); - res.end('ok'); + res.end("ok"); process.exit(); } - if (u.pathname === '/750ms') { - var rl = new runlater(); + if (u.pathname === "/750ms") { + let rl = new runlater(); rl.req = req; rl.resp = res; setTimeout(executeRunLater, 750, rl); return; - } - - else if ((u.pathname === '/multiplex1') && (req.httpVersionMajor === 2)) { - res.setHeader('Content-Type', 'text/plain'); + } else if (u.pathname === "/multiplex1" && req.httpVersionMajor === 2) { + res.setHeader("Content-Type", "text/plain"); res.writeHead(200); m.mp1res = res; m.checkReady(); return; - } - - else if ((u.pathname === '/multiplex2') && (req.httpVersionMajor === 2)) { - res.setHeader('Content-Type', 'text/plain'); + } else if (u.pathname === "/multiplex2" && req.httpVersionMajor === 2) { + res.setHeader("Content-Type", "text/plain"); res.writeHead(200); m.mp2res = res; m.checkReady(); return; - } - - else if (u.pathname === "/header") { + } else if (u.pathname === "/header") { var val = req.headers["x-test-header"]; if (val) { res.setHeader("X-Received-Test-Header", val); } - } - - else if (u.pathname === "/doubleheader") { - res.setHeader('Content-Type', 'text/html'); + } else if (u.pathname === "/doubleheader") { + res.setHeader("Content-Type", "text/html"); res.writeHead(200); res.write(content); res.writeHead(200); res.end(); return; - } - - else if (u.pathname === "/cookie_crumbling") { + } else if (u.pathname === "/cookie_crumbling") { res.setHeader("X-Received-Header-Pairs", JSON.stringify(decompressedPairs)); - } - - else if (u.pathname === "/push") { - push = res.push('/push.js'); + } else if (u.pathname === "/push") { + push = res.push("/push.js"); push.writeHead(200, { - 'content-type': 'application/javascript', - 'pushed' : 'yes', - 'content-length' : 11, - 'X-Connection-Http2': 'yes' + "content-type": "application/javascript", + pushed: "yes", + "content-length": 11, + "X-Connection-Http2": "yes", }); - push.end('// comments'); + push.end("// comments"); content = '