diff options
141 files changed, 2035 insertions, 943 deletions
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini deleted file mode 100644 index f64b45fea6b..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[hit-test-floats-002.html] - [Hit test float] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-003.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-003.html.ini new file mode 100644 index 00000000000..f29da48a2a0 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-003.html.ini @@ -0,0 +1,4 @@ +[hit-test-floats-003.html] + [Miss float below something else] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini b/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini index 4a1e8110f6f..f8e7e539aae 100644 --- a/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini +++ b/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini @@ -2,3 +2,6 @@ [Hit test intersecting scaled box] expected: FAIL + [Hit test within unscaled box] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini index 628b1fab770..c884dc82eab 100644 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini +++ b/tests/wpt/metadata-layout-2020/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini @@ -2,3 +2,6 @@ [listeners are called when <iframe> is resized] expected: FAIL + [listeners are called correct number of times] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-iframes.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-iframes.html.ini index 6ef8bb1049f..171592fc08f 100644 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-iframes.html.ini +++ b/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-iframes.html.ini @@ -2,6 +2,3 @@ [elementsFromPoint on the root document for points in iframe elements] expected: FAIL - [elementsFromPoint on inner documents] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini deleted file mode 100644 index e181af5397f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[elementsFromPoint-invalid-cases.html] - [The root element is the last element returned for otherwise empty queries within the viewport] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini index a08d89ae8c0..399a692c10d 100644 --- a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini @@ -312,27 +312,21 @@ [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] expected: NOTRUN - [<iframe>: separate response Content-Type: text/plain */*] - expected: FAIL - - [<iframe>: separate response Content-Type: text/html */*] - expected: FAIL - [<iframe>: separate response Content-Type: text/html;" \\" text/plain] expected: FAIL [<iframe>: combined response Content-Type: text/html;x=" text/plain] expected: FAIL - [<iframe>: separate response Content-Type: text/plain */*;charset=gbk] + [<iframe>: separate response Content-Type: text/html */*;charset=gbk] expected: FAIL - [<iframe>: combined response Content-Type: text/html;" text/plain] + [<iframe>: combined response Content-Type: */* text/html] expected: FAIL - [<iframe>: separate response Content-Type: text/html */*;charset=gbk] + [<iframe>: combined response Content-Type: text/html */*] expected: FAIL - [<iframe>: separate response Content-Type: text/plain ] + [<iframe>: combined response Content-Type: text/html */*;charset=gbk] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/fetch/content-type/script.window.js.ini b/tests/wpt/metadata-layout-2020/fetch/content-type/script.window.js.ini index c7413d589dc..d2df9b78483 100644 --- a/tests/wpt/metadata-layout-2020/fetch/content-type/script.window.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/content-type/script.window.js.ini @@ -56,9 +56,3 @@ [separate text/javascript x/x] expected: FAIL - [separate text/javascript;charset=windows-1252 error text/javascript] - expected: FAIL - - [separate text/javascript;charset=windows-1252 text/javascript] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini b/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini deleted file mode 100644 index 87b07c3e670..00000000000 --- a/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[traverse_the_history_1.html] - [Multiple history traversals from the same task] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini b/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini index 385376c7321..75d75b4cda2 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini +++ b/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini @@ -1,4 +1,4 @@ -[traverse_the_history_4.html] +[traverse_the_history_2.html] [Multiple history traversals, last would be aborted] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini b/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini deleted file mode 100644 index 385376c7321..00000000000 --- a/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[traverse_the_history_4.html] - [Multiple history traversals, last would be aborted] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html.ini b/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html.ini index c6f45be1eb2..e63fe7c263e 100644 --- a/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html.ini +++ b/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html.ini @@ -1,5 +1,5 @@ [iframe_sandbox_popups_escaping-2.html] - expected: TIMEOUT + expected: CRASH [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html.ini b/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html.ini index 295031c1812..ab43ed7acf4 100644 --- a/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html.ini +++ b/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html.ini @@ -1,5 +1,5 @@ [iframe_sandbox_popups_escaping-3.html] - expected: TIMEOUT + expected: CRASH [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html.ini b/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html.ini index 9eb581fcf1f..0407f0cc2b7 100644 --- a/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html.ini +++ b/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html.ini @@ -1,5 +1,5 @@ [iframe_sandbox_popups_nonescaping-2.html] - expected: CRASH + expected: TIMEOUT [Check that popups from a sandboxed iframe do not escape the sandbox] expected: NOTRUN diff --git a/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations.html.ini b/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations.html.ini new file mode 100644 index 00000000000..8414d1376ee --- /dev/null +++ b/tests/wpt/metadata-layout-2020/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations.html.ini @@ -0,0 +1,14 @@ +[image-loading-lazy-relevant-mutations.html] + expected: ERROR + [Image referrerPolicy mutation does not cause deferred loading=lazy images to be fetched] + expected: NOTRUN + + [Image src mutation does not cause deferred loading=lazy images to be fetched] + expected: NOTRUN + + [Images are lazyloaded] + expected: TIMEOUT + + [Image crossOrigin mutation does not cause deferred loading=lazy images to be fetched] + expected: NOTRUN + diff --git a/tests/wpt/metadata-layout-2020/html/semantics/interactive-elements/the-dialog-element/centering.html.ini b/tests/wpt/metadata-layout-2020/html/semantics/interactive-elements/the-dialog-element/centering.html.ini new file mode 100644 index 00000000000..3b9b7cf0834 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/html/semantics/interactive-elements/the-dialog-element/centering.html.ini @@ -0,0 +1,43 @@ +[centering.html] + [horizontal-tb (container vertical-rl) (dialog horizontal-tb): tall viewport] + expected: FAIL + + [vertical-rl (dialog horizontal-tb): tall viewport] + expected: FAIL + + [vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport] + expected: FAIL + + [vertical-lr (dialog horizontal-tb): tall viewport] + expected: FAIL + + [horizontal-tb (container vertical-rl): tall viewport] + expected: FAIL + + [horizontal-tb: tall viewport] + expected: FAIL + + [vertical-rl (container horizontal-tb): tall viewport] + expected: FAIL + + [horizontal-tb: square viewport] + expected: FAIL + + [horizontal-tb: wide viewport] + expected: FAIL + + [horizontal-tb: dialog and viewport match] + expected: FAIL + + [vertical-lr: dialog bigger than viewport] + expected: FAIL + + [vertical-rl: tall viewport] + expected: FAIL + + [horizontal-tb: dialog bigger than viewport] + expected: FAIL + + [vertical-lr: tall viewport] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/html/webappapis/scripting/events/compile-event-handler-settings-objects.html.ini b/tests/wpt/metadata-layout-2020/html/webappapis/scripting/events/compile-event-handler-settings-objects.html.ini index 450c88bd32b..dbec6f2c2ff 100644 --- a/tests/wpt/metadata-layout-2020/html/webappapis/scripting/events/compile-event-handler-settings-objects.html.ini +++ b/tests/wpt/metadata-layout-2020/html/webappapis/scripting/events/compile-event-handler-settings-objects.html.ini @@ -3,6 +3,3 @@ [The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document] expected: TIMEOUT - [The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini b/tests/wpt/metadata-layout-2020/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini index 66bd350083b..a56bad443a2 100644 --- a/tests/wpt/metadata-layout-2020/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini +++ b/tests/wpt/metadata-layout-2020/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini @@ -1,4 +1,5 @@ [realtimeanalyser-fft-scaling.html] + expected: TIMEOUT [X 2048-point FFT peak position is not equal to 64. Got 0.] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/workers/shared-worker-in-data-url-context.window.js.ini b/tests/wpt/metadata-layout-2020/workers/shared-worker-in-data-url-context.window.js.ini index 6d92f8835c6..10dda3a6659 100644 --- a/tests/wpt/metadata-layout-2020/workers/shared-worker-in-data-url-context.window.js.ini +++ b/tests/wpt/metadata-layout-2020/workers/shared-worker-in-data-url-context.window.js.ini @@ -1,8 +1,7 @@ [shared-worker-in-data-url-context.window.html] - expected: TIMEOUT [Create a shared worker in a data url frame] - expected: TIMEOUT + expected: FAIL [Create a data url shared worker in a data url frame] - expected: NOTRUN + expected: FAIL diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index e4a11d75e8b..0d9a9c3b2fc 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -163489,7 +163489,7 @@ ] ], "block-aspect-ratio-008.tentative.html": [ - "8575d96c769cc585c186efe634906d8c80285a86", + "1e508149d90d811905407c9c1a03ac1dea456434", [ null, [ @@ -228708,7 +228708,7 @@ ] }, "forced-colors-mode-01.html": [ - "1f4e3899a8a4d7db6fe0f484671eb69040fc1c2d", + "9c0ef0b30939e797101ed3eddd69a4ae999c9288", [ null, [ @@ -236634,6 +236634,19 @@ {} ] ], + "set-current-time-before-play.html": [ + "194de216d38580ec5f1fc187b99c225ca5c95b6d", + [ + null, + [ + [ + "/scroll-animations/animation-ref.html", + "==" + ] + ], + {} + ] + ], "two-animations-attach-to-same-scroll-timeline-cancel-one.html": [ "1519e51c67717ae0e7995bc9586e60a5b3a5f126", [ @@ -242560,7 +242573,7 @@ }, "support": { ".azure-pipelines.yml": [ - "264e5d076d15df90e657ec3fe921dd089a9a6ccf", + "9b8676ef43f8803ce437a4a43d29bfc1820f4476", [] ], ".codecov.yml": [ @@ -245467,13 +245480,29 @@ "7dd1c6ddaf795769ce06682ef9abd68eeff1ddc4", [] ], + "cross-origin-iframe-redirect-with-fp-delegation.https.html.headers": [ + "b2bc98de5d70328f5930d8baf020be5ccb80dd95", + [] + ], + "cross-origin-navigation-redirect.https.html.headers": [ + "e157e45b79820e59a8ebda26c12d23e7a52c813b", + [] + ], + "cross-origin-subresource-redirect-with-fp-delegation.https.html.headers": [ + "5515b8a591ff6084b3f69826e522a31eac4af36e", + [] + ], + "cross-origin-subresource-redirect.https.html.headers": [ + "e157e45b79820e59a8ebda26c12d23e7a52c813b", + [] + ], + "cross-origin-syncxhr-redirect.https.html.headers": [ + "e157e45b79820e59a8ebda26c12d23e7a52c813b", + [] + ], "resources": { - "accept-ch-and-redir-to-do-not-expect.py": [ - "eaca03fe76d474264226061ce639eb421dd28c94", - [] - ], - "accept-ch-and-redir-to-expect.py": [ - "835ef396b8bae0294088bc0231422c8c0f446a45", + "accept-ch-and-redir.py": [ + "706983c9a06dcf52588394ed851e36503bc647a0", [] ], "accept-ch-blank.html": [ @@ -245485,7 +245514,7 @@ [] ], "accept-ch-test.js": [ - "879745706c01af6744abf3d0a641380dea4645d5", + "a08843699016ef90efa6dee5c2db324b460a16aa", [] ], "accept-ch.html": [ @@ -245509,7 +245538,7 @@ [] ], "do-not-expect-received.py": [ - "6b0e61af9dbaef571a1373c4d1020105bf38459e", + "ba647ede53bceaf88e4ab40b51b87243633e9bc7", [] ], "echo-client-hints-received.py": [ @@ -245521,7 +245550,7 @@ [] ], "expect-received.py": [ - "5aab578ae3482dc32da85658bac0d7fcb4b0bc87", + "bec3bffc2822a602e1f7a7b0c7b9b6e9c145ab95", [] ], "feature-policy-with-cross-origin-subresource.html": [ @@ -245548,7 +245577,11 @@ "cb762eff806849df46dc758ef7b98b63f27f54c9", [] ] - } + }, + "same-origin-subresource-redirect-opted-in.https.html.headers": [ + "e157e45b79820e59a8ebda26c12d23e7a52c813b", + [] + ] }, "http-equiv-accept-ch-merge.https.html.headers": [ "8759b65606b192b0dcb73cfd465de8529a159ba0", @@ -316184,7 +316217,7 @@ [] ], "safari.md": [ - "fb8b7be2e5275dc7196c559573a73d3685e1f2a0", + "0ff8fe5d95e8aed678e3f1d0e357f6518011537b", [] ], "webkitgtk_minibrowser.md": [ @@ -318486,7 +318519,7 @@ [] ], "event-timing-test-utils.js": [ - "e2a69b5c5b49a17f93ccc22937f7f33b45848c24", + "6045a054e7c00395854b29f8aa2a869d6064d83c", [] ], "slow-image.py": [ @@ -320667,12 +320700,12 @@ [] ], "generic-sensor-tests.js": [ - "1843734a3bb0adf4d9e853af4ba74ae39aa33f41", + "22101ccc2731df9c3a8933c8ee7d20375d27b1da", [] ], "resources": { "generic-sensor-helpers.js": [ - "aff6d172d46c960e72b180a1f9784776f9b55521", + "c2afb400207d1ebf92c227522acec550e06ac8f3", [] ], "iframe_sensor_handler.html": [ @@ -333658,7 +333691,7 @@ ] }, "lint.ignore": [ - "8cfef1eded28757dc13edda1bd30c002fa6dd80d", + "ddb9f9fcc077383dd70e9b5f16d4db21e43ea8bc", [] ], "loading": { @@ -335490,7 +335523,7 @@ ], "resources": { "orientation-event-helpers.js": [ - "307c52f00032d913bda5ac40e5bc8b39c9a72f98", + "3f81fec5867f7f05ea1dbfafb091c9a0f5da563a", [] ] } @@ -335538,6 +335571,10 @@ "b028fcd9a36ff71b0eacd0363121a1fe2774f384", [] ], + "going-back.sub.https.html.headers": [ + "ea3f6b335c7620acf59f546fd48484bf624ccb38", + [] + ], "parent-yes-child-no-same.sub.https.html.headers": [ "ea3f6b335c7620acf59f546fd48484bf624ccb38", [] @@ -335574,13 +335611,17 @@ "ea3f6b335c7620acf59f546fd48484bf624ccb38", [] ], + "removing-iframes.sub.https.html.headers": [ + "ea3f6b335c7620acf59f546fd48484bf624ccb38", + [] + ], "resources": { "helpers.mjs": [ - "fcef1b7e74f4d99995405d2602cc5e08a3fbddb6", + "684785809254f511efe10463a6a701403568a60b", [] ], "send-origin-isolation-header.py": [ - "1a39740f64f83d5e7d7a3f0fc39eb1a01fdc714a", + "b0ba30fcd4939ffff6dfe6fc8959a831187c257e", [] ] } @@ -338370,7 +338411,7 @@ [] ], "generic_sensor_mocks.js": [ - "3ee748c9730bb99f1c51af4d82d62c4316a2edab", + "fe2f70be34ebdeeb74ddac5e5fa4b39684b0e3b5", [] ], "generic_sensor_mocks.js.headers": [ @@ -352229,7 +352270,7 @@ [] ], "RTCDTMFSender-helper.js": [ - "87f7ae13c7e21cccc11e3810df6cf705e3cee68b", + "4316c3804a28f44d1f86af97c86e478570b2437a", [] ], "RTCIceTransport-extension-helper.js": [ @@ -352237,7 +352278,7 @@ [] ], "RTCPeerConnection-helper.js": [ - "679cb85b12adfa98d3fdbedf6abb6d68a687bb47", + "b7ed92a9cd28d88761b71ac476393cafdcbc2130", [] ], "RTCRtpCapabilities-helper.js": [ @@ -352312,7 +352353,7 @@ }, "tools": { ".eslintrc.js": [ - "09f9c60c9835f4ef1f041e5710a4afc12b3f64f3", + "321f8e9a25499ea1073f0746578bce0c006eb62d", [] ], "README.md": [ @@ -356445,7 +356486,7 @@ "testharness": { "BackgroundSync": { "idlharness.https.any.js": [ - "8d4b9a583f484741f4cd4e4940833a890c612656", + "120477a51e61ad32f629e991a12e8bc99c4dbb7e", [ "BackgroundSync/idlharness.https.any.html", { @@ -356457,8 +356498,13 @@ [ "script", "/resources/idlharness.js" + ], + [ + "timeout", + "long" ] - ] + ], + "timeout": "long" } ], [ @@ -356472,8 +356518,13 @@ [ "script", "/resources/idlharness.js" + ], + [ + "timeout", + "long" ] - ] + ], + "timeout": "long" } ] ] @@ -367993,10 +368044,12 @@ ] ], "AmbientLightSensor.https.html": [ - "2383a2de2187f863c0299688a2f6ad80972648b6", + "7d23896a6488f3fdfef6809f552a06f03fe427a3", [ null, - {} + { + "timeout": "long" + } ] ], "AmbientLightSensor_insecure_context.html": [ @@ -372429,6 +372482,24 @@ } ] ], + "cross-origin-iframe-redirect-with-fp-delegation.https.html": [ + "a2bc66fca1e13232ff77a7511440313d03e0d93b", + [ + null, + { + "timeout": "long" + } + ] + ], + "cross-origin-navigation-redirect.https.html": [ + "14ba51ab5d080085d4f4ffb68b9e51ab8eb84cdd", + [ + null, + { + "timeout": "long" + } + ] + ], "cross-origin-navigation.https.html": [ "e05c8e3ef5bf853c04acc396166e0cd5a6a00b60", [ @@ -372438,6 +372509,24 @@ } ] ], + "cross-origin-subresource-redirect-with-fp-delegation.https.html": [ + "dd7b9fab9719555a8530f672e165b653bf27b975", + [ + null, + { + "timeout": "long" + } + ] + ], + "cross-origin-subresource-redirect.https.html": [ + "31334543cf261339c237a52fb45111a54283e963", + [ + null, + { + "timeout": "long" + } + ] + ], "cross-origin-subresource-with-feature-policy.https.html": [ "3108c23faabfa254e3ebd0c12122e8e44e39e38b", [ @@ -372456,6 +372545,15 @@ } ] ], + "cross-origin-syncxhr-redirect.https.html": [ + "1cce664d2c51b4469c4a122c51a648b85aea6536", + [ + null, + { + "timeout": "long" + } + ] + ], "http-equiv-cross-origin-iframe-not-setting-other-origins.https.html": [ "226b3116fc173ebb7c217df94addbcadbfacec04", [ @@ -372545,7 +372643,7 @@ ] ], "same-origin-navigation-redirect.https.html": [ - "2ab128f2d8273841d53dcd301e032879f685693e", + "69fc55e8f3752b2eb13fd5645c223010a26eaa81", [ null, { @@ -372562,8 +372660,17 @@ } ] ], + "same-origin-subresource-redirect-opted-in.https.html": [ + "66c0e57497f62ff2f9734988449998d25f3217c5", + [ + null, + { + "timeout": "long" + } + ] + ], "same-origin-subresource-redirect.https.html": [ - "4a8233bc3e5a8850680775b930dd57ab9ceec3e3", + "8e687b58b1de8ce4e2707a8ccd2dcfae7905cd0d", [ null, { @@ -372736,6 +372843,44 @@ ] ] }, + "permissions": { + "readText-denied.https.html": [ + "7183b1a6eaeb1b34c048ffe68660e5920a4f50a9", + [ + null, + { + "testdriver": true + } + ] + ], + "readText-granted.https.html": [ + "5a2865db0dbf29db2e888e932582b3e62eab91cc", + [ + null, + { + "testdriver": true + } + ] + ], + "writeText-denied.https.html": [ + "19df8a398f60eae32d6446615d831cae9560134c", + [ + null, + { + "testdriver": true + } + ] + ], + "writeText-granted.https.html": [ + "87411fec20c972bfc2e5987030c846ebc68c68c4", + [ + null, + { + "testdriver": true + } + ] + ] + }, "text-write-read": { "async-write-read.https.html": [ "1d170f2fa4a7a4a96c3615d41a3290ab0123fba7", @@ -384062,7 +384207,7 @@ ] ], "math-script-level-004.tentative.html": [ - "a938bd4d01194ad90d2ed76bbf849c6b8ffebb4c", + "b534b6a7712af62d3184c4a71f48b7a56a1e146b", [ null, {} @@ -390403,10 +390548,12 @@ ] ], "idlharness.html": [ - "eb0652e9eeb374ed1d3bb4bf235b0b3cf13fde06", + "514d31f6b39ef066df52c113e68232119cb6927d", [ null, - {} + { + "timeout": "long" + } ] ], "marker-animate.html": [ @@ -392646,7 +392793,7 @@ ] ], "quirks-mode-002.tentative.html": [ - "7c8bcac07ad8fba21ed11f85fd244757dcc0485e", + "c4639ab36f8a4ae0c00ed847179afbce766bba34", [ null, {} @@ -426485,7 +426632,7 @@ }, "gamepad": { "idlharness.window.js": [ - "7943520b5b3be1dc3e18bed82cdd4be7fbf1550a", + "0bbb0b3c701515743c24ca8ca67a96b5c61fa3cc", [ "gamepad/idlharness.window.html", { @@ -426497,8 +426644,13 @@ [ "script", "/resources/idlharness.js" + ], + [ + "timeout", + "long" ] - ] + ], + "timeout": "long" } ] ] @@ -454644,6 +454796,13 @@ {} ] ], + "image-loading-lazy-relevant-mutations.html": [ + "cd4b99dd458c4bb0d4ddceef57b879f5e4ea697d", + [ + null, + {} + ] + ], "image-loading-lazy-srcset.html": [ "21c11c7233c7b8f845a31b6aa25dda14ca381960", [ @@ -456803,7 +456962,7 @@ ] ], "centering.html": [ - "8df2d3052320bbfebc8184b3f426405b398dc632", + "4c97ea078c51da6e960c90d3c957f000bc9d7e37", [ null, {} @@ -468258,24 +468417,30 @@ ] ], "MediaStreamTrack-applyConstraints-getSettings.html": [ - "9d985de66de4a476ddb68802603b212efd7c40b6", + "a1695b1113028a3945f0c8aba8ab9a9cff4b502d", [ null, - {} + { + "testdriver": true + } ] ], "MediaStreamTrack-applyConstraints-reject.html": [ - "21719636ea870f0cfe8e3b8c8a0c838512c1eb87", + "45599c076f0ff6b1ba53e69a423cdf0e5d2ce1bf", [ null, - {} + { + "testdriver": true + } ] ], "MediaStreamTrack-applyConstraints.html": [ - "da3de3ec0f90cbad2563e41c9aa228c1297945e6", + "3c5c05aefa05d878b07f927eea600af75598d497", [ null, - {} + { + "testdriver": true + } ] ], "MediaStreamTrack-getCapabilities-fast.html": [ @@ -468286,10 +468451,12 @@ ] ], "MediaStreamTrack-getCapabilities.html": [ - "e7b196f510a0baee4096f58f0fce7d868a977d88", + "c569283c34ef09541977938825abd1f01f6b386b", [ null, - {} + { + "testdriver": true + } ] ], "MediaStreamTrack-getConstraints-fast.html": [ @@ -468307,10 +468474,12 @@ ] ], "MediaStreamTrack-getSettings.html": [ - "a1a864c2445d844c5d6fd88dd48e1f6839ae9528", + "8fc2c82319517e4b9f60daa2866584505040ad2f", [ null, - {} + { + "testdriver": true + } ] ], "detached-HTMLCanvasElement.html": [ @@ -472697,6 +472866,13 @@ ] }, "origin-isolation": { + "going-back.sub.https.html": [ + "781e3640d3b37f373e81fa0b92e4623ed0c462af", + [ + null, + {} + ] + ], "parent-no-child-yes-same.sub.https.html": [ "4239e1644638b04d330ff70f8a27e97f5af88ab0", [ @@ -472794,6 +472970,13 @@ null, {} ] + ], + "removing-iframes.sub.https.html": [ + "0d2d97815e2a624cacd8d841e6dd35e38f01250d", + [ + null, + {} + ] ] }, "origin-policy": { @@ -473112,10 +473295,12 @@ }, "page-lifecycle": { "idlharness.html": [ - "08b2b054fbad3b41617975a9c2475fe54bc9910d", + "55a7cbc2429c81a182c1373780f4bba457060a50", [ null, - {} + { + "timeout": "long" + } ] ] }, @@ -474970,6 +475155,24 @@ } ] ], + "pointerevent_mouse-pointer-on-scrollbar.html": [ + "43d78e147eca1de430e01db07d2b4c88e886ddda", + [ + null, + { + "testdriver": true + } + ] + ], + "pointerevent_mouse-pointer-updown-events.html": [ + "a5433aab535f075b58844481a44588cb578a6bf0", + [ + null, + { + "testdriver": true + } + ] + ], "pointerevent_touch-action-verification.html": [ "311d24b628e4a7897649205da157683e130dc23a", [ @@ -475174,7 +475377,7 @@ ] ], "pointerevent_lostpointercapture_is_first.html": [ - "6ce0f3e59a04db4ecf23d9fd60b57164ceb67f85", + "c84961b6c5a2350548d98f17eb964ed66ae6e768", [ null, { @@ -475262,7 +475465,7 @@ ] ], "pointerevent_pointerleave_descendant_over.html": [ - "ccc5f37477cc8eabc3effa75d45f2f45d7ea31f5", + "ae348307b4d4372f8cb1da46a17b39cbb8a80cb7", [ null, { @@ -475280,7 +475483,7 @@ ] ], "pointerevent_pointerleave_does_not_bubble.html": [ - "b19820ebd3df673846710887f5c13fdf01b60de7", + "0dc88ee318feef18a04139230b42a50373384b9b", [ null, { @@ -475334,7 +475537,7 @@ ] ], "pointerevent_pointerout_received_once.html": [ - "07df04fc2046737997b70b50063825d292af90de", + "748306e45c8692c1c1c698674863732507fdfcc6", [ null, { @@ -475422,7 +475625,7 @@ ] ], "pointerevent_setpointercapture_disconnected.html": [ - "a7cc3e00e23f1544cdb81762025929a194df0f75", + "386de407e9dd963b30193f3e55a7f7c345764eb0", [ null, { @@ -475440,7 +475643,7 @@ ] ], "pointerevent_setpointercapture_invalid_pointerid.html": [ - "7d9f948919f87a69659262bd8aee7778c79b2f23", + "70b4f41b34954352cab931b8bf0b4da8d972bbcd", [ null, { @@ -475712,7 +475915,7 @@ ] ], "pointerevent_movementxy.html": [ - "260ef4829cba212e77ad487f8e82d69d9e9e8e73", + "eb944460192cfd3a3ef1e11d6ab1f58efbb8983b", [ null, { @@ -476201,17 +476404,21 @@ ] ], "onerror-event.html": [ - "94c8dc772deefc46be48a4545d6c45f8fd17a933", + "fb29956b89a09e19c03792395c2a253e5547cf39", [ null, - {} + { + "timeout": "long" + } ] ], "onload-event.html": [ - "8825ffaaa52025484be848b1a6f73d91da210a47", + "2e1e8d390071821af99fe209679c56d0f04301d5", [ null, - {} + { + "timeout": "long" + } ] ], "preload-csp.sub.html": [ @@ -488055,7 +488262,7 @@ ] ], "current-time.html": [ - "18913bb9b042c6d0e5c52fcf168ba25648dea944", + "ad489d02811b96b2fa8c9d189712fa53c1cada50", [ null, {} @@ -488122,7 +488329,7 @@ ] ], "scroll-timeline-phases.tentative.html": [ - "ec59a12d91a1cb674507b593f537d81ce9653621", + "46fe06a0bddc20e3e18d024a4626a26f29681034", [ null, {} @@ -501569,7 +501776,7 @@ ] ], "trusted-types-svg-script.tentative.html": [ - "330efc0c0ac8cc316019367c298e14fdc0439af6", + "903490e2f3d7f43f017bd843f912b99acba47c8e", [ null, {} @@ -509102,7 +509309,7 @@ ] ], "idlharness.https.window.js": [ - "a1eb3386b73a8425dbd85bf1498bcce783a10857", + "d9ce83e2a1f9dfa47bdbb0421c7e9b8826b91d66", [ "web-nfc/idlharness.https.window.html", { @@ -509114,8 +509321,13 @@ [ "script", "/resources/idlharness.js" + ], + [ + "timeout", + "long" ] - ] + ], + "timeout": "long" } ] ], @@ -512148,7 +512360,7 @@ ] ], "RTCDTMFSender-ontonechange.https.html": [ - "1061698d21bd8febcc62ba795b4d3412d0e5a6d5", + "08dd6ada327497eecb732781bd126d0dfcf54438", [ null, { @@ -512166,7 +512378,7 @@ ] ], "RTCDataChannel-close.html": [ - "b8feea332ad71ff046ceb4b4590ca2becd2919a6", + "ea7795719c21e2aa6cfa48435f8d62b7d8c842c0", [ null, { @@ -512175,7 +512387,7 @@ ] ], "RTCDataChannel-id.html": [ - "355f6a36eae551e8ea92ff91a8a6b65ed10c776c", + "10dc5eacb9ccf2a878d29e8b13eb082271731e65", [ null, {} @@ -512205,14 +512417,14 @@ ] ], "RTCDtlsTransport-getRemoteCertificates.html": [ - "4735b7574123d65df93820132afd9fb6c3afa638", + "8af95a84d574e20f9b0bbff964ed064e4e17e62f", [ null, {} ] ], "RTCDtlsTransport-state.html": [ - "60a14b151e18940a15f91143641f360ef0da346e", + "d0230de0e64d0dcf5b1371cc26f57095053a8fd2", [ null, {} @@ -512233,7 +512445,7 @@ ] ], "RTCIceConnectionState-candidate-pair.https.html": [ - "0752c9aaee65cd4216861e9900c8f863f9d14456", + "3b2c253401f67e2c7e3c679d1d7ae5bac41a2f3d", [ null, { @@ -512298,7 +512510,7 @@ ] ], "RTCPeerConnection-connectionState.https.html": [ - "9e2f3649aec145f3f8787846c0cd3b9ac74a7a81", + "5db8272df307260f9db0c4333c23c7ad4c4432b6", [ null, {} @@ -512319,7 +512531,7 @@ ] ], "RTCPeerConnection-createDataChannel.html": [ - "67b40c9ed8ea44d9559a318619206531c01b32a7", + "dd34561fbc6658d6fb6a146254acd8f36ced210a", [ null, {} @@ -512347,7 +512559,7 @@ ] ], "RTCPeerConnection-getStats.https.html": [ - "f3c51d26a36d7c654420467e6c28e033f0bedc59", + "2ecb21d2f19949fe198e587289430328d5345adf", [ null, {} @@ -512361,7 +512573,7 @@ ] ], "RTCPeerConnection-iceConnectionState-disconnected.https.html": [ - "ff405f32851037e3880b674b4553896d36d92544", + "af55a0c003512f98dc96d11c07e8a5099ed1f5ea", [ null, { @@ -512370,7 +512582,7 @@ ] ], "RTCPeerConnection-iceConnectionState.https.html": [ - "a5bf7536ff5fa8dea448010c73dcbee4ad7532ff", + "851ce884d6ea12bf60761ef23f78cf197d594372", [ null, { @@ -512379,14 +512591,14 @@ ] ], "RTCPeerConnection-iceGatheringState.html": [ - "0940738a86f4baeeeb2ce8a4ce73ee5ef69d1e96", + "3f0128bb843ddbdd129f8a10b601b21c21ce7de4", [ null, {} ] ], "RTCPeerConnection-mandatory-getStats.https.html": [ - "fd8c74b918440b72faaa570753a9a6dc88e85dcc", + "e48d133f464a9a1e9f2b17b3c6eb5f3c375cae34", [ null, { @@ -512395,7 +512607,7 @@ ] ], "RTCPeerConnection-ondatachannel.html": [ - "8ba98414cbb179696523116673d29bc8e436e704", + "46fe8e0f51b1b1a855f06d54c819784d6f542508", [ null, {} @@ -512416,7 +512628,7 @@ ] ], "RTCPeerConnection-onsignalingstatechanged.https.html": [ - "217ea7a1bc845d0a97ee9868e89f4d12cae22a98", + "0c8405770b616d1d0f3be226a815780cc1ad0413", [ null, {} @@ -512469,7 +512681,7 @@ ] ], "RTCPeerConnection-restartIce.https.html": [ - "c069736fa0b37be2bff7174e5ea65aaf91fb5b61", + "8f8c661a41dd0a1cb8f56baf80f6d3b797f9e229", [ null, {} @@ -512588,7 +512800,7 @@ ] ], "RTCPeerConnection-track-stats.https.html": [ - "b56982fda4bc31296b4775bb5187d2a897bf72df", + "83c9f1916cd02a5e91031e4e618319628da52ccc", [ null, { @@ -512678,7 +512890,7 @@ ] ], "RTCRtpReceiver-getStats.https.html": [ - "7cd598393708b501e0b3dbd49d31eda8230dae88", + "20448d8a6c10b20168c4890aad2b37975219b6df", [ null, {} @@ -512701,7 +512913,7 @@ ] ], "RTCRtpSender-getStats.https.html": [ - "1af8285f4c325f38b322d26aa582f3bed7f70585", + "70c633232325bc811db6cc0bca6942b5ffbd7ab2", [ null, {} @@ -512789,7 +513001,7 @@ ] ], "RTCSctpTransport-maxChannels.html": [ - "e62404a21a0834b999a0874afd6345e49342b761", + "b173e11c74a56c151c7838bcbe04030c45259cce", [ null, {} @@ -512919,7 +513131,7 @@ ] ], "candidate-exchange.https.html": [ - "b741de55eccd870e705324d3c75d2c06305e017a", + "532bc4d0d13d72170f9e521cbeda7d2e656e317f", [ null, { @@ -512928,21 +513140,21 @@ ] ], "crypto-suite.https.html": [ - "f4e69e40dfd4717b9ed8f2b90b08fed9040313ae", + "f1b60561a140d2238f0f0a2d79b0759c71d75480", [ null, {} ] ], "dtls-fingerprint-validation.html": [ - "9a397785eec1972a3f6833853f386eeeb61de318", + "0ddc8488ae57213c9b5810633437bca27e4ee9f3", [ null, {} ] ], "ice-state.https.html": [ - "4a6b4333e16a179e6fffadde0a7018eb91895104", + "becce59509b792dd5d63571bff065d93185ca1fa", [ null, { @@ -513002,7 +513214,7 @@ ] ], "video-codecs.https.html": [ - "e728effbeb94de865df9f8860cd45c8de1f601c1", + "a4905ae441a912797788d6d0b065a6c861d708b8", [ null, {} @@ -513130,14 +513342,14 @@ }, "webrtc-insertable-streams": { "RTCEncodedAudioFrame-serviceworker-failure.https.html": [ - "fda89f36dcb52668e28d8c017112f6efb1f169a8", + "79708e706de06cd94bf2c63f6dd4bca543701481", [ null, {} ] ], "RTCEncodedVideoFrame-serviceworker-failure.https.html": [ - "93b9a6a0f36098e3d20762adc9e1d30b61fc7b15", + "54b3a54b364ed8725c256c6d4b4e5856024099b3", [ null, {} @@ -513169,7 +513381,7 @@ ] ], "RTCQuicTransport.https.html": [ - "f9d1411aed368bc8d478a232d825444e0975f121", + "cdccaac6c866c970d5620b8f70943b69412cb861", [ null, {} @@ -513178,7 +513390,7 @@ }, "webrtc-stats": { "getStats-remote-candidate-address.html": [ - "bf580688591dbce35ef852c511d2c6b2dc01ab8b", + "08e2aec90e6836cdcd05b448d2d581eec3bd5535", [ null, {} diff --git a/tests/wpt/metadata/css/CSS2/floats/hit-test-floats-002.html.ini b/tests/wpt/metadata/css/CSS2/floats/hit-test-floats-002.html.ini deleted file mode 100644 index f64b45fea6b..00000000000 --- a/tests/wpt/metadata/css/CSS2/floats/hit-test-floats-002.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[hit-test-floats-002.html] - [Hit test float] - expected: FAIL - diff --git a/tests/wpt/metadata/css/CSS2/floats/hit-test-floats-003.html.ini b/tests/wpt/metadata/css/CSS2/floats/hit-test-floats-003.html.ini new file mode 100644 index 00000000000..f29da48a2a0 --- /dev/null +++ b/tests/wpt/metadata/css/CSS2/floats/hit-test-floats-003.html.ini @@ -0,0 +1,4 @@ +[hit-test-floats-003.html] + [Miss float below something else] + expected: FAIL + diff --git a/tests/wpt/metadata/css/css-transforms/transform-scale-hittest.html.ini b/tests/wpt/metadata/css/css-transforms/transform-scale-hittest.html.ini index 4a1e8110f6f..f8e7e539aae 100644 --- a/tests/wpt/metadata/css/css-transforms/transform-scale-hittest.html.ini +++ b/tests/wpt/metadata/css/css-transforms/transform-scale-hittest.html.ini @@ -2,3 +2,6 @@ [Hit test intersecting scaled box] expected: FAIL + [Hit test within unscaled box] + expected: FAIL + diff --git a/tests/wpt/metadata/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini b/tests/wpt/metadata/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini index 628b1fab770..c884dc82eab 100644 --- a/tests/wpt/metadata/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini +++ b/tests/wpt/metadata/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini @@ -2,3 +2,6 @@ [listeners are called when <iframe> is resized] expected: FAIL + [listeners are called correct number of times] + expected: FAIL + diff --git a/tests/wpt/metadata/css/cssom-view/elementsFromPoint-iframes.html.ini b/tests/wpt/metadata/css/cssom-view/elementsFromPoint-iframes.html.ini index 6ef8bb1049f..171592fc08f 100644 --- a/tests/wpt/metadata/css/cssom-view/elementsFromPoint-iframes.html.ini +++ b/tests/wpt/metadata/css/cssom-view/elementsFromPoint-iframes.html.ini @@ -2,6 +2,3 @@ [elementsFromPoint on the root document for points in iframe elements] expected: FAIL - [elementsFromPoint on inner documents] - expected: FAIL - diff --git a/tests/wpt/metadata/css/cssom-view/elementsFromPoint-invalid-cases.html.ini b/tests/wpt/metadata/css/cssom-view/elementsFromPoint-invalid-cases.html.ini deleted file mode 100644 index e181af5397f..00000000000 --- a/tests/wpt/metadata/css/cssom-view/elementsFromPoint-invalid-cases.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[elementsFromPoint-invalid-cases.html] - [The root element is the last element returned for otherwise empty queries within the viewport] - expected: FAIL - diff --git a/tests/wpt/metadata/fetch/content-type/response.window.js.ini b/tests/wpt/metadata/fetch/content-type/response.window.js.ini index 2bdf0b54a2c..5e82cb3c3ba 100644 --- a/tests/wpt/metadata/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata/fetch/content-type/response.window.js.ini @@ -312,27 +312,21 @@ [fetch(): separate response Content-Type: text/plain ] expected: NOTRUN - [<iframe>: separate response Content-Type: text/plain */*] - expected: FAIL - - [<iframe>: separate response Content-Type: text/html */*] - expected: FAIL - [<iframe>: separate response Content-Type: text/html;" \\" text/plain] expected: FAIL [<iframe>: combined response Content-Type: text/html;x=" text/plain] expected: FAIL - [<iframe>: separate response Content-Type: text/plain */*;charset=gbk] + [<iframe>: separate response Content-Type: text/html */*;charset=gbk] expected: FAIL - [<iframe>: combined response Content-Type: text/html;" text/plain] + [<iframe>: combined response Content-Type: */* text/html] expected: FAIL - [<iframe>: separate response Content-Type: text/html */*;charset=gbk] + [<iframe>: combined response Content-Type: text/html */*] expected: FAIL - [<iframe>: separate response Content-Type: text/plain ] + [<iframe>: combined response Content-Type: text/html */*;charset=gbk] expected: FAIL diff --git a/tests/wpt/metadata/fetch/content-type/script.window.js.ini b/tests/wpt/metadata/fetch/content-type/script.window.js.ini index c7413d589dc..d2df9b78483 100644 --- a/tests/wpt/metadata/fetch/content-type/script.window.js.ini +++ b/tests/wpt/metadata/fetch/content-type/script.window.js.ini @@ -56,9 +56,3 @@ [separate text/javascript x/x] expected: FAIL - [separate text/javascript;charset=windows-1252 error text/javascript] - expected: FAIL - - [separate text/javascript;charset=windows-1252 text/javascript] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini deleted file mode 100644 index 87b07c3e670..00000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[traverse_the_history_1.html] - [Multiple history traversals from the same task] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini index dc2e45516de..75d75b4cda2 100644 --- a/tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini @@ -1,4 +1,4 @@ -[traverse_the_history_5.html] +[traverse_the_history_2.html] [Multiple history traversals, last would be aborted] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini deleted file mode 100644 index dc2e45516de..00000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[traverse_the_history_5.html] - [Multiple history traversals, last would be aborted] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html.ini index c6f45be1eb2..e63fe7c263e 100644 --- a/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html.ini +++ b/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html.ini @@ -1,5 +1,5 @@ [iframe_sandbox_popups_escaping-2.html] - expected: TIMEOUT + expected: CRASH [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] expected: TIMEOUT diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html.ini index 5f60c78e73c..b3bd9f4c289 100644 --- a/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html.ini +++ b/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html.ini @@ -1,6 +1,6 @@ [iframe_sandbox_popups_escaping-3.html] type: testharness - expected: TIMEOUT + expected: CRASH [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] expected: TIMEOUT diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html.ini index 45d8be1c898..d43f38b40cd 100644 --- a/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html.ini +++ b/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html.ini @@ -1,6 +1,6 @@ [iframe_sandbox_popups_nonescaping-2.html] type: testharness - expected: CRASH + expected: TIMEOUT [Check that popups from a sandboxed iframe do not escape the sandbox] expected: NOTRUN diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations.html.ini new file mode 100644 index 00000000000..8414d1376ee --- /dev/null +++ b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations.html.ini @@ -0,0 +1,14 @@ +[image-loading-lazy-relevant-mutations.html] + expected: ERROR + [Image referrerPolicy mutation does not cause deferred loading=lazy images to be fetched] + expected: NOTRUN + + [Image src mutation does not cause deferred loading=lazy images to be fetched] + expected: NOTRUN + + [Images are lazyloaded] + expected: TIMEOUT + + [Image crossOrigin mutation does not cause deferred loading=lazy images to be fetched] + expected: NOTRUN + diff --git a/tests/wpt/metadata/html/semantics/interactive-elements/the-dialog-element/centering.html.ini b/tests/wpt/metadata/html/semantics/interactive-elements/the-dialog-element/centering.html.ini index 4a7e8744086..d0861d00287 100644 --- a/tests/wpt/metadata/html/semantics/interactive-elements/the-dialog-element/centering.html.ini +++ b/tests/wpt/metadata/html/semantics/interactive-elements/the-dialog-element/centering.html.ini @@ -39,3 +39,6 @@ [vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport] expected: FAIL + [vertical-lr: dialog bigger than viewport] + expected: FAIL + diff --git a/tests/wpt/metadata/html/webappapis/scripting/events/compile-event-handler-settings-objects.html.ini b/tests/wpt/metadata/html/webappapis/scripting/events/compile-event-handler-settings-objects.html.ini index 01f7b72cbe7..0cef5158fae 100644 --- a/tests/wpt/metadata/html/webappapis/scripting/events/compile-event-handler-settings-objects.html.ini +++ b/tests/wpt/metadata/html/webappapis/scripting/events/compile-event-handler-settings-objects.html.ini @@ -4,6 +4,3 @@ [The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document] expected: TIMEOUT - [The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini index 66bd350083b..a56bad443a2 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini @@ -1,4 +1,5 @@ [realtimeanalyser-fft-scaling.html] + expected: TIMEOUT [X 2048-point FFT peak position is not equal to 64. Got 0.] expected: FAIL diff --git a/tests/wpt/metadata/workers/shared-worker-in-data-url-context.window.js.ini b/tests/wpt/metadata/workers/shared-worker-in-data-url-context.window.js.ini index 6d92f8835c6..10dda3a6659 100644 --- a/tests/wpt/metadata/workers/shared-worker-in-data-url-context.window.js.ini +++ b/tests/wpt/metadata/workers/shared-worker-in-data-url-context.window.js.ini @@ -1,8 +1,7 @@ [shared-worker-in-data-url-context.window.html] - expected: TIMEOUT [Create a shared worker in a data url frame] - expected: TIMEOUT + expected: FAIL [Create a data url shared worker in a data url frame] - expected: NOTRUN + expected: FAIL diff --git a/tests/wpt/web-platform-tests/.azure-pipelines.yml b/tests/wpt/web-platform-tests/.azure-pipelines.yml index 264e5d076d1..9b8676ef43f 100644 --- a/tests/wpt/web-platform-tests/.azure-pipelines.yml +++ b/tests/wpt/web-platform-tests/.azure-pipelines.yml @@ -609,8 +609,8 @@ jobs: channel: stable - template: tools/ci/azure/update_hosts.yml - template: tools/ci/azure/update_manifest.yml - # --exclude is a workaround for https://github.com/web-platform-tests/wpt/issues/18634 + https://github.com/web-platform-tests/wpt/issues/22175 - - script: no_proxy='*' ./wpt run --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --this-chunk=$(System.JobPositionInPhase) --total-chunks=$(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-mach - --log-mach-level info safari --exclude /inert/inert-retargeting.tentative.html --exclude /inert/inert-retargeting-iframe.tentative.html --exclude /pointerevents/pointerevent_pointercapture-not-lost-in-chorded-buttons.html --exclude /pointerevents/pointerevent_pointercapture_in_frame.html --exclude /web-share/share-sharePromise-internal-slot.https.html + # --exclude is a workaround for https://github.com/web-platform-tests/wpt/issues/18995 + https://github.com/web-platform-tests/wpt/issues/20887 + https://github.com/web-platform-tests/wpt/issues/22175 + https://github.com/web-platform-tests/wpt/issues/23630 + - script: no_proxy='*' ./wpt run --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --this-chunk=$(System.JobPositionInPhase) --total-chunks=$(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-mach - --log-mach-level info safari --exclude /pointerevents/pointerevent_pointercapture-not-lost-in-chorded-buttons.html --exclude /pointerevents/pointerevent_pointercapture_in_frame.html --exclude /web-share/share-sharePromise-internal-slot.https.html --exclude /webdriver/tests/perform_actions/pointer_tripleclick.py displayName: 'Run tests' - task: PublishBuildArtifacts@1 displayName: 'Publish results' @@ -644,8 +644,8 @@ jobs: - template: tools/ci/azure/install_safari.yml - template: tools/ci/azure/update_hosts.yml - template: tools/ci/azure/update_manifest.yml - # --exclude is a workaround for https://github.com/web-platform-tests/wpt/issues/18995 + https://github.com/web-platform-tests/wpt/issues/20887 - - script: no_proxy='*' ./wpt run --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --this-chunk=$(System.JobPositionInPhase) --total-chunks=$(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-mach - --log-mach-level info --channel preview safari --exclude /pointerevents/pointerevent_pointercapture_in_frame.html --exclude /web-share/share-sharePromise-internal-slot.https.html + # --exclude is a workaround for https://github.com/web-platform-tests/wpt/issues/18995 + https://github.com/web-platform-tests/wpt/issues/20887 + https://github.com/web-platform-tests/wpt/issues/23630 + - script: no_proxy='*' ./wpt run --no-manifest-update --no-restart-on-unexpected --no-fail-on-unexpected --this-chunk=$(System.JobPositionInPhase) --total-chunks=$(System.TotalJobsInPhase) --chunk-type hash --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report_$(System.JobPositionInPhase).json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot_$(System.JobPositionInPhase).txt --log-mach - --log-mach-level info --channel preview safari --exclude /pointerevents/pointerevent_pointercapture_in_frame.html --exclude /web-share/share-sharePromise-internal-slot.https.html --exclude /webdriver/tests/perform_actions/pointer_tripleclick.py displayName: 'Run tests' - task: PublishBuildArtifacts@1 displayName: 'Publish results' diff --git a/tests/wpt/web-platform-tests/BackgroundSync/idlharness.https.any.js b/tests/wpt/web-platform-tests/BackgroundSync/idlharness.https.any.js index 8d4b9a583f4..120477a51e6 100644 --- a/tests/wpt/web-platform-tests/BackgroundSync/idlharness.https.any.js +++ b/tests/wpt/web-platform-tests/BackgroundSync/idlharness.https.any.js @@ -1,5 +1,6 @@ // META: script=/resources/WebIDLParser.js // META: script=/resources/idlharness.js +// META: timeout=long 'use strict'; diff --git a/tests/wpt/web-platform-tests/ambient-light/AmbientLightSensor.https.html b/tests/wpt/web-platform-tests/ambient-light/AmbientLightSensor.https.html index 2383a2de218..7d23896a648 100644 --- a/tests/wpt/web-platform-tests/ambient-light/AmbientLightSensor.https.html +++ b/tests/wpt/web-platform-tests/ambient-light/AmbientLightSensor.https.html @@ -1,6 +1,7 @@ <!DOCTYPE html> <meta charset="utf-8"> <title>AmbientLightSensor Test</title> +<meta name="timeout" content="long"> <link rel="author" title="Intel" href="http://www.intel.com"> <link rel="help" href="https://www.w3.org/TR/ambient-light/"> <script src="/resources/testharness.js"></script> diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-iframe-redirect-with-fp-delegation.https.html b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-iframe-redirect-with-fp-delegation.https.html new file mode 100644 index 00000000000..a2bc66fca1e --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-iframe-redirect-with-fp-delegation.https.html @@ -0,0 +1,18 @@ +<!doctype html> +<meta name="timeout" content="long"> +<title>Accept-CH Persistence test</title> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="resources/accept-ch-test.js"></script> + +<script> +// Make sure that cross origin iframes that gets redirected, and has Feature Policy delegation maintain their Client Hints. +const test_name = "Iframe redirect with Feature Policy delegation"; +verify_iframe_state("resources/accept-ch-and-redir.py?url=" + get_host_info()["HTTPS_REMOTE_ORIGIN"] + "/client-hints/accept-ch-stickiness/resources/expect-received.py", test_name); + +</script> +</body> +</html> + diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-iframe-redirect-with-fp-delegation.https.html.headers b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-iframe-redirect-with-fp-delegation.https.html.headers new file mode 100644 index 00000000000..b2bc98de5d7 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-iframe-redirect-with-fp-delegation.https.html.headers @@ -0,0 +1,2 @@ +Accept-CH: DPR, Device-Memory +Feature-Policy: ch-dpr *; ch-device-memory * diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-navigation-redirect.https.html b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-navigation-redirect.https.html new file mode 100644 index 00000000000..14ba51ab5d0 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-navigation-redirect.https.html @@ -0,0 +1,18 @@ +<!doctype html> +<meta name="timeout" content="long"> +<title>Accept-CH Persistence test</title> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="resources/accept-ch-test.js"></script> + +<script> +// Make sure a cross origin navigation that gets redirected doesn't keep the initial request's Client Hints. +const test_name = "cross-origin redirect on navigation"; +verify_navigation_state("resources/accept-ch-and-redir.py?url=" + get_host_info()["HTTPS_REMOTE_ORIGIN"] + "/client-hints/accept-ch-stickiness/resources/do-not-expect-received.py", test_name); + +</script> +</body> +</html> + diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-navigation-redirect.https.html.headers b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-navigation-redirect.https.html.headers new file mode 100644 index 00000000000..e157e45b798 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-navigation-redirect.https.html.headers @@ -0,0 +1 @@ +Accept-CH: DPR, Device-Memory diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect-with-fp-delegation.https.html b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect-with-fp-delegation.https.html new file mode 100644 index 00000000000..dd7b9fab971 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect-with-fp-delegation.https.html @@ -0,0 +1,17 @@ +<!doctype html> +<meta name="timeout" content="long"> +<title>Accept-CH Persistence test</title> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="resources/accept-ch-test.js"></script> + +<script> +// Make sure a cross origin subresource that gets redirected with Feature Policy delegation keeps the initial request's Client Hints. +const test_name = "cross-origin subresource redirect with Feature Policy delegation"; +verify_subresource_state("resources/accept-ch-and-redir.py?url=" + get_host_info()["HTTPS_REMOTE_ORIGIN"] + "/client-hints/accept-ch-stickiness/resources/expect-received.py", test_name); +</script> +</body> +</html> + diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect-with-fp-delegation.https.html.headers b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect-with-fp-delegation.https.html.headers new file mode 100644 index 00000000000..5515b8a591f --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect-with-fp-delegation.https.html.headers @@ -0,0 +1,2 @@ +Accept-CH: DPR, Device-Memory +Feature-Policy: ch-dpr *;ch-device-memory * diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect.https.html b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect.https.html new file mode 100644 index 00000000000..31334543cf2 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect.https.html @@ -0,0 +1,17 @@ +<!doctype html> +<meta name="timeout" content="long"> +<title>Accept-CH Persistence test</title> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="resources/accept-ch-test.js"></script> + +<script> +// Make sure a cross origin subresource that gets redirected doesn't keep the initial request's Client Hints. +const test_name = "cross-origin subresource redirect"; +verify_subresource_state("resources/accept-ch-and-redir.py?url=" + get_host_info()["HTTPS_REMOTE_ORIGIN"] + "/client-hints/accept-ch-stickiness/resources/do-not-expect-received.py", test_name); +</script> +</body> +</html> + diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect.https.html.headers b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect.https.html.headers new file mode 100644 index 00000000000..e157e45b798 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-subresource-redirect.https.html.headers @@ -0,0 +1 @@ +Accept-CH: DPR, Device-Memory diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-syncxhr-redirect.https.html b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-syncxhr-redirect.https.html new file mode 100644 index 00000000000..1cce664d2c5 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-syncxhr-redirect.https.html @@ -0,0 +1,17 @@ +<!doctype html> +<meta name="timeout" content="long"> +<title>Accept-CH Persistence test</title> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="resources/accept-ch-test.js"></script> + +<script> +// Make sure a cross origin syn XHR that gets redirected doesn't keep the initial request's Client Hints. +const test_name = "cross-origin sync XHR redirect"; +verify_syncxhr_state("resources/accept-ch-and-redir.py?url=" + get_host_info()["HTTPS_REMOTE_ORIGIN"] + "/client-hints/accept-ch-stickiness/resources/do-not-expect-received.py", test_name); +</script> +</body> +</html> + diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-syncxhr-redirect.https.html.headers b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-syncxhr-redirect.https.html.headers new file mode 100644 index 00000000000..e157e45b798 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/cross-origin-syncxhr-redirect.https.html.headers @@ -0,0 +1 @@ +Accept-CH: DPR, Device-Memory diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-and-redir-to-do-not-expect.py b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-and-redir-to-do-not-expect.py deleted file mode 100644 index eaca03fe76d..00000000000 --- a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-and-redir-to-do-not-expect.py +++ /dev/null @@ -1,2 +0,0 @@ -def main(request, response): - return 301, [('Location', 'do-not-expect-received.py'),('Accept-CH', 'device-memory, DPR')], '' diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-and-redir-to-expect.py b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-and-redir-to-expect.py deleted file mode 100644 index 835ef396b8b..00000000000 --- a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-and-redir-to-expect.py +++ /dev/null @@ -1,2 +0,0 @@ -def main(request, response): - return 301, [('Location', 'expect-received.py'),('Accept-CH', 'device-memory, DPR')], '' diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-and-redir.py b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-and-redir.py new file mode 100644 index 00000000000..706983c9a06 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-and-redir.py @@ -0,0 +1,5 @@ +def main(request, response): + url = '' + if 'url' in request.GET: + url = request.GET['url'] + return 301, [('Location', url),('Accept-CH', 'device-memory, DPR')], '' diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-test.js b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-test.js index 879745706c0..a0884369901 100644 --- a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-test.js +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/accept-ch-test.js @@ -21,6 +21,20 @@ function verify_initial_state(initial_url, test_name) { "hints preferences cached"); } +function verify_iframe_state(expect_url, test_name) { + promise_test(t => { + return new Promise(resolve => { + window.addEventListener('message', t.step_func(function(e) { + assert_equals(e.data, "PASS", "message from opened frame"); + fetch("/client-hints/accept-ch-stickiness/resources/clear-site-data.html").then(resolve); + })); + const iframe = document.createElement("iframe"); + iframe.src = expect_url; + document.body.appendChild(iframe); + }); + }, test_name + " got client hints according to expectations."); +} + function verify_navigation_state(expect_url, test_name) { promise_test(t => { return new Promise(resolve => { @@ -40,14 +54,27 @@ function verify_navigation_state(expect_url, test_name) { function verify_subresource_state(expect_url, test_name) { promise_test(t => { return new Promise(resolve => { - let win; - window.addEventListener('message', t.step_func(function(e) { - win.close(); - assert_equals(e.data, "PASS", "message from opened page"); + fetch(expect_url).then(response => response.text()).then(t.step_func(text => { + assert_true(text.includes("PASS")); fetch("/client-hints/accept-ch-stickiness/resources/clear-site-data.html").then(resolve); })); - // Open expect_url as a subresource. - fetch(expect_url).then(resolve); + }); + }, test_name + " got client hints according to expectations."); +} + +function verify_syncxhr_state(expect_url, test_name) { + promise_test(t => { + return new Promise(resolve => { + const xhr = new XMLHttpRequest(); + xhr.onreadystatechange = t.step_func(() => { + if (xhr.readyState != XMLHttpRequest.DONE) { + return; + } + assert_true(xhr.responseText.includes("PASS")); + fetch("/client-hints/accept-ch-stickiness/resources/clear-site-data.html").then(resolve); + }); + xhr.open("GET", expect_url, false /* async */); + xhr.send(); }); }, test_name + " got client hints according to expectations."); } diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/do-not-expect-received.py b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/do-not-expect-received.py index 6b0e61af9db..ba647ede53b 100644 --- a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/do-not-expect-received.py +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/do-not-expect-received.py @@ -15,5 +15,5 @@ def main(request, response): window.opener.postMessage("%s" , "*"); </script> ''' % (result) - headers = [("Content-Type", "text/html")] + headers = [("Content-Type", "text/html"), ("Access-Control-Allow-Origin", "*")] return 200, headers, content diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/expect-received.py b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/expect-received.py index 5aab578ae34..bec3bffc282 100644 --- a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/expect-received.py +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/resources/expect-received.py @@ -5,15 +5,16 @@ def main(request, response): verify_navigation_state() in accept-ch-test.js """ - if "device-memory" in request.headers: + if "device-memory" in request.headers and "sec-ch-ua" in request.headers and "sec-ch-ua-mobile" in request.headers: result = "PASS" else: result = "FAIL" content = ''' <script> - window.opener.postMessage("%s" , "*"); + let messagee = window.opener || window.parent; + messagee.postMessage("%s" , "*"); </script> ''' % (result) - headers = [("Content-Type", "text/html")] + headers = [("Content-Type", "text/html"), ("Access-Control-Allow-Origin", "*")] return 200, headers, content diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-navigation-redirect.https.html b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-navigation-redirect.https.html index 2ab128f2d82..69fc55e8f37 100644 --- a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-navigation-redirect.https.html +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-navigation-redirect.https.html @@ -12,7 +12,7 @@ // header here are a single step, connected via redirect. const test_name = "redirect on navigation"; verify_initial_state(echo, test_name); -verify_navigation_state("resources/accept-ch-and-redir-to-expect.py", test_name); +verify_navigation_state("resources/accept-ch-and-redir.py?url=expect-received.py", test_name); </script> </body> </html> diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect-opted-in.https.html b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect-opted-in.https.html new file mode 100644 index 00000000000..66c0e57497f --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect-opted-in.https.html @@ -0,0 +1,17 @@ +<!doctype html> +<meta name="timeout" content="long"> +<title>Accept-CH Persistence test</title> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="resources/accept-ch-test.js"></script> + +<script> +// Make sure a same origin subresource that gets redirected keeps the initial request's Client Hints. +const test_name = "same-origin subresource redirect with opt-in"; +verify_subresource_state("resources/accept-ch-and-redir.py?url=expect-received.py", test_name); +</script> +</body> +</html> + diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect-opted-in.https.html.headers b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect-opted-in.https.html.headers new file mode 100644 index 00000000000..e157e45b798 --- /dev/null +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect-opted-in.https.html.headers @@ -0,0 +1 @@ +Accept-CH: DPR, Device-Memory diff --git a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect.https.html b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect.https.html index 4a8233bc3e5..8e687b58b1d 100644 --- a/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect.https.html +++ b/tests/wpt/web-platform-tests/client-hints/accept-ch-stickiness/same-origin-subresource-redirect.https.html @@ -8,11 +8,10 @@ <script src="resources/accept-ch-test.js"></script> <script> -// This is similar to accept-ch-test.js tests, except setting and checking -// header here are a single step, connected via redirect. -const test_name = "redirect on navigation"; +// Make sure a same origin subresource without an opt-in that gets redirected doesn't contain Client Hints. +const test_name = "same-origin subresource redirect with no opt-in"; verify_initial_state(echo, test_name); -verify_subresource_state("resources/accept-ch-and-redir-to-do-not-expect.py", test_name); +verify_subresource_state("resources/accept-ch-and-redir.py?url=do-not-expect-received.py", test_name); </script> </body> </html> diff --git a/tests/wpt/web-platform-tests/clipboard-apis/permissions/readText-denied.https.html b/tests/wpt/web-platform-tests/clipboard-apis/permissions/readText-denied.https.html new file mode 100644 index 00000000000..7183b1a6eae --- /dev/null +++ b/tests/wpt/web-platform-tests/clipboard-apis/permissions/readText-denied.https.html @@ -0,0 +1,17 @@ +<!doctype html> +<meta charset="utf-8"> +<title>navigator.clipboard.readText() fails when permission denied</title> +<link rel="help" href="https://w3c.github.io/clipboard-apis/#async-clipboard-api"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script> +'use strict'; + +promise_test(async t => { + test_driver.set_permission({name: 'clipboard-read'}, 'denied'); + await promise_rejects_dom(t, + 'NotAllowedError', navigator.clipboard.readText()); +}, 'navigator.clipboard.readText() fails when permission denied'); +</script> diff --git a/tests/wpt/web-platform-tests/clipboard-apis/permissions/readText-granted.https.html b/tests/wpt/web-platform-tests/clipboard-apis/permissions/readText-granted.https.html new file mode 100644 index 00000000000..5a2865db0db --- /dev/null +++ b/tests/wpt/web-platform-tests/clipboard-apis/permissions/readText-granted.https.html @@ -0,0 +1,16 @@ +<!doctype html> +<meta charset="utf-8"> +<title>navigator.clipboard.readText() succeeds when permission granted</title> +<link rel="help" href="https://w3c.github.io/clipboard-apis/#async-clipboard-api"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script> +'use strict'; + +promise_test(async () => { + test_driver.set_permission({name: 'clipboard-read'}, 'granted'); + await navigator.clipboard.readText(); +}, 'navigator.clipboard.readText() succeeds when permission granted'); +</script>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/clipboard-apis/permissions/writeText-denied.https.html b/tests/wpt/web-platform-tests/clipboard-apis/permissions/writeText-denied.https.html new file mode 100644 index 00000000000..19df8a398f6 --- /dev/null +++ b/tests/wpt/web-platform-tests/clipboard-apis/permissions/writeText-denied.https.html @@ -0,0 +1,17 @@ +<!doctype html> +<meta charset="utf-8"> +<title>navigator.clipboard.writeText() fails when permission denied</title> +<link rel="help" href="https://w3c.github.io/clipboard-apis/#async-clipboard-api"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script> +'use strict'; + +promise_test(async t => { + test_driver.set_permission({name: 'clipboard-write'}, 'denied'); + await promise_rejects_dom(t, 'NotAllowedError', + navigator.clipboard.writeText('xyz')); +}, 'navigator.clipboard.writeText() fails when permission denied'); +</script> diff --git a/tests/wpt/web-platform-tests/clipboard-apis/permissions/writeText-granted.https.html b/tests/wpt/web-platform-tests/clipboard-apis/permissions/writeText-granted.https.html new file mode 100644 index 00000000000..87411fec20c --- /dev/null +++ b/tests/wpt/web-platform-tests/clipboard-apis/permissions/writeText-granted.https.html @@ -0,0 +1,16 @@ +<!doctype html> +<meta charset="utf-8"> +<title>navigator.clipboard.writeText() succeeds when permission granted</title> +<link rel="help" href="https://w3c.github.io/clipboard-apis/#async-clipboard-api"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script> +'use strict'; + +promise_test(async () => { + test_driver.set_permission({name: 'clipboard-write'}, 'granted'); + await navigator.clipboard.writeText('xyz'); +}, 'navigator.clipboard.writeText() succeeds when permission granted'); +</script>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html b/tests/wpt/web-platform-tests/css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html index a938bd4d011..b534b6a7712 100644 --- a/tests/wpt/web-platform-tests/css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html +++ b/tests/wpt/web-platform-tests/css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html @@ -49,10 +49,6 @@ const big = 3000; const small = 150; setup({ explicit_done: true }); - window.addEventListener("load", function() { - // Delay the check to workaround WebKit's bug https://webkit.org/b/174030. - requestAnimationFrame(() => { document.fonts.ready.then(runTests); }); - }); function fontSize(element) { return parseFloat((/(.+)px/).exec(getComputedStyle(element). getPropertyValue("font-size"))[1]); @@ -66,96 +62,97 @@ } } } - function runTests() { - - test(function() { - CheckFontSizes("scale80-40-scaledown", { - "-3": big, - "-1": big * .71 * .71, - "0": big * .71 * .71 * .71, - "1": big * .71 * .71 * .71 * .8, - "2": big * .71 * .71 * .71 * .4, - "3": big * .71 * .71 * .71 * .4 * .71, - "5": big * .71 * .71 * .71 * .4 * .71 * .71 * .71 - }); - CheckFontSizes("scale80-40-scaleup", { - "5": small, - "3": small / (.71 * .71), - "2": small / (.71 * .71 * .71), - "1": small / (.71 * .71 * .71 * (.4 / .8)), - "0": small / (.71 * .71 * .71 * .4), - "-1": small / (.71 * .71 * .71 * .4 * .71), - "-3": small / (.71 * .71 * .71 * .4 * .71 * .71 * .71) - }); - }, "scriptPercentScaleDown=80, scriptScriptPercentScaleDown=40"); + window.addEventListener("load", function() { + document.fonts.ready.then(function() { + test(function() { + CheckFontSizes("scale80-40-scaledown", { + "-3": big, + "-1": big * .71 * .71, + "0": big * .71 * .71 * .71, + "1": big * .71 * .71 * .71 * .8, + "2": big * .71 * .71 * .71 * .4, + "3": big * .71 * .71 * .71 * .4 * .71, + "5": big * .71 * .71 * .71 * .4 * .71 * .71 * .71 + }); + CheckFontSizes("scale80-40-scaleup", { + "5": small, + "3": small / (.71 * .71), + "2": small / (.71 * .71 * .71), + "1": small / (.71 * .71 * .71 * (.4 / .8)), + "0": small / (.71 * .71 * .71 * .4), + "-1": small / (.71 * .71 * .71 * .4 * .71), + "-3": small / (.71 * .71 * .71 * .4 * .71 * .71 * .71) + }); + }, "scriptPercentScaleDown=80, scriptScriptPercentScaleDown=40"); - test(function() { - var scriptPercentScaleDown = .71; - CheckFontSizes("scale0-40-scaledown", { - "-3": big, - "-1": big * .71 * .71, - "0": big * .71 * .71 * .71, - "1": big * .71 * .71 * .71 * scriptPercentScaleDown, - "2": big * .71 * .71 * .71 * .4, - "3": big * .71 * .71 * .71 * .4 * .71, - "5": big * .71 * .71 * .71 * .4 * .71 * .71 * .71 - }); - CheckFontSizes("scale0-40-scaleup", { - "5": small, - "3": small / (.71 * .71), - "2": small / (.71 * .71 * .71), - "1": small / (.71 * .71 * .71 * (.4 / scriptPercentScaleDown)), - "0": small / (.71 * .71 * .71 * .4), - "-1": small / (.71 * .71 * .71 * .4 * .71), - "-3": small / (.71 * .71 * .71 * .4 * .71 * .71 * .71) - }); - }, "scriptPercentScaleDown=0, scriptScriptPercentScaleDown=40"); + test(function() { + var scriptPercentScaleDown = .71; + CheckFontSizes("scale0-40-scaledown", { + "-3": big, + "-1": big * .71 * .71, + "0": big * .71 * .71 * .71, + "1": big * .71 * .71 * .71 * scriptPercentScaleDown, + "2": big * .71 * .71 * .71 * .4, + "3": big * .71 * .71 * .71 * .4 * .71, + "5": big * .71 * .71 * .71 * .4 * .71 * .71 * .71 + }); + CheckFontSizes("scale0-40-scaleup", { + "5": small, + "3": small / (.71 * .71), + "2": small / (.71 * .71 * .71), + "1": small / (.71 * .71 * .71 * (.4 / scriptPercentScaleDown)), + "0": small / (.71 * .71 * .71 * .4), + "-1": small / (.71 * .71 * .71 * .4 * .71), + "-3": small / (.71 * .71 * .71 * .4 * .71 * .71 * .71) + }); + }, "scriptPercentScaleDown=0, scriptScriptPercentScaleDown=40"); - test(function() { - var scriptScriptPercentScaleDown = 0.5041; - CheckFontSizes("scale80-0-scaledown", { - "-3": big, - "-1": big * .71 * .71, - "0": big * .71 * .71 * .71, - "1": big * .71 * .71 * .71 * .8, - "2": big * .71 * .71 * .71 * scriptScriptPercentScaleDown, - "3": big * .71 * .71 * .71 * scriptScriptPercentScaleDown * .71, - "5": big * .71 * .71 * .71 * scriptScriptPercentScaleDown * .71 * .71 * .71 - }); - CheckFontSizes("scale80-0-scaleup", { - "5": small, - "3": small / (.71 * .71), - "2": small / (.71 * .71 * .71), - "1": small / (.71 * .71 * .71 * (scriptScriptPercentScaleDown / .8)), - "0": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown), - "-1": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown * .71), - "-3": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown * .71 * .71 * .71) - }); - }, "scriptPercentScaleDown=80, scriptScriptPercentScaleDown=0"); + test(function() { + var scriptScriptPercentScaleDown = 0.5041; + CheckFontSizes("scale80-0-scaledown", { + "-3": big, + "-1": big * .71 * .71, + "0": big * .71 * .71 * .71, + "1": big * .71 * .71 * .71 * .8, + "2": big * .71 * .71 * .71 * scriptScriptPercentScaleDown, + "3": big * .71 * .71 * .71 * scriptScriptPercentScaleDown * .71, + "5": big * .71 * .71 * .71 * scriptScriptPercentScaleDown * .71 * .71 * .71 + }); + CheckFontSizes("scale80-0-scaleup", { + "5": small, + "3": small / (.71 * .71), + "2": small / (.71 * .71 * .71), + "1": small / (.71 * .71 * .71 * (scriptScriptPercentScaleDown / .8)), + "0": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown), + "-1": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown * .71), + "-3": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown * .71 * .71 * .71) + }); + }, "scriptPercentScaleDown=80, scriptScriptPercentScaleDown=0"); - test(function() { - CheckFontSizes("default-scaledown", { - "-3": big, - "-1": big * .71 * .71, - "0": big * .71 * .71 * .71, - "1": big * .71 * .71 * .71 * .71, - "2": big * .71 * .71 * .71 * .71 * .71, - "3": big * .71 * .71 * .71 * .71 * .71 * .71, - "5": big * .71 * .71 * .71 * .71 * .71 * .71 * .71 * .71 - }); - CheckFontSizes("default-scaleup", { - "5": small, - "3": small / (.71 * .71), - "2": small / (.71 * .71 * .71), - "1": small / (.71 * .71 * .71 * .71), - "0": small / (.71 * .71 * .71 * .71 * .71), - "-1": small / (.71 * .71 * .71 * .71 * .71 * .71), - "-3": small / (.71 * .71 * .71 * .71 * .71 * .71 * .71 * .71) - }); - }, "No MATH table"); + test(function() { + CheckFontSizes("default-scaledown", { + "-3": big, + "-1": big * .71 * .71, + "0": big * .71 * .71 * .71, + "1": big * .71 * .71 * .71 * .71, + "2": big * .71 * .71 * .71 * .71 * .71, + "3": big * .71 * .71 * .71 * .71 * .71 * .71, + "5": big * .71 * .71 * .71 * .71 * .71 * .71 * .71 * .71 + }); + CheckFontSizes("default-scaleup", { + "5": small, + "3": small / (.71 * .71), + "2": small / (.71 * .71 * .71), + "1": small / (.71 * .71 * .71 * .71), + "0": small / (.71 * .71 * .71 * .71 * .71), + "-1": small / (.71 * .71 * .71 * .71 * .71 * .71), + "-3": small / (.71 * .71 * .71 * .71 * .71 * .71 * .71 * .71) + }); + }, "No MATH table"); - done(); - } + done(); + }); + }); </script> </head> <body> diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/idlharness.html b/tests/wpt/web-platform-tests/css/css-pseudo/idlharness.html index eb0652e9eeb..514d31f6b39 100644 --- a/tests/wpt/web-platform-tests/css/css-pseudo/idlharness.html +++ b/tests/wpt/web-platform-tests/css/css-pseudo/idlharness.html @@ -1,5 +1,6 @@ <!doctype html> <title>CSS Pseudo Element API IDL tests</title> +<meta name="timeout" content="long"> <link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#cssom"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> diff --git a/tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-008.tentative.html b/tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-008.tentative.html index 8575d96c769..1e508149d90 100644 --- a/tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-008.tentative.html +++ b/tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-008.tentative.html @@ -2,10 +2,12 @@ <title>CSS aspect-ratio: div block size</title> <link rel="author" title="Google LLC" href="https://www.google.com/"> <link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio"> +<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5060"> <link rel="match" href="../../reference/ref-filled-green-100px-square.xht" /> -<meta name="assert" content="Aspect ratio should only be used if a width was specified."> +<meta name="assert" content="Aspect ratio should be used even if width and height are auto."> <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> -<div style="background: red; aspect-ratio: 1/1;"></div> -<div style="background: green; width: 100px; height: 100px;"></div> +<div style="width: 100px;"> + <div style="background: green; aspect-ratio: 1/1;"></div> +</div> diff --git a/tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/quirks-mode-002.tentative.html b/tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/quirks-mode-002.tentative.html index 7c8bcac07ad..c4639ab36f8 100644 --- a/tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/quirks-mode-002.tentative.html +++ b/tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/quirks-mode-002.tentative.html @@ -8,8 +8,8 @@ <script> onload = function() { test(function() { - assert_not_equals(document.body.offsetHeight, document.body.offsetWidth); - }, "body height is different from width"); + assert_equals(document.body.offsetHeight, document.body.offsetWidth); + }, "body height equals width"); }; </script> <body style="aspect-ratio: 1/1;"> diff --git a/tests/wpt/web-platform-tests/docs/running-tests/safari.md b/tests/wpt/web-platform-tests/docs/running-tests/safari.md index fb8b7be2e52..0ff8fe5d95e 100644 --- a/tests/wpt/web-platform-tests/docs/running-tests/safari.md +++ b/tests/wpt/web-platform-tests/docs/running-tests/safari.md @@ -31,3 +31,14 @@ To run Safari Technology Preview instead, use the `--channel=preview` argument: ``` ./wpt run --channel=preview safari [test_list] ``` + +## Debugging + +To debug problems with `safaridriver`, add the `--webdriver-arg=--diagnose` +argument: +``` +./wpt run --channel=preview --webdriver-arg=--diagnose safari [test_list] +``` + +The logs will be in `~/Library/Logs/com.apple.WebDriver/`. +See `man safaridriver` for more information. diff --git a/tests/wpt/web-platform-tests/event-timing/resources/event-timing-test-utils.js b/tests/wpt/web-platform-tests/event-timing/resources/event-timing-test-utils.js index e2a69b5c5b4..6045a054e7c 100644 --- a/tests/wpt/web-platform-tests/event-timing/resources/event-timing-test-utils.js +++ b/tests/wpt/web-platform-tests/event-timing/resources/event-timing-test-utils.js @@ -28,8 +28,8 @@ function verifyEvent(entry, eventType, targetId, isFirst=false, minDuration=104, assert_equals(entry.entryType, 'event'); assert_greater_than_equal(entry.duration, minDuration, "The entry's duration should be greater than or equal to " + minDuration + " ms."); - assert_greater_than(entry.processingStart, entry.startTime, - "The entry's processingStart should be greater than startTime."); + assert_greater_than_equal(entry.processingStart, entry.startTime, + "The entry's processingStart should be greater than or equal to startTime."); assert_greater_than_equal(entry.processingEnd, entry.processingStart, "The entry's processingEnd must be at least as large as processingStart."); // |duration| is a number rounded to the nearest 8 ms, so add 4 to get a lower bound @@ -122,9 +122,9 @@ async function testDuration(t, id, numEntries, dur, fastDur, slowDur) { return Promise.all([observerPromise, clicksPromise]); } -// Apply events that trigger an event of the given |eventType| to be dispatched to the |target|. Some -// of these assume that the target is not on the top left corner of the screen, which means that -// (0, 0) of the viewport is outside of the |target|. +// Apply events that trigger an event of the given |eventType| to be dispatched to the +// |target|. Some of these assume that the target is not on the top left corner of the +// screen, which means that (0, 0) of the viewport is outside of the |target|. function applyAction(eventType, target) { const actions = new test_driver.Actions(); if (eventType === 'auxclick') { @@ -167,16 +167,25 @@ function applyAction(eventType, target) { } function requiresListener(eventType) { - return ['mouseenter', 'mouseleave', 'pointerdown', 'pointerenter', 'pointerleave', 'pointerout', 'pointerover', 'pointerup'].includes(eventType); + return ['mouseenter', + 'mouseleave', + 'pointerdown', + 'pointerenter', + 'pointerleave', + 'pointerout', + 'pointerover', + 'pointerup' + ].includes(eventType); } function notCancelable(eventType) { return ['mouseenter', 'mouseleave', 'pointerenter', 'pointerleave'].includes(eventType); } -// Tests the given |eventType| by creating events whose target are the element with id 'target'. -// The test assumes that such element already exists. |looseCount| is set for events for which -// events would occur for other elements besides the target, so the counts will be larger. +// Tests the given |eventType| by creating events whose target are the element with id +// 'target'. The test assumes that such element already exists. |looseCount| is set for +// eventTypes for which events would occur for other elements besides the target, so the +// counts will be larger. async function testEventType(t, eventType, looseCount=false) { assert_implements(window.EventCounts, "Event Counts isn't supported"); assert_equals(performance.eventCounts.get(eventType), 0); @@ -192,7 +201,8 @@ async function testEventType(t, eventType, looseCount=false) { assert_greater_than_equal(performance.eventCounts.get(eventType), 2, `Should have at least 2 ${eventType} events`) } else { - assert_equals(performance.eventCounts.get(eventType), 2, `Should have 2 ${eventType} events`); + assert_equals(performance.eventCounts.get(eventType), 2, + `Should have 2 ${eventType} events`); } // The durationThreshold used by the observer. A slow events needs to be slower than that. const durationThreshold = 16; @@ -211,7 +221,8 @@ async function testEventType(t, eventType, looseCount=false) { entry = eventTypeEntries[0]; assert_equals(eventTypeEntries.length, 1); } else { - // The other events could also be considered slow. Find the one with the correct target. + // The other events could also be considered slow. Find the one with the correct + // target. eventTypeEntries.forEach(e => { if (e.target === document.getElementById('target')) entry = e; @@ -229,7 +240,8 @@ async function testEventType(t, eventType, looseCount=false) { assert_greater_than_equal(performance.eventCounts.get(eventType), 3, `Should have at least 3 ${eventType} events`) } else { - assert_equals(performance.eventCounts.get(eventType), 3, `Should have 3 ${eventType} events`); + assert_equals(performance.eventCounts.get(eventType), 3, + `Should have 3 ${eventType} events`); } resolve(); })).observe({type: 'event', durationThreshold: durationThreshold}); @@ -237,4 +249,4 @@ async function testEventType(t, eventType, looseCount=false) { // Cause a slow event. let actionPromise = applyAction(eventType, target); return Promise.all([actionPromise, observerPromise]); -}
\ No newline at end of file +} diff --git a/tests/wpt/web-platform-tests/forced-colors-mode/forced-colors-mode-01.html b/tests/wpt/web-platform-tests/forced-colors-mode/forced-colors-mode-01.html index 1f4e3899a8a..9c0ef0b3093 100644 --- a/tests/wpt/web-platform-tests/forced-colors-mode/forced-colors-mode-01.html +++ b/tests/wpt/web-platform-tests/forced-colors-mode/forced-colors-mode-01.html @@ -10,17 +10,17 @@ td, th { border: 1px solid; - border-bottom-color: black; - border-left-color: purple; - border-right-color: orange; - border-top-color: green; + border-bottom-color: black !important; + border-left-color: purple !important; + border-right-color: orange !important; + border-top-color: green !important; padding: 8px; text-align: left; } tr:nth-child(even) { - background-color: blue; - color: red; + background-color: blue !important; + color: red !important; } </style> <body> diff --git a/tests/wpt/web-platform-tests/gamepad/idlharness.window.js b/tests/wpt/web-platform-tests/gamepad/idlharness.window.js index 7943520b5b3..0bbb0b3c701 100644 --- a/tests/wpt/web-platform-tests/gamepad/idlharness.window.js +++ b/tests/wpt/web-platform-tests/gamepad/idlharness.window.js @@ -1,5 +1,6 @@ // META: script=/resources/WebIDLParser.js // META: script=/resources/idlharness.js +// META: timeout=long // https://w3c.github.io/gamepad/ diff --git a/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js index 1843734a3bb..22101ccc273 100644 --- a/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js +++ b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js @@ -221,16 +221,18 @@ function runGenericSensorTests(sensorName, sensor_test(async (t, sensorProvider) => { assert_true(sensorName in self); const sensor1 = new sensorType(); - const sensorWatcher = new EventWatcher(t, sensor1, ["reading", "error"]); + const sensorWatcher1 = new EventWatcher(t, sensor1, ["reading", "error"]); sensor1.start(); const sensor2 = new sensorType(); + const sensorWatcher2 = new EventWatcher(t, sensor2, ["reading", "error"]); sensor2.start(); const mockSensor = await sensorProvider.getCreatedSensor(sensorName); await mockSensor.setSensorReading(readings); - await sensorWatcher.wait_for("reading"); + await Promise.all([sensorWatcher1.wait_for("reading"), + sensorWatcher2.wait_for("reading")]); const expected = new RingBuffer(expectedReadings).next().value; // Reading values are correct for both sensors. assert_true(verificationFunction(expected, sensor1)); @@ -428,41 +430,6 @@ function runGenericSensorTests(sensorName, assert_greater_than(fastCounter, 2, "Fast sensor overtakes the slow one"); }, `${sensorName}: frequency hint works.`); - sensor_test(async (t, sensorProvider) => { - assert_true(sensorName in self); - // Create a focused editbox inside a cross-origin iframe, - // sensor notification must suspend. - const iframeSrc = 'data:text/html;charset=utf-8,<html><body>' - + '<input type="text" autofocus></body></html>'; - const iframe = document.createElement('iframe'); - iframe.src = encodeURI(iframeSrc); - - const sensor = new sensorType(); - const sensorWatcher = new EventWatcher(t, sensor, ["reading", "error"]); - sensor.start(); - - const mockSensor = await sensorProvider.getCreatedSensor(sensorName); - await mockSensor.setSensorReading(readings); - - await sensorWatcher.wait_for("reading"); - const expected = new RingBuffer(expectedReadings).next().value; - assert_true(verificationFunction(expected, sensor)); - const cachedTimestamp1 = sensor.timestamp; - - const iframeWatcher = new EventWatcher(t, iframe, "load"); - document.body.appendChild(iframe); - await iframeWatcher.wait_for("load"); - const cachedTimestamp2 = sensor.timestamp; - assert_equals(cachedTimestamp1, cachedTimestamp2); - - iframe.remove(); - await sensorWatcher.wait_for("reading"); - assert_greater_than(sensor.timestamp, cachedTimestamp1); - - sensor.stop(); - }, `${sensorName}: sensor receives suspend / resume notifications when\ - cross-origin subframe is focused.`); - // Re-enable after https://github.com/w3c/sensors/issues/361 is fixed. // test(() => { // assert_throws_dom("NotSupportedError", @@ -501,7 +468,8 @@ function runGenericSensorTests(sensorName, assert_true(sensorName in self); const sensor1 = new sensorType({frequency: 60}); const sensor2 = new sensorType({frequency: 60, referenceFrame: "screen"}); - const sensorWatcher = new EventWatcher(t, sensor1, ["reading", "error"]); + const sensorWatcher1 = new EventWatcher(t, sensor1, ["reading", "error"]); + const sensorWatcher2 = new EventWatcher(t, sensor1, ["reading", "error"]); sensor1.start(); sensor2.start(); @@ -509,7 +477,8 @@ function runGenericSensorTests(sensorName, const mockSensor = await sensorProvider.getCreatedSensor(sensorName); await mockSensor.setSensorReading(readings); - await sensorWatcher.wait_for("reading"); + await Promise.all([sensorWatcher1.wait_for("reading"), + sensorWatcher2.wait_for("reading")]); const expected = new RingBuffer(expectedReadings).next().value; const expectedRemapped = diff --git a/tests/wpt/web-platform-tests/generic-sensor/resources/generic-sensor-helpers.js b/tests/wpt/web-platform-tests/generic-sensor/resources/generic-sensor-helpers.js index aff6d172d46..c2afb400207 100644 --- a/tests/wpt/web-platform-tests/generic-sensor/resources/generic-sensor-helpers.js +++ b/tests/wpt/web-platform-tests/generic-sensor/resources/generic-sensor-helpers.js @@ -53,12 +53,13 @@ async function initialize_generic_sensor_tests() { function sensor_test(func, name, properties) { promise_test(async (t) => { + t.add_cleanup(() => { + if (sensorTest) + return sensorTest.reset(); + }); + let sensorTest = await initialize_generic_sensor_tests(); - try { - await func(t, sensorTest.getSensorProvider()); - } finally { - await sensorTest.reset(); - }; + return func(t, sensorTest.getSensorProvider()); }, name, properties); } diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations.html new file mode 100644 index 00000000000..cd4b99dd458 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations.html @@ -0,0 +1,83 @@ +<!DOCTYPE html> +<head> + <title>Relevant mutations on deferred loading=lazy images should not trigger + a request</title> + <link rel="author" title="Dom Farolino" href="mailto:dom@chromium.org"> + <link rel="help" href="https://html.spec.whatwg.org/multipage/images.html#updating-the-image-data"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> + +<script> + let below_viewport_1_loaded = false, + below_viewport_2_loaded = false, + below_viewport_3_loaded = false + + // For general lazy loading behavior. + promise_test(() => { + // When the page loads, start the rest of the tests. + return new Promise(resolve => { + window.addEventListener("load", e => { + const kAssertion = 'image should never load'; + assert_false(below_viewport_1_loaded, `below-viewport-1 ${kAssertion}`); + assert_false(below_viewport_2_loaded, `below-viewport-2 ${kAssertion}`); + assert_false(below_viewport_3_loaded, `below-viewport-3 ${kAssertion}`); + resolve(); + }); + }); + }, "Images are lazyloaded"); + + // For `referrerPolicy` attribute mutations. + promise_test(t => { + return new Promise((resolve, reject) => { + const below_viewport_1 = document.querySelector('img#below-viewport-1'); + below_viewport_1.onload = reject; + below_viewport_1.onerror = reject; + t.step_timeout(resolve, 1000); + + below_viewport_1.referrerPolicy = 'no-referrer'; + }); + }, "Image referrerPolicy mutation does not cause deferred loading=lazy " + + "images to be fetched"); + + // For `crossOrigin` attribute mutations. + promise_test(t => { + return new Promise((resolve, reject) => { + const below_viewport_2 = document.querySelector('img#below-viewport-2'); + below_viewport_2.onload = reject; + below_viewport_2.onerror = reject; + t.step_timeout(resolve, 1000); + + below_viewport_2.crossOrigin = 'anonymous'; + }); + }, "Image crossOrigin mutation does not cause deferred loading=lazy " + + "images to be fetched"); + + // For `src` attribute mutations. + promise_test(t => { + return new Promise((resolve, reject) => { + const below_viewport_3 = document.querySelector('img#below-viewport-3'); + below_viewport_3.onload = reject; + below_viewport_3.onerror = reject; + t.step_timeout(resolve, 1000); + + below_viewport_3.src = "resources/image.png?change"; + }); + }, "Image src mutation does not cause deferred loading=lazy " + + "images to be fetched"); +</script> + +<body> + <div style="height:1000vh;"></div> + <img id="below-viewport-1" src="resources/image.png?1" loading="lazy" + onload="below_viewport_1_loaded = true" + onerror="below_viewport_1_loaded = true"> + + <img id="below-viewport-2" src="resources/image.png?2" loading="lazy" + onload="below_viewport_2_loaded = true" + onerror="below_viewport_2_loaded = true"> + + <img id="below-viewport-3" src="resources/image.png?3" loading="lazy" + onload="below_viewport_3_loaded = true" + onerror="below_viewport_3_loaded = true"> +</body> diff --git a/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html b/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html index 8df2d305232..4c97ea078c5 100644 --- a/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html +++ b/tests/wpt/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html @@ -42,7 +42,19 @@ function testDialogCentering(writingMode, containerWritingMode, dialogWritingMod iframe.height = iframeHeight; iframe.onload = t.step_func_done(() => { const dialog = iframe.contentDocument.querySelector("dialog"); - assert_equals(iframe.contentWindow.getComputedStyle(dialog)[property], numericValue + "px"); + const dialogStyle = iframe.contentWindow.getComputedStyle(dialog); + assert_equals(dialogStyle[property], numericValue + "px"); + assert_equals(dialogStyle['inset-inline-start'], "0px"); + assert_equals(dialogStyle['inset-inline-end'], "0px"); + + const dialogWM = dialogWritingMode || containerWritingMode || writingMode || "horizontal-tb"; + if (dialogWM.startsWith("vertical")) { + assert_equals(dialogStyle['top'], "0px"); + assert_equals(dialogStyle['bottom'], "0px"); + } else { + assert_equals(dialogStyle['left'], "0px"); + assert_equals(dialogStyle['right'], "0px"); + } }); document.body.appendChild(iframe); }, writingMode + (containerWritingMode ? ` (container ${containerWritingMode})` : "") + diff --git a/tests/wpt/web-platform-tests/lint.ignore b/tests/wpt/web-platform-tests/lint.ignore index 8cfef1eded2..ddb9f9fcc07 100644 --- a/tests/wpt/web-platform-tests/lint.ignore +++ b/tests/wpt/web-platform-tests/lint.ignore @@ -262,7 +262,9 @@ GENERATE_TESTS: domparsing/createContextualFragment.html GENERATE_TESTS: domxpath/001.html GENERATE_TESTS: domxpath/002.html GENERATE_TESTS: mediacapture-image/MediaStreamTrack-applyConstraints-reject.html +GENERATE_TESTS: mediacapture-image/MediaStreamTrack-getCapabilities.html GENERATE_TESTS: mediacapture-image/MediaStreamTrack-getConstraints-fast.html +GENERATE_TESTS: mediacapture-image/MediaStreamTrack-getSettings.html GENERATE_TESTS: mediacapture-image/setOptions-reject.html GENERATE_TESTS: html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html GENERATE_TESTS: html/syntax/parsing/Document.getElementsByTagName-foreign-01.html diff --git a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints-getSettings.html b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints-getSettings.html index 9d985de66de..a1695b11130 100644 --- a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints-getSettings.html +++ b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints-getSettings.html @@ -1,6 +1,8 @@ <!DOCTYPE html> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> <script src="/mediacapture-image/resources/imagecapture-helpers.js"></script> <body> <canvas id='canvas' width=10 height=10/> @@ -11,6 +13,9 @@ // service implementation, are returned by MediaStreamTrack.getSettings(). image_capture_test(async t => { + await test_driver.set_permission({name: 'camera', panTiltZoom: true}, + 'granted', false); + let canvas = document.getElementById('canvas'); let context = canvas.getContext('2d'); context.fillStyle = 'red'; @@ -98,6 +103,40 @@ image_capture_test(async t => { assert_equals(constraints.advanced[0].torch, settings.torch, 'torch'); -}, 'exercises an applyConstraints() - getSettings() cycle'); +}, 'exercises an applyConstraints() - getSettings() cycle with PTZ permission granted'); + + +// This test verifies that the PTZ |constraints| configured in the mock Mojo +// service implementation can't be applied if PTZ permission is denied. + +image_capture_test(async t => { + await test_driver.set_permission({name: 'camera', panTiltZoom: true}, + 'denied', false); + + let canvas = document.getElementById('canvas'); + let context = canvas.getContext('2d'); + context.fillStyle = 'red'; + context.fillRect(0, 0, 10, 10); + + let stream = canvas.captureStream(); + let videoTrack = stream.getVideoTracks()[0]; + + // |videoTrack|'s capabilities gathering, just like the actual capture, is + // a process kicked off right after creation, we introduce a small delay + // to allow for those to be collected, since they are needed to understand + // which constraints are supported in applyConstraints(). + // TODO(mcasas): this shouldn't be needed, https://crbug.com/711524. + await new Promise(resolve => step_timeout(resolve, 100)); + + const constraints = [{ pan: 8 }, { tilt: 9 }]; + await Promise.all(constraints.map(async constraint => + promise_rejects_dom( + t, 'NotAllowedError', + videoTrack.applyConstraints({ advanced: [constraint] }), + "applyConstraints should throw a NotAllowedError for " + + JSON.stringify(constraint)) + )); + +}, 'exercises an applyConstraints() with PTZ permission denied'); </script>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints-reject.html b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints-reject.html index 21719636ea8..45599c076f0 100644 --- a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints-reject.html +++ b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints-reject.html @@ -1,6 +1,8 @@ <!DOCTYPE html> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> <script src="/mediacapture-image/resources/imagecapture-helpers.js"></script> <body> <canvas id='canvas' width=10 height=10/> @@ -16,6 +18,9 @@ context.fillRect(0, 0, 10, 10); // passed constraint is unsupported or outside its allowed range. var makePromiseTest = function(getConstraint) { image_capture_test(async (t, imageCaptureTest) => { + await test_driver.set_permission({name: 'camera', panTiltZoom: true}, + 'granted', false); + imageCaptureTest.mockImageCapture().state().supportsTorch = false; let stream = canvas.captureStream(); diff --git a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints.html b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints.html index da3de3ec0f9..3c5c05aefa0 100644 --- a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints.html +++ b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-applyConstraints.html @@ -1,6 +1,8 @@ <!DOCTYPE html> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> <script src="/mediacapture-image/resources/imagecapture-helpers.js"></script> <body> <canvas id='canvas' width=10 height=10/> @@ -13,6 +15,9 @@ const meteringModeNames = ['none', 'manual', 'single-shot', 'continuous']; // a mock Mojo service implementation. image_capture_test(async (t, imageCaptureTest) => { + await test_driver.set_permission({name: 'camera', panTiltZoom: true}, + 'granted', false); + let canvas = document.getElementById('canvas'); let context = canvas.getContext('2d'); context.fillStyle = 'red'; @@ -113,6 +118,7 @@ image_capture_test(async (t, imageCaptureTest) => { assert_equals(constraintsDict.pan, theMock.options().pan, 'pan'); assert_equals(constraintsDict.tilt, theMock.options().tilt, 'tilt'); + assert_equals(constraintsDict.zoom, theMock.options().zoom, 'zoom'); assert_equals(constraintsDict.torch, theMock.options().torch, 'torch'); diff --git a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-getCapabilities.html b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-getCapabilities.html index e7b196f510a..c569283c34e 100644 --- a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-getCapabilities.html +++ b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-getCapabilities.html @@ -1,6 +1,8 @@ <!DOCTYPE html> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> <script src="/mediacapture-image/resources/imagecapture-helpers.js"></script> <body> <canvas id='canvas' width=10 height=10/> @@ -11,154 +13,174 @@ const meteringModeNames = ['none', 'manual', 'single-shot', 'continuous']; // This test verifies that MediaTrackCapabilities are returned upon // MediaStreamTrack.getCapabilities(), with a mock Mojo service implementation. - -image_capture_test(async (t, imageCaptureTest) => { - let canvas = document.getElementById('canvas'); - let context = canvas.getContext('2d'); - context.fillStyle = 'red'; - context.fillRect(0, 0, 10, 10); - - let mockCapabilities = imageCaptureTest.mockImageCapture().state(); - - // |stream| must be created _after_ |mock| is constructed to give the - // latter time to override the bindings. - let stream = canvas.captureStream(); - assert_equals(stream.getAudioTracks().length, 0); - assert_equals(stream.getVideoTracks().length, 1); - - let videoTrack = stream.getVideoTracks()[0]; - assert_equals(typeof videoTrack.getCapabilities, 'function'); - - // |videoTrack|'s capabilities gathering, just like the actual capture, is - // a process kicked off right after creation, we introduce a small delay - // to allow for those to be collected. - // TODO(mcasas): this shouldn't be needed, https://crbug.com/711524. - await new Promise(resolve => step_timeout(resolve, 100)); - - let capabilities = videoTrack.getCapabilities(); - assert_equals(typeof capabilities, 'object'); - - assert_equals(capabilities.whiteBalanceMode.length, - mockCapabilities.supportedWhiteBalanceModes.length, - 'whiteBalanceMode'); - for (i = 0; i < capabilities.whiteBalanceMode.length; ++i) { - assert_equals( - capabilities.whiteBalanceMode[i], - meteringModeNames[mockCapabilities - .supportedWhiteBalanceModes[i]], - 'whiteBalanceMode'); - } - - assert_equals(capabilities.exposureMode.length, - mockCapabilities.supportedExposureModes.length, - 'exposureMode'); - for (i = 0; i < capabilities.exposureMode.length; ++i) { - assert_equals( - capabilities.exposureMode[i], - meteringModeNames[mockCapabilities.supportedExposureModes[i]], - 'exposureMode'); - } - - assert_equals(capabilities.focusMode.length, - mockCapabilities.supportedFocusModes.length, - 'focusMode'); - for (i = 0; i < capabilities.focusMode.length; ++i) { - assert_equals( - capabilities.focusMode[i], - meteringModeNames[mockCapabilities.supportedFocusModes[i]], - 'focusMode'); - } - - assert_true(capabilities.exposureCompensation instanceof - MediaSettingsRange); - assert_equals(capabilities.exposureCompensation.max, - mockCapabilities.exposureCompensation.max); - assert_equals(capabilities.exposureCompensation.min, - mockCapabilities.exposureCompensation.min); - assert_equals(capabilities.exposureCompensation.step, - mockCapabilities.exposureCompensation.step); - - assert_true(capabilities.exposureTime instanceof - MediaSettingsRange); - assert_equals(capabilities.exposureTime.max, - mockCapabilities.exposureTime.max); - assert_equals(capabilities.exposureTime.min, - mockCapabilities.exposureTime.min); - assert_equals(capabilities.exposureTime.step, - mockCapabilities.exposureTime.step); - - assert_true(capabilities.colorTemperature instanceof - MediaSettingsRange); - assert_equals(capabilities.colorTemperature.max, - mockCapabilities.colorTemperature.max); - assert_equals(capabilities.colorTemperature.min, - mockCapabilities.colorTemperature.min); - assert_equals(capabilities.colorTemperature.step, - mockCapabilities.colorTemperature.step); - - assert_true(capabilities.iso instanceof MediaSettingsRange); - assert_equals(capabilities.iso.max, mockCapabilities.iso.max); - assert_equals(capabilities.iso.min, mockCapabilities.iso.min); - assert_equals(capabilities.iso.step, mockCapabilities.iso.step); - - assert_true(capabilities.brightness instanceof MediaSettingsRange); - assert_equals(capabilities.brightness.max, - mockCapabilities.brightness.max); - assert_equals(capabilities.brightness.min, - mockCapabilities.brightness.min); - assert_equals(capabilities.brightness.step, - mockCapabilities.brightness.step); - - assert_true(capabilities.contrast instanceof MediaSettingsRange); - assert_equals(capabilities.contrast.max, - mockCapabilities.contrast.max); - assert_equals(capabilities.contrast.min, - mockCapabilities.contrast.min); - assert_equals(capabilities.contrast.step, - mockCapabilities.contrast.step); - - assert_true(capabilities.saturation instanceof MediaSettingsRange); - assert_equals(capabilities.saturation.max, - mockCapabilities.saturation.max); - assert_equals(capabilities.saturation.min, - mockCapabilities.saturation.min); - assert_equals(capabilities.saturation.step, - mockCapabilities.saturation.step); - - assert_true(capabilities.sharpness instanceof MediaSettingsRange); - assert_equals(capabilities.sharpness.max, - mockCapabilities.sharpness.max); - assert_equals(capabilities.sharpness.min, - mockCapabilities.sharpness.min); - assert_equals(capabilities.sharpness.step, - mockCapabilities.sharpness.step); - - assert_true(capabilities.focusDistance instanceof MediaSettingsRange); - assert_equals(capabilities.focusDistance.max, - mockCapabilities.focusDistance.max); - assert_equals(capabilities.focusDistance.min, - mockCapabilities.focusDistance.min); - assert_equals(capabilities.focusDistance.step, - mockCapabilities.focusDistance.step); - - assert_true(capabilities.pan instanceof MediaSettingsRange); - assert_equals(capabilities.pan.max, mockCapabilities.pan.max); - assert_equals(capabilities.pan.min, mockCapabilities.pan.min); - assert_equals(capabilities.pan.step, mockCapabilities.pan.step); - - assert_true(capabilities.tilt instanceof MediaSettingsRange); - assert_equals(capabilities.tilt.max, mockCapabilities.tilt.max); - assert_equals(capabilities.tilt.min, mockCapabilities.tilt.min); - assert_equals(capabilities.tilt.step, mockCapabilities.tilt.step); - - assert_true(capabilities.zoom instanceof MediaSettingsRange); - assert_equals(capabilities.zoom.max, mockCapabilities.zoom.max); - assert_equals(capabilities.zoom.min, mockCapabilities.zoom.min); - assert_equals(capabilities.zoom.step, mockCapabilities.zoom.step); - - assert_equals(capabilities.torch, mockCapabilities.supportsTorch, - 'torch'); - -}, 'exercises MediaStreamTrack.getCapabilities()'); - +// When PTZ permission is denied though, PTZ capabilities are not available. + +function makeImageCaptureTest(hasPanTiltZoomPermissionGranted) { + image_capture_test(async (t, imageCaptureTest) => { + const ptzPermission = hasPanTiltZoomPermissionGranted ? 'granted' : 'denied'; + await test_driver.set_permission({name: 'camera', panTiltZoom: true}, + ptzPermission, false); + + let canvas = document.getElementById('canvas'); + let context = canvas.getContext('2d'); + context.fillStyle = 'red'; + context.fillRect(0, 0, 10, 10); + + let mockCapabilities = imageCaptureTest.mockImageCapture().state(); + + // |stream| must be created _after_ |mock| is constructed to give the + // latter time to override the bindings. + let stream = canvas.captureStream(); + assert_equals(stream.getAudioTracks().length, 0); + assert_equals(stream.getVideoTracks().length, 1); + + let videoTrack = stream.getVideoTracks()[0]; + assert_equals(typeof videoTrack.getCapabilities, 'function'); + + // |videoTrack|'s capabilities gathering, just like the actual capture, is + // a process kicked off right after creation, we introduce a small delay + // to allow for those to be collected. + // TODO(mcasas): this shouldn't be needed, https://crbug.com/711524. + await new Promise(resolve => step_timeout(resolve, 100)); + + let capabilities = videoTrack.getCapabilities(); + assert_equals(typeof capabilities, 'object'); + + assert_equals(capabilities.whiteBalanceMode.length, + mockCapabilities.supportedWhiteBalanceModes.length, + 'whiteBalanceMode'); + for (i = 0; i < capabilities.whiteBalanceMode.length; ++i) { + assert_equals( + capabilities.whiteBalanceMode[i], + meteringModeNames[mockCapabilities + .supportedWhiteBalanceModes[i]], + 'whiteBalanceMode'); + } + + assert_equals(capabilities.exposureMode.length, + mockCapabilities.supportedExposureModes.length, + 'exposureMode'); + for (i = 0; i < capabilities.exposureMode.length; ++i) { + assert_equals( + capabilities.exposureMode[i], + meteringModeNames[mockCapabilities.supportedExposureModes[i]], + 'exposureMode'); + } + + assert_equals(capabilities.focusMode.length, + mockCapabilities.supportedFocusModes.length, + 'focusMode'); + for (i = 0; i < capabilities.focusMode.length; ++i) { + assert_equals( + capabilities.focusMode[i], + meteringModeNames[mockCapabilities.supportedFocusModes[i]], + 'focusMode'); + } + + assert_true(capabilities.exposureCompensation instanceof + MediaSettingsRange); + assert_equals(capabilities.exposureCompensation.max, + mockCapabilities.exposureCompensation.max); + assert_equals(capabilities.exposureCompensation.min, + mockCapabilities.exposureCompensation.min); + assert_equals(capabilities.exposureCompensation.step, + mockCapabilities.exposureCompensation.step); + + assert_true(capabilities.exposureTime instanceof + MediaSettingsRange); + assert_equals(capabilities.exposureTime.max, + mockCapabilities.exposureTime.max); + assert_equals(capabilities.exposureTime.min, + mockCapabilities.exposureTime.min); + assert_equals(capabilities.exposureTime.step, + mockCapabilities.exposureTime.step); + + assert_true(capabilities.colorTemperature instanceof + MediaSettingsRange); + assert_equals(capabilities.colorTemperature.max, + mockCapabilities.colorTemperature.max); + assert_equals(capabilities.colorTemperature.min, + mockCapabilities.colorTemperature.min); + assert_equals(capabilities.colorTemperature.step, + mockCapabilities.colorTemperature.step); + + assert_true(capabilities.iso instanceof MediaSettingsRange); + assert_equals(capabilities.iso.max, mockCapabilities.iso.max); + assert_equals(capabilities.iso.min, mockCapabilities.iso.min); + assert_equals(capabilities.iso.step, mockCapabilities.iso.step); + + assert_true(capabilities.brightness instanceof MediaSettingsRange); + assert_equals(capabilities.brightness.max, + mockCapabilities.brightness.max); + assert_equals(capabilities.brightness.min, + mockCapabilities.brightness.min); + assert_equals(capabilities.brightness.step, + mockCapabilities.brightness.step); + + assert_true(capabilities.contrast instanceof MediaSettingsRange); + assert_equals(capabilities.contrast.max, + mockCapabilities.contrast.max); + assert_equals(capabilities.contrast.min, + mockCapabilities.contrast.min); + assert_equals(capabilities.contrast.step, + mockCapabilities.contrast.step); + + assert_true(capabilities.saturation instanceof MediaSettingsRange); + assert_equals(capabilities.saturation.max, + mockCapabilities.saturation.max); + assert_equals(capabilities.saturation.min, + mockCapabilities.saturation.min); + assert_equals(capabilities.saturation.step, + mockCapabilities.saturation.step); + + assert_true(capabilities.sharpness instanceof MediaSettingsRange); + assert_equals(capabilities.sharpness.max, + mockCapabilities.sharpness.max); + assert_equals(capabilities.sharpness.min, + mockCapabilities.sharpness.min); + assert_equals(capabilities.sharpness.step, + mockCapabilities.sharpness.step); + + assert_true(capabilities.focusDistance instanceof MediaSettingsRange); + assert_equals(capabilities.focusDistance.max, + mockCapabilities.focusDistance.max); + assert_equals(capabilities.focusDistance.min, + mockCapabilities.focusDistance.min); + assert_equals(capabilities.focusDistance.step, + mockCapabilities.focusDistance.step); + + if (ptzPermission === 'granted') { + assert_true(capabilities.pan instanceof MediaSettingsRange); + assert_equals(capabilities.pan.max, mockCapabilities.pan.max); + assert_equals(capabilities.pan.min, mockCapabilities.pan.min); + assert_equals(capabilities.pan.step, mockCapabilities.pan.step); + + assert_true(capabilities.tilt instanceof MediaSettingsRange); + assert_equals(capabilities.tilt.max, mockCapabilities.tilt.max); + assert_equals(capabilities.tilt.min, mockCapabilities.tilt.min); + assert_equals(capabilities.tilt.step, mockCapabilities.tilt.step); + } else if (ptzPermission === 'denied') { + assert_false('pan' in capabilities); + assert_false('tilt' in capabilities); + } + assert_true(capabilities.zoom instanceof MediaSettingsRange); + assert_equals(capabilities.zoom.max, mockCapabilities.zoom.max); + assert_equals(capabilities.zoom.min, mockCapabilities.zoom.min); + assert_equals(capabilities.zoom.step, mockCapabilities.zoom.step); + + assert_equals(capabilities.torch, mockCapabilities.supportsTorch, + 'torch'); + }); +} + +generate_tests(makeImageCaptureTest, [ + [ + "exercises MediaStreamTrack.getCapabilities() with PTZ permission denied", + false, + ], + [ + "exercises MediaStreamTrack.getCapabilities() with PTZ permission granted", + true, + ], +]); </script> diff --git a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-getSettings.html b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-getSettings.html index a1a864c2445..8fc2c823195 100644 --- a/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-getSettings.html +++ b/tests/wpt/web-platform-tests/mediacapture-image/MediaStreamTrack-getSettings.html @@ -1,6 +1,8 @@ <!DOCTYPE html> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> <script src="/mediacapture-image/resources/imagecapture-helpers.js"></script> <body> <canvas id='canvas' width=10 height=10/> @@ -11,63 +13,84 @@ const meteringModeNames = ['none', 'manual', 'single-shot', 'continuous']; // This test verifies that the settings defined in the mock Mojo service // implementation are the same as those returned by the corresponding -// MediaStreamTrack.getSettings(). - -image_capture_test(async (t, imageCaptureTest) => { - let canvas = document.getElementById('canvas'); - let context = canvas.getContext('2d'); - context.fillStyle = 'red'; - context.fillRect(0, 0, 10, 10); - - let mockSettings = imageCaptureTest.mockImageCapture().state(); - - // |stream| must be created _after_ |mock| is constructed to give the - // latter time to override the bindings. - let stream = canvas.captureStream(); - let videoTrack = stream.getVideoTracks()[0]; - - // |videoTrack|s settings retrieval, just like the actual capture, is a - // process kicked right after creation, we introduce a small delay to - // allow for those to be collected. - await new Promise(resolve => step_timeout(resolve, 100)); - - let settings = videoTrack.getSettings(); - assert_equals(typeof settings, 'object'); - - assert_equals(settings.whiteBalanceMode, - meteringModeNames[mockSettings.currentWhiteBalanceMode], - 'whiteBalanceMode'); - assert_equals(settings.exposureMode, - meteringModeNames[mockSettings.currentExposureMode], - 'exposureMode;'); - assert_equals(settings.focusMode, - meteringModeNames[mockSettings.currentFocusMode], - 'focusMode'); - - assert_point2d_array_approx_equals( - settings.pointsOfInterest, mockSettings.pointsOfInterest, 0.01); - - assert_equals(settings.exposureCompensation, - mockSettings.exposureCompensation.current); - assert_equals(settings.exposureTime, - mockSettings.exposureTime.current); - assert_equals(settings.colorTemperature, - mockSettings.colorTemperature.current); - assert_equals(settings.iso, mockSettings.iso.current); - - assert_equals(settings.brightness, mockSettings.brightness.current); - assert_equals(settings.contrast, mockSettings.contrast.current); - assert_equals(settings.saturation, mockSettings.saturation.current); - assert_equals(settings.sharpness, mockSettings.sharpness.current); - - assert_equals(settings.focusDistance, mockSettings.focusDistance.current); - - assert_equals(settings.pan, mockSettings.pan.current); - assert_equals(settings.tilt, mockSettings.tilt.current); - assert_equals(settings.zoom, mockSettings.zoom.current); - - assert_equals(settings.torch, mockSettings.torch, 'torch'); - -}, 'exercises MediaStreamTrack.getSettings()'); - +// MediaStreamTrack.getSettings(), except for PTZ settings when PTZ +// permission is denied. + +function makeImageCaptureTest(hasPanTiltZoomPermissionGranted) { + image_capture_test(async (t, imageCaptureTest) => { + const ptzPermission = hasPanTiltZoomPermissionGranted ? 'granted' : 'denied'; + await test_driver.set_permission({name: 'camera', panTiltZoom: true}, + ptzPermission, false); + + let canvas = document.getElementById('canvas'); + let context = canvas.getContext('2d'); + context.fillStyle = 'red'; + context.fillRect(0, 0, 10, 10); + + let mockSettings = imageCaptureTest.mockImageCapture().state(); + + // |stream| must be created _after_ |mock| is constructed to give the + // latter time to override the bindings. + let stream = canvas.captureStream(); + let videoTrack = stream.getVideoTracks()[0]; + + // |videoTrack|s settings retrieval, just like the actual capture, is a + // process kicked right after creation, we introduce a small delay to + // allow for those to be collected. + await new Promise(resolve => step_timeout(resolve, 100)); + + let settings = videoTrack.getSettings(); + assert_equals(typeof settings, 'object'); + + assert_equals(settings.whiteBalanceMode, + meteringModeNames[mockSettings.currentWhiteBalanceMode], + 'whiteBalanceMode'); + assert_equals(settings.exposureMode, + meteringModeNames[mockSettings.currentExposureMode], + 'exposureMode;'); + assert_equals(settings.focusMode, + meteringModeNames[mockSettings.currentFocusMode], + 'focusMode'); + + assert_point2d_array_approx_equals( + settings.pointsOfInterest, mockSettings.pointsOfInterest, 0.01); + + assert_equals(settings.exposureCompensation, + mockSettings.exposureCompensation.current); + assert_equals(settings.exposureTime, + mockSettings.exposureTime.current); + assert_equals(settings.colorTemperature, + mockSettings.colorTemperature.current); + assert_equals(settings.iso, mockSettings.iso.current); + + assert_equals(settings.brightness, mockSettings.brightness.current); + assert_equals(settings.contrast, mockSettings.contrast.current); + assert_equals(settings.saturation, mockSettings.saturation.current); + assert_equals(settings.sharpness, mockSettings.sharpness.current); + + assert_equals(settings.focusDistance, mockSettings.focusDistance.current); + + if (ptzPermission === 'granted') { + assert_equals(settings.pan, mockSettings.pan.current); + assert_equals(settings.tilt, mockSettings.tilt.current); + } else if (ptzPermission === 'denied') { + assert_false('pan' in settings); + assert_false('tilt' in settings); + } + assert_equals(settings.zoom, mockSettings.zoom.current); + + assert_equals(settings.torch, mockSettings.torch, 'torch'); + }); +} + +generate_tests(makeImageCaptureTest, [ + [ + "exercises MediaStreamTrack.getSettings() with PTZ permission denied", + false, + ], + [ + "exercises MediaStreamTrack.getSettings() with PTZ permission granted", + true, + ], +]); </script> diff --git a/tests/wpt/web-platform-tests/orientation-event/resources/orientation-event-helpers.js b/tests/wpt/web-platform-tests/orientation-event/resources/orientation-event-helpers.js index 307c52f0003..3f81fec5867 100644 --- a/tests/wpt/web-platform-tests/orientation-event/resources/orientation-event-helpers.js +++ b/tests/wpt/web-platform-tests/orientation-event/resources/orientation-event-helpers.js @@ -51,12 +51,13 @@ async function initialize_generic_sensor_tests() { function sensor_test(func, name, properties) { promise_test(async (t) => { + t.add_cleanup(() => { + if (sensorTest) + return sensorTest.reset(); + }); + let sensorTest = await initialize_generic_sensor_tests(); - try { - await func(t, sensorTest.getSensorProvider()); - } finally { - await sensorTest.reset(); - }; + return func(t, sensorTest.getSensorProvider()); }, name, properties); } @@ -91,7 +92,15 @@ function generateOrientationData(alpha, beta, gamma, absolute) { async function setMockSensorDataForType(sensorProvider, sensorType, mockDataArray) { const createdSensor = await sensorProvider.getCreatedSensor(sensorType); - return createdSensor.setSensorReading([mockDataArray]); + // We call setSensorReadingAndUpdateSharedBuffer() rather than + // setSensorReading() to accommodate Blink's Device Orientation + // implementation, which uses its own timer to read the sensor's shared + // memory buffer rather than relying on SensorReadingChanged(). This timer + // may fire out of sync with the JS timer in MockSensor.startReading(), so + // the former might read the shared memory buffer before the latter has + // updated |this.buffer_|. We thus immediately update the buffer here + // (without consuming data from the ring buffer). + return createdSensor.setSensorReadingImmediately([mockDataArray]); } // Device[Orientation|Motion]EventPump treat NaN as a missing value. diff --git a/tests/wpt/web-platform-tests/origin-isolation/going-back.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/going-back.sub.https.html new file mode 100644 index 00000000000..781e3640d3b --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/going-back.sub.https.html @@ -0,0 +1,130 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Parent is isolated, child1 is not isolated, child1 navigates to a different site, child2 gets inserted and is isolated, child1 navigates back</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<div id="log"></div> + +<script type="module"> +import { insertIframe, navigateIframe, waitForIframe, sendWasmModule, + setBothDocumentDomains, sendWasmModuleBetween, accessDocumentBetween } + from "./resources/helpers.mjs"; + +let frameWindow1, frame1, frameWindow2; +promise_setup(async () => { + frameWindow1 = await insertIframe("{{hosts[][www]}}"); + frame1 = document.querySelector("iframe"); +}); + +// Since they're different-origin, the parent's isolation request is respected, +// as is the child's non-request. So the parent ends up in the origin-keyed +// agent cluster and the child ends up in the site-keyed one. + +promise_test(async () => { + const whatHappened = await sendWasmModule(frameWindow1); + + assert_equals(whatHappened, "messageerror"); +}, "Before navigation: parent to child1: messageerror event must occur"); + +promise_test(async () => { + await setBothDocumentDomains(frameWindow1); + + assert_throws_dom("SecurityError", DOMException, () => { + frameWindow1.document; + }); +}, "Before navigation: parent to child1: setting document.domain must not give sync access"); + +// Navigate the iframe to a different site. These, of course, must not be in the +// same agent cluster. + +promise_test(async () => { + await navigateIframe(frame1, "{{hosts[alt][]}}"); +}, "Navigation"); + +// Now insert a second iframe, pointing to the same place as the first one +// originally did, but this time with origin isolation enabled. Because of the +// historical map of agent cluster keys for the browsing context group, the new +// iframe should still end up in the site-keyed agent cluster. + +promise_test(async () => { + frameWindow2 = await insertIframe("{{hosts[][www]}}", "?1"); +}, "Inserting a second iframe"); + +promise_test(async () => { + const whatHappened = await sendWasmModule(frameWindow2); + + assert_equals(whatHappened, "messageerror"); +}, "After navigation: parent to child2: messageerror event must occur"); + +promise_test(async () => { + await setBothDocumentDomains(frameWindow2); + + assert_throws_dom("SecurityError", DOMException, () => { + frameWindow2.document; + }); +}, "After navigation: parent to child2: setting document.domain must not give sync access"); + +// Now navigate the first iframe back. The resulting Document should be put in +// the site agent cluster, together with the second iframe's Document. + +promise_test(async () => { + const waitPromise = waitForIframe(frame1); + history.back(); + await waitPromise; + + await setBothDocumentDomains(frameWindow1); +}, "Going back in history (navigating back the first iframe)"); + +promise_test(async () => { + const whatHappened = await sendWasmModule(frameWindow1); + + assert_equals(whatHappened, "messageerror"); +}, "After back: parent to child1: messageerror event must occur"); + +promise_test(async () => { + await setBothDocumentDomains(frameWindow2); + + assert_throws_dom("SecurityError", DOMException, () => { + frameWindow1.document; + }); +}, "After back: parent to child1: setting document.domain must not give sync access"); + +promise_test(async () => { + const whatHappened = await sendWasmModule(frameWindow2); + + assert_equals(whatHappened, "messageerror"); +}, "After back: parent to child2: messageerror event must occur"); + +promise_test(async () => { + await setBothDocumentDomains(frameWindow1); + + assert_throws_dom("SecurityError", DOMException, () => { + frameWindow1.document; + }); +}, "After back: parent to child2: setting document.domain must not give sync access"); + +promise_test(async () => { + const whatHappened = await sendWasmModuleBetween(frameWindow1, 1); + + assert_equals(whatHappened, "WebAssembly.Module message received"); +}, "child1 to child2: message event must occur"); + +promise_test(async () => { + const whatHappened = await accessDocumentBetween(frameWindow1, 1); + + assert_equals(whatHappened, "accessed document successfully"); +}, "child1 to child2: setting document.domain must give sync access"); + +promise_test(async () => { + const whatHappened = await sendWasmModuleBetween(frameWindow2, 0); + + assert_equals(whatHappened, "WebAssembly.Module message received"); +}, "child2 to child1: message event must occur"); + +promise_test(async () => { + const whatHappened = await accessDocumentBetween(frameWindow2, 0); + + assert_equals(whatHappened, "accessed document successfully"); +}, "child2 to child1: setting document.domain must give sync access"); +</script> diff --git a/tests/wpt/web-platform-tests/origin-isolation/going-back.sub.https.html.headers b/tests/wpt/web-platform-tests/origin-isolation/going-back.sub.https.html.headers new file mode 100644 index 00000000000..ea3f6b335c7 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/going-back.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/tests/wpt/web-platform-tests/origin-isolation/removing-iframes.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/removing-iframes.sub.https.html new file mode 100644 index 00000000000..0d2d97815e2 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/removing-iframes.sub.https.html @@ -0,0 +1,99 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Parent is isolated, child1 is not isolated, child1 navigates to a different site, child2 gets inserted and is isolated, child1 navigates back</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<div id="log"></div> + +<script type="module"> +import { insertIframe, navigateIframe, waitForIframe, sendWasmModule, + setBothDocumentDomains, sendWasmModuleBetween, accessDocumentBetween } + from "./resources/helpers.mjs"; + +let frame1, frameWindow1, frameWindow2, frameWindow3; +promise_setup(async () => { + frameWindow1 = await insertIframe("{{hosts[][www]}}"); + frame1 = document.querySelector("iframe"); +}); + +// Since they're different-origin, the parent's isolation request is respected, +// as is the child's non-request. So the parent ends up in the origin-keyed +// agent cluster and the child ends up in the site-keyed one. + +promise_test(async () => { + const whatHappened = await sendWasmModule(frameWindow1); + + assert_equals(whatHappened, "messageerror"); +}, "Before: messageerror event must occur"); + +promise_test(async () => { + await setBothDocumentDomains(frameWindow1); + + assert_throws_dom("SecurityError", DOMException, () => { + frameWindow1.document; + }); +}, "Before: setting document.domain must not give sync access"); + +promise_test(async () => { + frame1.remove(); + + frameWindow2 = await insertIframe("{{hosts[][www]}}", "?1"); + frameWindow3 = await insertIframe("{{hosts[][www1]}}"); + + await setBothDocumentDomains(frameWindow2); + await setBothDocumentDomains(frameWindow3); +}, "Remove the iframe and insert new ones"); + +// Because of the historical presence of a non-isolated {{hosts[][www]}} iframe, +// the origin isolation request for frameWindow2 will be ignored. So, +// frameWindow2 and frameWindow3 both end up in the site-keyed agent cluster. + +promise_test(async () => { + const whatHappened = await sendWasmModule(frameWindow2); + + assert_equals(whatHappened, "messageerror"); +}, "Parent to child2: messageerror event must occur"); + +promise_test(async () => { + assert_throws_dom("SecurityError", DOMException, () => { + frameWindow2.document; + }); +}, "Parent to child2: setting document.domain must not give sync access"); + +promise_test(async () => { + const whatHappened = await sendWasmModule(frameWindow3); + + assert_equals(whatHappened, "messageerror"); +}, "Parent to child3: messageerror event must occur"); + +promise_test(async () => { + assert_throws_dom("SecurityError", DOMException, () => { + frameWindow3.document; + }); +}, "Parent to child3: setting document.domain must not give sync access"); + +promise_test(async () => { + const whatHappened = await sendWasmModuleBetween(frameWindow2, 1); + + assert_equals(whatHappened, "WebAssembly.Module message received"); +}, "child2 to child3: message event must occur"); + +promise_test(async () => { + const whatHappened = await accessDocumentBetween(frameWindow2, 1); + + assert_equals(whatHappened, "accessed document successfully"); +}, "child2 to child3: setting document.domain must give sync access"); + +promise_test(async () => { + const whatHappened = await sendWasmModuleBetween(frameWindow3, 0); + + assert_equals(whatHappened, "WebAssembly.Module message received"); +}, "child3 to child2: message event must occur"); + +promise_test(async () => { + const whatHappened = await accessDocumentBetween(frameWindow3, 0); + + assert_equals(whatHappened, "accessed document successfully"); +}, "child3 to child2: setting document.domain must give sync access"); +</script> diff --git a/tests/wpt/web-platform-tests/origin-isolation/removing-iframes.sub.https.html.headers b/tests/wpt/web-platform-tests/origin-isolation/removing-iframes.sub.https.html.headers new file mode 100644 index 00000000000..ea3f6b335c7 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/removing-iframes.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/tests/wpt/web-platform-tests/origin-isolation/resources/helpers.mjs b/tests/wpt/web-platform-tests/origin-isolation/resources/helpers.mjs index fcef1b7e74f..68478580925 100644 --- a/tests/wpt/web-platform-tests/origin-isolation/resources/helpers.mjs +++ b/tests/wpt/web-platform-tests/origin-isolation/resources/helpers.mjs @@ -1,19 +1,36 @@ export function insertIframe(hostname, header) { + const iframe = document.createElement("iframe"); + const navigatePromise = navigateIframe(iframe, hostname, header); + document.body.append(iframe); + return navigatePromise; +} + +export function navigateIframe(iframeEl, hostname, header) { + const url = getURL(hostname, header); + + const waitPromise = waitForIframe(iframeEl, url); + iframeEl.src = url; + return waitPromise; +} + +export function waitForIframe(iframeEl, destinationForErrorMessage) { + return new Promise((resolve, reject) => { + iframeEl.addEventListener("load", () => resolve(iframeEl.contentWindow)); + iframeEl.addEventListener( + "error", + () => reject(new Error(`Could not navigate to ${destinationForErrorMessage}`)) + ); + }); +} + +function getURL(hostname, header) { const url = new URL("send-origin-isolation-header.py", import.meta.url); url.hostname = hostname; - if (header !== undefined) { url.searchParams.set("header", header); } - const iframe = document.createElement("iframe"); - iframe.src = url.href; - - return new Promise((resolve, reject) => { - iframe.onload = () => resolve(iframe.contentWindow); - iframe.onerror = () => reject(new Error(`Could not load ${iframe.src}`)); - document.body.append(iframe); - }); + return url.href; } // This function is coupled to ./send-origin-isolation-header.py, which ensures diff --git a/tests/wpt/web-platform-tests/origin-isolation/resources/send-origin-isolation-header.py b/tests/wpt/web-platform-tests/origin-isolation/resources/send-origin-isolation-header.py index 1a39740f64f..b0ba30fcd49 100644 --- a/tests/wpt/web-platform-tests/origin-isolation/resources/send-origin-isolation-header.py +++ b/tests/wpt/web-platform-tests/origin-isolation/resources/send-origin-isolation-header.py @@ -16,6 +16,8 @@ def main(request, response): <meta charset="utf-8"> <title>Helper page for origin isolation tests</title> + <body> + <script type="module"> import { sendWasmModule } from "./helpers.mjs"; @@ -50,5 +52,7 @@ def main(request, response): window.onmessageerror = e => { e.source.postMessage("messageerror", "*"); }; + + document.body.textContent = location.href; </script> """ diff --git a/tests/wpt/web-platform-tests/page-lifecycle/idlharness.html b/tests/wpt/web-platform-tests/page-lifecycle/idlharness.html index 08b2b054fba..55a7cbc2429 100644 --- a/tests/wpt/web-platform-tests/page-lifecycle/idlharness.html +++ b/tests/wpt/web-platform-tests/page-lifecycle/idlharness.html @@ -1,5 +1,6 @@ <!doctype html> <title>Page Lifecycle IDL tests</title> +<meta name="timeout" content="long"> <link rel="help" href="https://wicg.github.io/page-lifecycle/"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> diff --git a/tests/wpt/web-platform-tests/pointerevents/compat/pointerevent_mouse-pointer-on-scrollbar.html b/tests/wpt/web-platform-tests/pointerevents/compat/pointerevent_mouse-pointer-on-scrollbar.html new file mode 100644 index 00000000000..43d78e147ec --- /dev/null +++ b/tests/wpt/web-platform-tests/pointerevents/compat/pointerevent_mouse-pointer-on-scrollbar.html @@ -0,0 +1,68 @@ +<!DOCTYPE HTML> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script type="text/javascript" src="../pointerevent_support.js"></script> +<style> +#target { + height: 100px; + width: 100px; + overflow-y: scroll; +} +#spacer { + background: green; + height: 200px; +} +</style> +<h1>Verifies that pointerup/down are fired correctly for corresponding mouse events on the scollbar.</h1> +<div id="target"> +<div id="spacer"></div> +</div> + +<div id="console"></div> + +<script> +var receivedEvents = []; +var targetDiv = document.getElementById('target'); + +function init() { + var eventList = ["mousedown", "mouseup", "pointerdown", "pointerup"]; + eventList.forEach(function(eventName) { + targetDiv.addEventListener(eventName, function(event) { + receivedEvents.push(event.type + "@target"); + }); + }); +} + +function performActions(x, y){ + return new test_driver.Actions() + .pointerMove(0, 0) + .pointerMove(x, y) + .pointerDown(0) + .pointerUp(0) + .send() + .then(()=>resolveWhen(()=>receivedEvents.length == 4)); +} + +function runTests() { + var rect = targetDiv.getBoundingClientRect(); + var x1 = rect.right - 5; + var y1 = rect.top + 20; + + test(function(){ + assert_equals(targetDiv, document.elementFromPoint(x1,y1), + "Didn't hit the scrollbar as expected"); + }, `Test point (${x1},${y1}) is on the scrollbar`); + + promise_test(async () => { + await performActions(Math.ceil(x1), Math.ceil(y1)); + assert_array_equals(receivedEvents, ["pointerdown@target", "mousedown@target", + "pointerup@target", "mouseup@target"]); + }, "Verifies that pointerup/down are fired correctly for corresponding mouse events on the scollbar."); +} + +init(); +runTests(); +</script> diff --git a/tests/wpt/web-platform-tests/pointerevents/compat/pointerevent_mouse-pointer-updown-events.html b/tests/wpt/web-platform-tests/pointerevents/compat/pointerevent_mouse-pointer-updown-events.html new file mode 100644 index 00000000000..a5433aab535 --- /dev/null +++ b/tests/wpt/web-platform-tests/pointerevents/compat/pointerevent_mouse-pointer-updown-events.html @@ -0,0 +1,87 @@ +<!DOCTYPE HTML> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script type="text/javascript" src="../pointerevent_support.js"></script> +<style> +div.box { + margin: 10px; + padding: 50px; + float: left; +} +</style> +<h1>Verifies that pointerup/down are fired correctly for corresponding mouse events</h1> +<div id="lightgreen" class="box" style="background-color:lightgreen"> + <div id="green" class="box" style="background-color:green"> + </div> +</div> + +<div id="console"></div> + +<script> +var eventsReceived = []; +function init() { + var eventList = ["mousedown", "mouseup", "pointerdown", "pointerup"]; + + ["green", "lightgreen"].forEach(function(id) { + var targetDiv = document.getElementById(id); + + eventList.forEach(function(eventName) { + targetDiv.addEventListener(eventName, function(event) { + eventsReceived.push(`${event.type}@${id}`); + }); + }); + }); +} + +function performActions() { + var rect = document.getElementById("green").getBoundingClientRect(); + var x1 = Math.ceil(rect.left + 5); + var y1 = Math.ceil(rect.top + 5); + + var rect = document.getElementById("lightgreen").getBoundingClientRect(); + var x2 = Math.ceil(rect.left + 5); + var y2 = Math.ceil(rect.top + 5); + + return new test_driver.Actions() + .pointerMove(x1, y1) + .pointerDown() + .pointerUp() + .pointerDown() + + .pointerMove(x2, y2) + .pointerUp() + .pointerDown() + + .pointerMove(x1, y1) + .pointerUp() + .send() + .then(()=>resolveWhen(()=>eventsExpected.length === eventsReceived.length)); +} +var eventsExpected = ["pointerdown@green", "pointerdown@lightgreen", + "mousedown@green", "mousedown@lightgreen", + "pointerup@green", "pointerup@lightgreen", + "mouseup@green", "mouseup@lightgreen", + "pointerdown@green", "pointerdown@lightgreen", + "mousedown@green", "mousedown@lightgreen", + "pointerup@lightgreen", "mouseup@lightgreen", + "pointerdown@lightgreen", "mousedown@lightgreen", + "pointerup@green", "pointerup@lightgreen", + "mouseup@green", "mouseup@lightgreen"]; +function runTests(){ + promise_test((test) => { + return new Promise(async (resolve)=>{ + await performActions(); + test.step(()=>{ + assert_array_equals(eventsExpected, eventsReceived); + }); + resolve(); + }); + }, "pointerup/down events are fired correctly for corresponding mouse events"); +} + +init(); +runTests(); +</script> diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html b/tests/wpt/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html index 6ce0f3e59a0..c84961b6c5a 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html @@ -44,6 +44,7 @@ var eventRcvd = false; var isAsync = false; var event_log = []; + var actions_promise; add_completion_callback(end_of_test); function end_of_test() { @@ -105,7 +106,10 @@ assert_false(eventRcvd, "no other events should be received before lostpointercapture." + eventsRcvd_str); assert_equals(event.pointerId, pointerdown_event.pointerId, "pointerID is same for pointerdown and lostpointercapture"); }); - test_pointerEvent.done(); // complete test + // Make sure the test finishes after all the input actions are completed. + actions_promise.then( () => { + test_pointerEvent.done(); + }); } else { if (testStarted && pointerdown_event != null && pointerdown_event.pointerId === event.pointerId) { @@ -128,7 +132,7 @@ } // Inject mouse inputs. - new test_driver.Actions() + actions_promise = new test_driver.Actions() .pointerMove(0, 0, {origin: captureButton}) .pointerDown() .pointerMove(2, 0, {origin: captureButton}) diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over.html b/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over.html index ccc5f37477c..ae348307b4d 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerleave_descendant_over.html @@ -30,6 +30,8 @@ var eventTested = false; var pointerleaveReceived = false; var detected_pointertypes = {}; + var test_pointerleave = async_test("pointerleave shouldn't be received on descendant's pointerover"); + var actions_promise; add_completion_callback(showPointerTypes); @@ -41,9 +43,12 @@ on_event(target1, "pointerdown", function(event) { detected_pointertypes[event.pointerType] = true; - test(function() { - assert_true(!pointerleaveReceived, "pointerleave shouldn't be received on descendant's pointerover") + test_pointerleave.step(function() { + assert_true(!pointerleaveReceived, "pointerleave shouldn't be received on descendant's pointerover"); }, "pointerleave shouldn't be received on descendant's pointerover"); + actions_promise.then( () => { + test_pointerleave.done(); + }); }); on_event(target0, "pointerleave", function (event) { @@ -54,7 +59,7 @@ }); // Inject mouse inputs. - new test_driver.Actions() + actions_promise = new test_driver.Actions() .pointerMove(0, 0, {origin: target0}) .pointerMove(0, 0, {origin: target1}) .pointerDown() diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble.html b/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble.html index b19820ebd3d..0dc88ee318f 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble.html @@ -17,6 +17,7 @@ <script type="text/javascript"> var detected_pointertypes = {}; var test_pointerEvent = async_test("pointerLeave event does not bubble"); // set up test harness + var actions_promise; // showPointerTypes is defined in pointerevent_support.js // Requirements: the callback function will reference the test_pointerEvent object and // will fail unless the async_test is created with the var name "test_pointerEvent". @@ -39,11 +40,14 @@ test_pointerEvent.step(function () { assert_equals(event.target.id, "parent0", "Recieved " + event.type + " in parent for " + event.target.id); }); - test_pointerEvent.done(); // complete test + // Make sure the test finishes after all the input actions are completed. + actions_promise.then( () => { + test_pointerEvent.done(); + }); }); // Inject mouse inputs. - new test_driver.Actions() + actions_promise = new test_driver.Actions() .pointerMove(0, 0, {origin: target0}) .pointerMove(0, 0) .send(); diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerout_received_once.html b/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerout_received_once.html index 07df04fc204..748306e45c8 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerout_received_once.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerevent_pointerout_received_once.html @@ -26,6 +26,7 @@ <script> var pointeroutCounter = 0; var detected_pointertypes = {}; + var actions_promise; setup({ explicit_done: true }); add_completion_callback(showPointerTypes); @@ -47,12 +48,14 @@ test(function() { assert_true(pointeroutCounter == 1, "pointerout received just once") }, "pointerout received just once"); - done(); + actions_promise.then( () => { + done(); + }); }, 5000); }); // Inject mouse inputs. - new test_driver.Actions() + actions_promise = new test_driver.Actions() .pointerMove(0, 0, {origin: target0}) .pointerMove(0, 0) .send(); diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected.html b/tests/wpt/web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected.html index a7cc3e00e23..386de407e9d 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerevent_setpointercapture_disconnected.html @@ -14,6 +14,7 @@ var detected_pointertypes = {}; add_completion_callback(showPointerTypes); var test_setPointerCapture = async_test("setPointerCapture: DOMException InvalidStateError"); + var actions_promise; function run() { var target0 = document.getElementById("target0"); @@ -35,11 +36,14 @@ assert_equals(e.name, "InvalidStateError", "DOMException should be InvalidStateError"); }); } - test_setPointerCapture.done(); + // Make sure the test finishes after all the input actions are completed. + actions_promise.then( () => { + test_setPointerCapture.done(); + }); }); // Inject mouse inputs. - new test_driver.Actions() + actions_promise = new test_driver.Actions() .pointerMove(0, 0, {origin: target0}) .pointerDown() .pointerUp() diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid.html b/tests/wpt/web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid.html index 7d9f948919f..70b4f41b349 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid.html @@ -18,6 +18,7 @@ <script type="text/javascript"> var detected_pointertypes = {}; var test_pointerEvent = async_test("setPointerCapture: DOMException NotFoundError"); // set up test harness + var actions_promise; // showPointerTypes is defined in pointerevent_support.js // Requirements: the callback function will reference the test_pointerEvent object and // will fail unless the async_test is created with the var name "test_pointerEvent". @@ -36,11 +37,14 @@ assert_throws_dom("NotFoundError", function(){ listener.setPointerCapture(INVALID_POINTERID); }, "It should not be possible to capture an invalid pointer id"); }); - test_pointerEvent.done(); // complete test + // Make sure the test finishes after all the input actions are completed. + actions_promise.then( () => { + test_pointerEvent.done(); + }); }); // Inject mouse inputs. - new test_driver.Actions() + actions_promise = new test_driver.Actions() .pointerMove(0, 0, {origin: target0}) .pointerDown() .pointerUp() diff --git a/tests/wpt/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy.html b/tests/wpt/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy.html index 260ef4829cb..eb944460192 100644 --- a/tests/wpt/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy.html +++ b/tests/wpt/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy.html @@ -40,6 +40,9 @@ var expectedPointerId = NaN; var lastScreenX = null; var lastScreenY = null; + var actionsPromiseMouse; + var actionsPromiseTouch; + var actionsPromisePen; function resetTestState() { lastScreenX = null; @@ -111,15 +114,26 @@ lastScreenY = event.screenY; }); on_event(document.querySelector('#box2'), 'pointerup', function(event) { - test_pointerEvent.done(); + // Make sure the test finishes after all the input actions are completed. + if (expectedPointerType == "mouse") { + actionsPromiseTouch = actionsPromiseMouse.then(function(){ + test_pointerEvent.done(); + return injectInput("touch"); + }); + } else if (expectedPointerType == "touch") { + actionsPromisePen = actionsPromiseTouch.then(function(){ + test_pointerEvent.done(); + return injectInput("pen"); + }); + } else { + actionsPromisePen.then( () => { + test_pointerEvent.done(); + }); + } }); - // Inject input - injectInput("mouse").then(function(){ - return injectInput("touch") - }).then(function() { - return injectInput("pen") - }) + // Inject mouse input + actionsPromiseMouse = injectInput("mouse"); } </script> diff --git a/tests/wpt/web-platform-tests/preload/onerror-event.html b/tests/wpt/web-platform-tests/preload/onerror-event.html index 94c8dc772de..fb29956b89a 100644 --- a/tests/wpt/web-platform-tests/preload/onerror-event.html +++ b/tests/wpt/web-platform-tests/preload/onerror-event.html @@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <title>Makes sure that preloaded resources trigger the onerror event</title> +<meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> diff --git a/tests/wpt/web-platform-tests/preload/onload-event.html b/tests/wpt/web-platform-tests/preload/onload-event.html index 8825ffaaa52..2e1e8d39007 100644 --- a/tests/wpt/web-platform-tests/preload/onload-event.html +++ b/tests/wpt/web-platform-tests/preload/onload-event.html @@ -1,5 +1,6 @@ <!DOCTYPE html> <title>Makes sure that preloaded resources trigger the onload event</title> +<meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/preload/resources/preload_helper.js"></script> diff --git a/tests/wpt/web-platform-tests/resources/chromium/generic_sensor_mocks.js b/tests/wpt/web-platform-tests/resources/chromium/generic_sensor_mocks.js index 3ee748c9730..fe2f70be34e 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/generic_sensor_mocks.js +++ b/tests/wpt/web-platform-tests/resources/chromium/generic_sensor_mocks.js @@ -21,6 +21,10 @@ class RingBuffer { return { done: false, value: value }; } + value() { + return this.data_[this.bufferPosition_]; + } + [Symbol.iterator]() { return this; } @@ -112,6 +116,17 @@ var GenericSensorTest = (() => { return this; } + // This is a workaround to accommodate Blink's Device Orientation + // implementation. In general, all tests should use setSensorReading() + // instead. + setSensorReadingImmediately(readingData) { + this.setSensorReading(readingData); + + const reading = this.readingData_.value(); + this.buffer_.set(reading, 2); + this.buffer_[1] = window.performance.now() * 0.001; + } + // Sets flag that forces sensor to fail when addConfiguration is invoked. setStartShouldFail(shouldFail) { this.startShouldFail_ = shouldFail; diff --git a/tests/wpt/web-platform-tests/scroll-animations/current-time.html b/tests/wpt/web-platform-tests/scroll-animations/current-time.html index 18913bb9b04..ad489d02811 100644 --- a/tests/wpt/web-platform-tests/scroll-animations/current-time.html +++ b/tests/wpt/web-platform-tests/scroll-animations/current-time.html @@ -230,6 +230,62 @@ promise_test(async t => { // one edge and use it for all the timelines. const scrollerSize = scroller.scrollHeight - scroller.clientHeight; + // When the endScrollOffset is equal to the maximum scroll offset (and there + // are no fill modes), the endScrollOffset is treated as inclusive. + const inclusiveAutoScrollTimeline = new ScrollTimeline({ + scrollSource: scroller, + timeRange: scrollerSize, + orientation: 'block', + endScrollOffset: 'auto' + }); + const inclusiveLengthScrollTimeline = new ScrollTimeline({ + scrollSource: scroller, + timeRange: scrollerSize, + orientation: 'block', + endScrollOffset: scrollerSize + 'px' + }); + const inclusivePercentageScrollTimeline = new ScrollTimeline({ + scrollSource: scroller, + timeRange: scrollerSize, + orientation: 'block', + endScrollOffset: '100%' + }); + const inclusiveCalcScrollTimeline = new ScrollTimeline({ + scrollSource: scroller, + timeRange: scrollerSize, + orientation: 'block', + endScrollOffset: 'calc(80% + ' + (0.2 * scrollerSize) + 'px)' + }); + + scroller.scrollTop = scrollerSize; + let expectedCurrentTime = calculateCurrentTime( + scroller.scrollTop, 0, scrollerSize, scrollerSize); + + // Wait for new animation frame which allows the timeline to compute new + // current time. + await waitForNextFrame(); + + assert_times_equal( + inclusiveAutoScrollTimeline.currentTime, expectedCurrentTime, + 'Inclusive auto timeline at the endScrollOffset point'); + assert_times_equal( + inclusiveLengthScrollTimeline.currentTime, expectedCurrentTime, + 'Inclusive length-based timeline at the endScrollOffset point'); + assert_times_equal( + inclusivePercentageScrollTimeline.currentTime, expectedCurrentTime, + 'Inclusive percentage-based timeline at the endScrollOffset point'); + assert_times_equal( + inclusiveCalcScrollTimeline.currentTime, expectedCurrentTime, + 'Inclusive calc-based timeline at the endScrollOffset point'); +}, 'currentTime handles endScrollOffset correctly (inclusive cases)'); + +promise_test(async t => { + const scroller = setupScrollTimelineTest(); + // Set the timeRange such that currentTime maps directly to the value + // scrolled. The contents and scroller are square, so it suffices to compute + // one edge and use it for all the timelines. + const scrollerSize = scroller.scrollHeight - scroller.clientHeight; + const lengthScrollTimeline = new ScrollTimeline({ scrollSource: scroller, timeRange: scrollerSize, diff --git a/tests/wpt/web-platform-tests/scroll-animations/scroll-timeline-phases.tentative.html b/tests/wpt/web-platform-tests/scroll-animations/scroll-timeline-phases.tentative.html index ec59a12d91a..46fe06a0bdd 100644 --- a/tests/wpt/web-platform-tests/scroll-animations/scroll-timeline-phases.tentative.html +++ b/tests/wpt/web-platform-tests/scroll-animations/scroll-timeline-phases.tentative.html @@ -63,7 +63,7 @@ const maxScroll = scroller.scrollHeight - scroller.clientHeight; scroller.scrollTop = test_case.scroll_percent * maxScroll; - // Wait for new animation frame which allows the timeline to compute new + // Wait for new animation frame which allows the timeline to compute new // current time. await waitForNextFrame(); @@ -116,7 +116,7 @@ const maxScroll = scroller.scrollHeight - scroller.clientHeight; scroller.scrollTop = test_case.scroll_percent * maxScroll; - // Wait for new animation frame which allows the timeline to compute new + // Wait for new animation frame which allows the timeline to compute new // current time. await waitForNextFrame(); @@ -159,7 +159,7 @@ const maxScroll = scroller.scrollHeight - scroller.clientHeight; scroller.scrollTop = test_case.scroll_percent * maxScroll; - // Wait for new animation frame which allows the timeline to compute new + // Wait for new animation frame which allows the timeline to compute new // current time. await waitForNextFrame(); @@ -175,12 +175,30 @@ promise_test(async t => { const timeline = createScrollTimeline(t); const scroller = timeline.scrollSource; + const maxScroll = scroller.scrollHeight - scroller.clientHeight; + + scroller.scrollTop = maxScroll; + + // Wait for new animation frame which allows the timeline to compute new + // current time. + await waitForNextFrame(); + + // When the endScrollOffset is equal to the maximum scroll offset, the + // endScrollOffset is treated as inclusive so the phase should remain + // active. + assert_equals(timeline.phase, "active"); + }, 'Scroll timeline phase should be active when at scroll maximum and ' + + 'endScrollOffset is equal to maximum scroll offset.'); + + promise_test(async t => { + const timeline = createScrollTimeline(t); + const scroller = timeline.scrollSource; // Timeline should be inactive since layout hasn't updated yet assert_equals(timeline.phase, "inactive"); // Accessing scroller.scrollHeight forces the scroller to update scroller.scrollHeight; - // Wait for new animation frame which allows the timeline to compute new + // Wait for new animation frame which allows the timeline to compute new // current time. await waitForNextFrame(); assert_equals(timeline.phase, "active"); diff --git a/tests/wpt/web-platform-tests/scroll-animations/set-current-time-before-play.html b/tests/wpt/web-platform-tests/scroll-animations/set-current-time-before-play.html new file mode 100644 index 00000000000..194de216d38 --- /dev/null +++ b/tests/wpt/web-platform-tests/scroll-animations/set-current-time-before-play.html @@ -0,0 +1,68 @@ +<html class="reftest-wait"> +<title>Setting current time before play should not timeout</title> +<link rel="help" href="https://drafts.csswg.org/scroll-animations/"> +<meta name="assert" content="Regression test to make sure the ready promise is correctly resolved"> +<link rel="match" href="animation-ref.html"> + +<script src="/web-animations/testcommon.js"></script> +<script src="/common/reftest-wait.js"></script> + +<style> + #box { + width: 100px; + height: 100px; + background-color: green; + } + + #covered { + width: 100px; + height: 100px; + background-color: red; + } + + #scroller { + overflow: auto; + height: 100px; + width: 100px; + will-change: transform; /* force compositing */ + } + + #contents { + height: 1000px; + width: 100%; + } +</style> + +<div id="box"></div> +<div id="covered"></div> +<div id="scroller"> + <div id="contents"></div> +</div> + +<script> + const box = document.getElementById('box'); + const effect = new KeyframeEffect(box, + [ + { transform: 'translateY(0)', opacity: 1}, + { transform: 'translateY(200px)', opacity: 0} + ], { + duration: 1000, + } + ); + + const scroller = document.getElementById('scroller'); + const timeline = new ScrollTimeline({ scrollSource: scroller, timeRange: 1000, orientation: 'block' }); + const animation = new Animation(effect, timeline); + animation.currentTime = 0; + animation.play(); + + animation.ready.then(() => { + // Move the scroller to the halfway point. + const maxScroll = scroller.scrollHeight - scroller.clientHeight; + scroller.scrollTop = 0.5 * maxScroll; + + waitForAnimationFrames(2).then(_ => { + takeScreenshot(); + }); + }); +</script>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/trusted-types/trusted-types-svg-script.tentative.html b/tests/wpt/web-platform-tests/trusted-types/trusted-types-svg-script.tentative.html index 330efc0c0ac..903490e2f3d 100644 --- a/tests/wpt/web-platform-tests/trusted-types/trusted-types-svg-script.tentative.html +++ b/tests/wpt/web-platform-tests/trusted-types/trusted-types-svg-script.tentative.html @@ -20,7 +20,7 @@ } const policy = trustedTypes.createPolicy("policy", { - createScript: x => x, createScriptURL: x => x }); + createScript: x => x, createHTML: x => x, createScriptURL: x => x }); promise_test(t => { assert_throws_js(TypeError, _ => { @@ -30,9 +30,17 @@ }, "Assign String to SVGScriptElement.innerHTML."); promise_test(t => { - document.getElementById("script").innerHTML = policy.createScript("'modified via innerHTML';"); + document.getElementById("script").innerHTML = policy.createHTML("'modified via innerHTML';"); return Promise.resolve(); - }, "Assign TrustedScript to SVGScriptElement.innerHTML."); + }, "Assign TrustedHTML to SVGScriptElement.innerHTML."); + + promise_test(t => { + const elem = document.createElementNS( + "http://www.w3.org/2000/svg", "script"); + elem.innerHTML = policy.createHTML("'modified via innerHTML';"); + document.getElementById("svg").appendChild(elem); + return promise_spv(); + }, "Assign TrustedHTML to SVGScriptElement.innerHTML and execute it."); promise_test(t => { const elem = document.createElementNS( @@ -102,7 +110,7 @@ // but now expect all of them to pass. promise_test(t => { trustedTypes.createPolicy("default", { - createScript: x => x, createScriptURL: x => x }); + createScript: x => x, createHTML: x => x, createScriptURL: x => x }); return Promise.resolve(); }, "Setup default policy"); diff --git a/tests/wpt/web-platform-tests/web-nfc/idlharness.https.window.js b/tests/wpt/web-platform-tests/web-nfc/idlharness.https.window.js index a1eb3386b73..d9ce83e2a1f 100644 --- a/tests/wpt/web-platform-tests/web-nfc/idlharness.https.window.js +++ b/tests/wpt/web-platform-tests/web-nfc/idlharness.https.window.js @@ -1,5 +1,6 @@ // META: script=/resources/WebIDLParser.js // META: script=/resources/idlharness.js +// META: timeout=long 'use strict'; diff --git a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCEncodedAudioFrame-serviceworker-failure.https.html b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCEncodedAudioFrame-serviceworker-failure.https.html index fda89f36dcb..79708e706de 100644 --- a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCEncodedAudioFrame-serviceworker-failure.https.html +++ b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCEncodedAudioFrame-serviceworker-failure.https.html @@ -25,7 +25,7 @@ promise_test(async t => { const writer = streams.writableStream.getWriter(); exchangeIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); const result = await reader.read(); const scope = "resources/blank.html"; diff --git a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCEncodedVideoFrame-serviceworker-failure.https.html b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCEncodedVideoFrame-serviceworker-failure.https.html index 93b9a6a0f36..54b3a54b364 100644 --- a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCEncodedVideoFrame-serviceworker-failure.https.html +++ b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCEncodedVideoFrame-serviceworker-failure.https.html @@ -25,7 +25,7 @@ promise_test(async t => { const senderWriter = senderStreams.writableStream.getWriter(); exchangeIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); const result = await senderReader.read(); const scope = "resources/blank.html"; diff --git a/tests/wpt/web-platform-tests/webrtc-quic/RTCQuicTransport.https.html b/tests/wpt/web-platform-tests/webrtc-quic/RTCQuicTransport.https.html index f9d1411aed3..cdccaac6c86 100644 --- a/tests/wpt/web-platform-tests/webrtc-quic/RTCQuicTransport.https.html +++ b/tests/wpt/web-platform-tests/webrtc-quic/RTCQuicTransport.https.html @@ -56,7 +56,7 @@ promise_test(async t => { t.add_cleanup(() => pc2.close()); pc1.createDataChannel('test'); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); const iceTransport = pc1.sctp.transport.iceTransport; assert_throws_dom('InvalidStateError', diff --git a/tests/wpt/web-platform-tests/webrtc-stats/getStats-remote-candidate-address.html b/tests/wpt/web-platform-tests/webrtc-stats/getStats-remote-candidate-address.html index bf580688591..08e2aec90e6 100644 --- a/tests/wpt/web-platform-tests/webrtc-stats/getStats-remote-candidate-address.html +++ b/tests/wpt/web-platform-tests/webrtc-stats/getStats-remote-candidate-address.html @@ -26,7 +26,7 @@ promise_test(async (test) => { if (event.candidate) remotePc.addIceCandidate(event.candidate); }); - doSignalingHandshake(localPc, remotePc); + exchangeOfferAnswer(localPc, remotePc); const remoteDataChannel = await promiseDataChannel; @@ -63,7 +63,7 @@ promise_test(async (test) => { if (event.candidate) localPc.addIceCandidate(event.candidate); }); - doSignalingHandshake(localPc, remotePc); + exchangeOfferAnswer(localPc, remotePc); const remoteDataChannel = await promiseDataChannel; diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-helper.js b/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-helper.js index 87f7ae13c7e..4316c3804a2 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-helper.js +++ b/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-helper.js @@ -8,7 +8,7 @@ // The following helper functions are called from RTCPeerConnection-helper.js: // getTrackFromUserMedia -// doSignalingHandshake +// exchangeOfferAnswer // Create a RTCDTMFSender using getUserMedia() // Connect the PeerConnection to another PC and wait until it is @@ -26,7 +26,7 @@ function createDtmfSender(pc = new RTCPeerConnection()) { const pc2 = new RTCPeerConnection(); Object.defineProperty(pc, 'otherPc', { value: pc2 }); exchangeIceCandidates(pc, pc2); - return doSignalingHandshake(pc, pc2); + return exchangeOfferAnswer(pc, pc2); }).then(() => { if (!('canInsertDTMF' in dtmfSender)) { return Promise.resolve(); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-ontonechange.https.html b/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-ontonechange.https.html index 1061698d21b..08dd6ada327 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-ontonechange.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCDTMFSender-ontonechange.https.html @@ -264,7 +264,7 @@ // tonechange event, to make sure that tonechange is triggered // then stopped transceiver.direction = 'recvonly'; - await doSignalingHandshake(pc, pc2); + await exchangeOfferAnswer(pc, pc2); assert_equals(transceiver.currentDirection, 'inactive'); remoteDescriptionIsSet = true; diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-close.html b/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-close.html index b8feea332ad..ea7795719c2 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-close.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-close.html @@ -9,23 +9,19 @@ 'use strict'; promise_test(async t => { - let pc1 = new RTCPeerConnection(); + const pc1 = new RTCPeerConnection(); t.add_cleanup(() => pc1.close()); - let [channel1, channel2] = await createDataChannelPair(pc1); - let closeHandler = new Promise(resolve => { - channel2.onclose = event => { - resolve(); - }; - }); + const [channel1, channel2] = await createDataChannelPair(pc1); + const haveClosed = new Promise(r => channel2.onclose = r); let closingSeen = false; channel1.onclosing = t.unreached_func(); - channel2.onclosing = event => { + channel2.onclosing = () => { assert_equals(channel2.readyState, 'closing'); closingSeen = true; - } + }; channel2.addEventListener('error', t.unreached_func()); channel1.close(); - await closeHandler; + await haveClosed; assert_equals(channel2.readyState, 'closed'); assert_true(closingSeen, 'Closing event was seen'); }, 'Close datachannel causes onclosing and onclose to be called'); @@ -33,57 +29,42 @@ promise_test(async t => { promise_test(async t => { // This is the same test as above, but using addEventListener // rather than the "onclose" attribute. - let pc1 = new RTCPeerConnection(); + const pc1 = new RTCPeerConnection(); t.add_cleanup(() => pc1.close()); - let [channel1, channel2] = await createDataChannelPair(pc1); - let closeHandler = new Promise(resolve => { - channel2.addEventListener('close', event => { - resolve(); - }); - }); + const [channel1, channel2] = await createDataChannelPair(pc1); + const haveClosed = new Promise(r => channel2.addEventListener('close', r)); let closingSeen = false; channel1.addEventListener('closing', t.unreached_func()); - channel2.addEventListener('closing', event => { + channel2.addEventListener('closing', () => { assert_equals(channel2.readyState, 'closing'); closingSeen = true; }); channel2.addEventListener('error', t.unreached_func()); channel1.close(); - await closeHandler; + await haveClosed; assert_equals(channel2.readyState, 'closed'); assert_true(closingSeen, 'Closing event was seen'); }, 'Close datachannel causes closing and close event to be called'); promise_test(async t => { - let pc1 = new RTCPeerConnection(); + const pc1 = new RTCPeerConnection(); t.add_cleanup(() => pc1.close()); - let [channel1, channel2] = await createDataChannelPair(pc1); - let events = []; + const [channel1, channel2] = await createDataChannelPair(pc1); + const events = []; let error = null; - let closeHandler = new Promise(resolve => { - channel2.addEventListener('close', event => { - events.push('close'); - resolve(); - }); - }); - let errorHandler = new Promise((resolve, reject) => { - channel2.addEventListener('error', event => { - events.push('error'); - try { - assert_true(event instanceof RTCErrorEvent); - error = event.error; - } catch (e) { - // Prevent test from hanging when an assert in the error handler fails. - reject('Error event wrong: ' + e); - } - resolve(); - }); - }); + channel2.addEventListener('error', t.step_func(event => { + events.push('error'); + assert_true(event instanceof RTCErrorEvent); + error = event.error; + })); + const haveClosed = new Promise(r => channel2.addEventListener('close', () => { + events.push('close'); + r(); + })); pc1.close(); - await errorHandler; - await closeHandler; + await haveClosed; // Error should fire before close. - assert_array_equals(['error', 'close'], events); + assert_array_equals(events, ['error', 'close']); assert_true(error instanceof RTCError); assert_equals(error.name, 'OperationError'); }, 'Close peerconnection causes close event and error to be called'); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-id.html b/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-id.html index 355f6a36eae..10dc5eacb9c 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-id.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCDataChannel-id.html @@ -108,7 +108,7 @@ promise_test(async (t) => { assert_equals(dc2.id, null); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); // We should now have 2 datachannels with different IDs. // At least one of the datachannels should not be 42. // If one has the value 42, it's an accident; if both have, @@ -154,7 +154,7 @@ promise_test(async (t) => { ids.add(dc.id, `Channel ID ${dc.id} should be unique`); } - await doSignalingHandshake(pc1, pc2, { + await exchangeOfferAnswer(pc1, pc2, { offer: (offer) => { // Ensure pc1 takes the server role assert_true(offer.sdp.includes('actpass') || offer.sdp.includes('passive'), @@ -300,7 +300,7 @@ promise_test(async (t) => { dcs.push([dc, i % 2 === 1]); } - await doSignalingHandshake(pc1, pc2, { + await exchangeOfferAnswer(pc1, pc2, { offer: (offer) => { // Ensure pc1 takes the server role assert_true(offer.sdp.includes('actpass') || offer.sdp.includes('passive'), diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-getRemoteCertificates.html b/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-getRemoteCertificates.html index 4735b757412..8af95a84d57 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-getRemoteCertificates.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-getRemoteCertificates.html @@ -9,7 +9,7 @@ // The following helper functions are called from RTCPeerConnection-helper.js: // exchangeIceCandidates - // doSignalingHandshake + // exchangeOfferAnswer /* 5.5. RTCDtlsTransport Interface @@ -45,7 +45,7 @@ pc1.createDataChannel('test'); exchangeIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2) + exchangeOfferAnswer(pc1, pc2) .then(t.step_func(() => { // pc.sctp is set when set*Description(answer) is called const sctpTransport1 = pc1.sctp; diff --git a/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-state.html b/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-state.html index 60a14b151e1..d0230de0e64 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-state.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCDtlsTransport-state.html @@ -8,8 +8,8 @@ 'use strict'; // The following helper functions are called from RTCPeerConnection-helper.js: -// coupleIceCandidates -// doSignalingHandshake +// exchangeIceCandidates +// exchangeOfferAnswer // trackFactories.audio() /* @@ -50,8 +50,8 @@ async function setupConnections(t) { t.add_cleanup(() => pc2.close()); pc1.addTrack(trackFactories.audio()); - const channels = coupleIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + const channels = exchangeIceCandidates(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); return [pc1, pc2]; } diff --git a/tests/wpt/web-platform-tests/webrtc/RTCIceConnectionState-candidate-pair.https.html b/tests/wpt/web-platform-tests/webrtc/RTCIceConnectionState-candidate-pair.https.html index 0752c9aaee6..3b2c253401f 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCIceConnectionState-candidate-pair.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCIceConnectionState-candidate-pair.https.html @@ -18,7 +18,7 @@ promise_test(async t => { const [track] = stream.getTracks(); caller.addTrack(track, stream); exchangeIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); await listenToIceConnected(caller); const report = await caller.getStats(); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-connectionState.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-connectionState.https.html index 9e2f3649aec..5db8272df30 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-connectionState.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-connectionState.https.html @@ -11,7 +11,7 @@ // The following helper functions are called from RTCPeerConnection-helper.js: // exchangeIceCandidates - // doSignalingHandshake + // exchangeOfferAnswer /* 4.3.2. Interface Definition @@ -134,7 +134,7 @@ pc1.addEventListener('connectionstatechange', onConnectionStateChange); exchangeIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); }, 'connection with one data channel should eventually have connected connection state'); async_test(t => { @@ -166,7 +166,7 @@ pc1.addEventListener('connectionstatechange', onConnectionStateChange); exchangeIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); }, 'connection with one data channel should eventually have transports in connected state'); /* @@ -244,7 +244,7 @@ const [track] = stream.getTracks(); caller.addTrack(track, stream); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); assert_equals(caller.iceConnectionState, 'new'); assert_equals(callee.iceConnectionState, 'new'); @@ -264,7 +264,7 @@ const states = []; caller.addEventListener('connectionstatechange', () => states.push(caller.connectionState)); exchangeIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); await listenToConnected(caller); @@ -280,7 +280,7 @@ stream.getTracks().forEach(track => pc1.addTrack(track, stream)); exchangeIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); await listenToIceConnected(pc2); pc2.onconnectionstatechange = t.unreached_func(); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html index 67b40c9ed8e..dd34561fbc6 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html @@ -723,7 +723,7 @@ promise_test(async t => { pc2.getTransceivers()[0].stop(); const dc1Closed = new Promise(r => dc1.onclose = r); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await dc1Closed; }, 'Stopping the bundle-tag when there is a DataChannel in the bundle should kill the DataChannel'); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-getStats.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-getStats.https.html index f3c51d26a36..2ecb21d2f19 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-getStats.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-getStats.https.html @@ -22,7 +22,7 @@ // The following helper function is called from RTCPeerConnection-helper.js // exchangeIceCandidates - // doSignalingHandshake + // exchangeOfferAnswer /* 8.2. getStats @@ -179,8 +179,8 @@ let [track, mediaStream] = await getTrackFromUserMedia('audio'); pc.addTrack(track, mediaStream); - coupleIceCandidates(pc, pc2); - await doSignalingHandshake(pc, pc2); + exchangeIceCandidates(pc, pc2); + await exchangeOfferAnswer(pc, pc2); await listenToIceConnected(pc); const stats = await pc.getStats(track); validateStatsReport(stats); @@ -202,8 +202,8 @@ let [track, mediaStream] = await getTrackFromUserMedia('audio'); pc.addTrack(track, mediaStream); - coupleIceCandidates(pc, pc2); - await doSignalingHandshake(pc, pc2); + exchangeIceCandidates(pc, pc2); + await exchangeOfferAnswer(pc, pc2); // Wait for unmute if the track is not already unmuted. // According to spec, it should be muted when being created, but this // is not what this test is testing, so allow it to be unmuted. @@ -341,8 +341,8 @@ })); - coupleIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeIceCandidates(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); })) .catch(t.step_func(err => { assert_unreached(`test failed with error: ${err}`); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-helper.js b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-helper.js index 679cb85b12a..b7ed92a9cd2 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-helper.js +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-helper.js @@ -190,74 +190,6 @@ function exchangeIceCandidates(pc1, pc2) { doExchange(pc2, pc1); } -// Helper class to exchange ice candidates between -// two local peer connections -class CandidateChannel { - constructor(source, dest, name) { - source.addEventListener('icecandidate', event => { - const { candidate } = event; - if (candidate && this.activated - && this.destination.signalingState !== 'closed') { - this.destination.addIceCandidate(candidate); - } else if (candidate) { - this.queue.push(candidate); - } - }); - dest.addEventListener('signalingstatechange', event => { - if (this.destination.signalingState == 'stable' && !this.activated) { - this.activate(); - } - }); - this.name = name; - this.destination = dest; - this.activated = false; - this.queue = []; - } - activate() { - this.activated = true; - for (const candidate of this.queue) { - this.destination.addIceCandidate(candidate); - } - } -} - -// Alternate function to exchange ICE candidates between two -// PeerConnections. Unlike exchangeIceCandidates, it will function -// correctly if candidates are added before descriptions are set. -function coupleIceCandidates(pc1, pc2) { - const ch1 = new CandidateChannel(pc1, pc2, 'forward'); - const ch2 = new CandidateChannel(pc2, pc1, 'back'); - return [ch1, ch2]; -} - -// Helper function for doing one round of offer/answer exchange -// between two local peer connections. -// Calls setRemoteDescription(offer/answer) before -// setLocalDescription(offer/answer) to ensure the remote description -// is set and candidates can be added before the local peer connection -// starts generating candidates and ICE checks. -async function doSignalingHandshake(localPc, remotePc, options={}) { - let offer = await localPc.createOffer(); - // Modify offer if callback has been provided - if (options.modifyOffer) { - offer = await options.modifyOffer(offer); - } - - // Apply offer. - await remotePc.setRemoteDescription(offer); - await localPc.setLocalDescription(offer); - - let answer = await remotePc.createAnswer(); - // Modify answer if callback has been provided - if (options.modifyAnswer) { - answer = await options.modifyAnswer(answer); - } - - // Apply answer. - await localPc.setRemoteDescription(answer); - await remotePc.setLocalDescription(answer); -} - // Returns a promise that resolves when the |transport| gets a // 'statechange' event with the value |state|. // This should work for RTCSctpTransport, RTCDtlsTransport and RTCIceTransport. @@ -376,96 +308,25 @@ function listenForSSRCs(t, receiver) { // It does the heavy lifting of performing signaling handshake, // ICE candidate exchange, and waiting for data channel at two // end points to open. -function createDataChannelPair( - pc1=new RTCPeerConnection(), - pc2=new RTCPeerConnection(), - options={}) -{ - options = Object.assign({}, { - channelLabel: '', - channelOptions: undefined, - doSignaling: true - }, options); - - let channel1Options; - let channel2Options = null; - if (options.channelOptions instanceof Array) { - [channel1Options, channel2Options] = options.channelOptions; - } else { - channel1Options = options.channelOptions; - } - - const channel1 = pc1.createDataChannel(options.channelLabel, channel1Options); - - return new Promise((resolve, reject) => { - let channel2; - let opened1 = false; - let opened2 = false; - - function cleanup() { - channel1.removeEventListener('open', onOpen1); - channel2.removeEventListener('open', onOpen2); - channel1.removeEventListener('error', onError); - channel2.removeEventListener('error', onError); - } - - function onBothOpened() { - cleanup(); - resolve([channel1, channel2]); +async function createDataChannelPair( + pc1 = new RTCPeerConnection(), + pc2 = new RTCPeerConnection()) { + const pair = [pc1, pc2].map(pc => + pc.createDataChannel('', {negotiated: true, id: 0})); + const bothOpen = Promise.all(pair.map(dc => new Promise((r, e) => { + dc.onopen = r; + dc.onerror = ({error}) => e(error); + }))); + try { + exchangeIceCandidates(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); + await bothOpen; + return pair; + } finally { + for (const dc of pair) { + dc.onopen = dc.onerror = null; } - - function onError(...args) { - cleanup(); - reject(...args); - } - - function onOpen1() { - opened1 = true; - if (opened2) { - onBothOpened(); - } - } - - function onOpen2() { - opened2 = true; - if (opened1) { - onBothOpened(); - } - } - - function onDataChannelPairFound() { - channel2.addEventListener('error', onError, { once: true }); - const { readyState } = channel2; - - if (readyState === 'open') { - onOpen2(); - } else if (readyState === 'connecting') { - channel2.addEventListener('open', onOpen2, { once: true }); - } else { - onError(new Error(`Unexpected ready state ${readyState}`)); - } - } - - function onDataChannel(event) { - channel2 = event.channel; - onDataChannelPairFound(); - } - - channel1.addEventListener('open', onOpen1, { once: true }); - channel1.addEventListener('error', onError, { once: true }); - - if (channel2Options !== null) { - channel2 = pc2.createDataChannel(options.channelLabel, channel2Options); - onDataChannelPairFound(); - } else { - pc2.addEventListener('datachannel', onDataChannel); - } - - if (options.doSignaling) { - exchangeIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2, options); - } - }); + } } // Wait for RTP and RTCP stats to arrive @@ -708,20 +569,19 @@ function getUserMediaTracksAndStreams(count, type = 'audio') { // Performs an offer exchange caller -> callee. async function exchangeOffer(caller, callee) { - const offer = await caller.createOffer(); - await caller.setLocalDescription(offer); - return callee.setRemoteDescription(offer); + await caller.setLocalDescription(await caller.createOffer()); + await callee.setRemoteDescription(caller.localDescription); } // Performs an answer exchange caller -> callee. async function exchangeAnswer(caller, callee) { - const answer = await callee.createAnswer(); - await callee.setLocalDescription(answer); - return caller.setRemoteDescription(answer); + await callee.setLocalDescription(await callee.createAnswer()); + await caller.setRemoteDescription(callee.localDescription); } async function exchangeOfferAnswer(caller, callee) { await exchangeOffer(caller, callee); - return exchangeAnswer(caller, callee); + await exchangeAnswer(caller, callee); } + // The returned promise is resolved with caller's ontrack event. async function exchangeAnswerAndListenToOntrack(t, caller, callee) { const ontrackPromise = addEventListenerPromise(t, caller, 'track'); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState-disconnected.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState-disconnected.https.html index ff405f32851..af55a0c0035 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState-disconnected.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState-disconnected.https.html @@ -18,7 +18,7 @@ const [track] = stream.getTracks(); caller.addTrack(track, stream); exchangeIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); await listenToIceConnected(caller); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html index a5bf7536ff5..851ce884d6e 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html @@ -11,10 +11,6 @@ // Test is based on the following editor draft: // https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html - // The following helper functions are called from RTCPeerConnection-helper.js: - // coupleIceCandidates - // doSignalingHandshake - /* 4.3.2. Interface Definition interface RTCPeerConnection : EventTarget { @@ -133,8 +129,8 @@ pc1.addEventListener('iceconnectionstatechange', onIceConnectionStateChange); - coupleIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeIceCandidates(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); }, 'connection with one data channel should eventually have connected or ' + 'completed connection state'); @@ -179,8 +175,8 @@ async_test(t => { pc1.addEventListener('iceconnectionstatechange', onIceConnectionStateChange); - coupleIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeIceCandidates(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); }, 'connection with one data channel should eventually ' + 'have connected connection state'); @@ -194,8 +190,8 @@ async_test(t => { t.add_cleanup(() => stream.getTracks().forEach(track => track.stop())); stream.getTracks().forEach(track => pc1.addTrack(track, stream)); - coupleIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeIceCandidates(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); await listenToIceConnected(pc1); }, 'connection with audio track should eventually ' + 'have connected connection state'); @@ -210,8 +206,8 @@ async_test(t => { t.add_cleanup(() => stream.getTracks().forEach(track => track.stop())); stream.getTracks().forEach(track => pc1.addTrack(track, stream)); - coupleIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeIceCandidates(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); await listenToIceConnected(pc1); }, 'connection with audio and video tracks should eventually ' + 'have connected connection state'); @@ -227,8 +223,8 @@ async_test(t => { t.add_cleanup(() => stream.getTracks().forEach(track => track.stop())); const [track] = stream.getTracks(); callee.addTrack(track, stream); - coupleIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + exchangeIceCandidates(caller, callee); + await exchangeOfferAnswer(caller, callee); assert_equals(caller.getTransceivers().length, 1); const [transceiver] = caller.getTransceivers(); @@ -294,7 +290,7 @@ for (let bundle_policy of ['balanced', 'max-bundle', 'max-compat']) { caller.createDataChannel('datachannel'); const callee = new RTCPeerConnection(); t.add_cleanup(() => callee.close()); - coupleIceCandidates(caller, callee); + exchangeIceCandidates(caller, callee); const offer = await caller.createOffer(); await caller.setLocalDescription(offer); const [caller_transceiver1, caller_transceiver2] = caller.getTransceivers(); @@ -388,7 +384,7 @@ promise_test(async t => { stream.getTracks().forEach(track => pc1.addTrack(track, stream)); exchangeIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); await listenToIceConnected(pc2); pc2.oniceconnectionstatechange = t.unreached_func(); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html index 0940738a86f..3f0128bb843 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html @@ -11,7 +11,7 @@ // https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html // The following helper functions are called from RTCPeerConnection-helper.js: - // doSignalingHandshake + // exchangeOfferAnswer // exchangeIceCandidates // generateAudioReceiveOnlyOffer @@ -265,7 +265,7 @@ pc2.addEventListener('icegatheringstatechange', onIceGatheringStateChange); exchangeIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); }, 'connection with one data channel should eventually have connected connection state'); /* diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html index fd8c74b9184..e48d133f464 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html @@ -221,7 +221,7 @@ promise_test(async t => { t.add_cleanup(() => track.stop()); } exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); const stats = await getAllStats(t, pc1); // The focus of this test is not API correctness, but rather to provide an diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ondatachannel.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ondatachannel.html index 8ba98414cbb..46fe8e0f51b 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ondatachannel.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-ondatachannel.html @@ -12,7 +12,7 @@ // The following helper functions are called from RTCPeerConnection-helper.js: // exchangeIceCandidates -// doSignalingHandshake +// exchangeOfferAnswer // createDataChannelPair /* @@ -69,7 +69,7 @@ promise_test(async (t) => { pc1.createDataChannel('fire-me!'); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await resolver; }, 'Data channel event should fire when new data channel is announced to the remote peer'); @@ -101,7 +101,7 @@ promise_test(async (t) => { }); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await resolver; }, 'Should be able to send data in a datachannel event handler'); @@ -137,7 +137,7 @@ promise_test(async (t) => { pc1.createDataChannel('fire-me!'); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await resolver; }, 'Open event should not be raised when closing the channel in the datachannel event'); @@ -168,7 +168,7 @@ promise_test(async (t) => { pc1.createDataChannel('fire-me!'); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await resolver; }, 'Open event should be raised when closing the channel in the datachannel event after ' + @@ -207,7 +207,7 @@ promise_test(async (t) => { }); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await resolver; }, 'Open event should not be raised when sending and immediately closing the channel in the ' + @@ -282,7 +282,7 @@ promise_test(async (t) => { }); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await resolver; }, 'In-band negotiated channel created on remote peer should match the same configuration as local ' + @@ -321,7 +321,7 @@ promise_test(async (t) => { }); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await resolver; }, 'In-band negotiated channel created on remote peer should match the same (default) ' + @@ -352,7 +352,7 @@ promise_test(async (t) => { }); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); // Wait a bit to ensure the 'datachannel' event does NOT fire t.step_timeout(() => resolver.resolve(), 500); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-onsignalingstatechanged.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-onsignalingstatechanged.https.html index 217ea7a1bc8..0c8405770b6 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-onsignalingstatechanged.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-onsignalingstatechanged.https.html @@ -44,7 +44,7 @@ promise_test(async t => { stream.getTracks().forEach(track => pc1.addTrack(track, stream)); exchangeIceCandidates(pc1, pc2); - doSignalingHandshake(pc1, pc2); + exchangeOfferAnswer(pc1, pc2); await listenToIceConnected(pc2); pc2.onsignalingstatechange = t.unreached_func(); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-restartIce.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-restartIce.https.html index c069736fa0b..8f8c661a41d 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-restartIce.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-restartIce.https.html @@ -16,14 +16,14 @@ function getLines(sdp, startsWith) { const getUfrags = ({sdp}) => getLines(sdp, "a=ice-ufrag:"); const getPwds = ({sdp}) => getLines(sdp, "a=ice-pwd:"); -async function doSignalingHandshakeEndOnFirst(pc1, pc2) { +async function exchangeOfferAnswerEndOnFirst(pc1, pc2) { await pc1.setLocalDescription(await pc1.createOffer()); await pc2.setRemoteDescription(pc1.localDescription); await pc2.setLocalDescription(await pc2.createAnswer()); await pc1.setRemoteDescription(pc2.localDescription); // End on pc1. No race } -async function doSignalingHandshakeEndOnSecond(pc1, pc2) { +async function exchangeOfferAnswerEndOnSecond(pc1, pc2) { await pc1.setLocalDescription(await pc1.createOffer()); await pc2.setRemoteDescription(pc1.localDescription); await pc1.setRemoteDescription(await pc2.createAnswer()); @@ -74,7 +74,7 @@ promise_test(async t => { pc1.addTransceiver("audio"); await new Promise(r => pc1.onnegotiationneeded = r); pc1.restartIce(); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); await assertNoNegotiationNeeded(t, pc1); }, "restartIce() has no effect on initial negotiation"); @@ -86,7 +86,7 @@ promise_test(async t => { pc1.addTransceiver("audio"); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); pc1.restartIce(); await new Promise(r => pc1.onnegotiationneeded = r); }, "restartIce() fires negotiationneeded after initial negotiation"); @@ -98,24 +98,24 @@ promise_test(async t => { t.add_cleanup(() => pc2.close()); pc1.addTransceiver("audio"); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [oldUfrag1] = getUfrags(pc1.localDescription); const [oldUfrag2] = getUfrags(pc2.localDescription); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); assert_ufrags_equals(getUfrags(pc1.localDescription)[0], oldUfrag1, "control 1"); assert_ufrags_equals(getUfrags(pc2.localDescription)[0], oldUfrag2, "control 2"); pc1.restartIce(); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [newUfrag1] = getUfrags(pc1.localDescription); const [newUfrag2] = getUfrags(pc2.localDescription); assert_ufrags_not_equals(newUfrag1, oldUfrag1, "ufrag 1 changed"); assert_ufrags_not_equals(newUfrag1, oldUfrag2, "ufrag 2 changed"); await assertNoNegotiationNeeded(t, pc1); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); assert_ufrags_equals(getUfrags(pc1.localDescription)[0], newUfrag1, "Unchanged 1"); assert_ufrags_equals(getUfrags(pc2.localDescription)[0], newUfrag2, "Unchanged 2"); }, "restartIce() causes fresh ufrags"); @@ -128,7 +128,7 @@ promise_test(async t => { pc1.addTransceiver("audio"); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [oldUfrag1] = getUfrags(pc1.localDescription); const [oldUfrag2] = getUfrags(pc2.localDescription); @@ -151,7 +151,7 @@ promise_test(async t => { assert_ufrags_equals(getUfrags(pc1.localDescription)[0], oldUfrag1, "Unchanged 1"); assert_ufrags_equals(getUfrags(pc2.localDescription)[0], oldUfrag2, "Unchanged 2"); await negotiationNeededPromise; - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [newUfrag1] = getUfrags(pc1.localDescription); const [newUfrag2] = getUfrags(pc2.localDescription); assert_ufrags_not_equals(newUfrag1, oldUfrag1, "ufrag 1 changed"); @@ -177,7 +177,7 @@ promise_test(async t => { const [oldUfrag1] = getUfrags(pc1.localDescription); const [oldUfrag2] = getUfrags(pc2.localDescription); await negotiationNeededPromise; - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [newUfrag1] = getUfrags(pc1.localDescription); const [newUfrag2] = getUfrags(pc2.localDescription); assert_ufrags_not_equals(newUfrag1, oldUfrag1, "ufrag 1 changed"); @@ -193,7 +193,7 @@ promise_test(async t => { pc1.addTransceiver("audio"); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [oldUfrag1] = getUfrags(pc1.localDescription); const [oldUfrag2] = getUfrags(pc2.localDescription); @@ -208,7 +208,7 @@ promise_test(async t => { assert_ufrags_equals(getUfrags(pc1.localDescription)[0], oldUfrag1, "Unchanged 1"); assert_ufrags_equals(getUfrags(pc2.localDescription)[0], oldUfrag2, "Unchanged 2"); await negotiationNeededPromise; - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [newUfrag1] = getUfrags(pc1.localDescription); const [newUfrag2] = getUfrags(pc2.localDescription); assert_ufrags_not_equals(newUfrag1, oldUfrag1, "ufrag 1 changed"); @@ -239,7 +239,7 @@ promise_test(async t => { pc1.addTransceiver("audio"); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [oldUfrag1] = getUfrags(pc1.localDescription); const [oldUfrag2] = getUfrags(pc2.localDescription); @@ -248,11 +248,11 @@ promise_test(async t => { await new Promise(r => pc1.onnegotiationneeded = r); const negotiationNeededPromise = new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnSecond(pc2, pc1); + await exchangeOfferAnswerEndOnSecond(pc2, pc1); assert_ufrags_equals(getUfrags(pc1.localDescription)[0], oldUfrag1, "nothing yet 1"); assert_ufrags_equals(getUfrags(pc2.localDescription)[0], oldUfrag2, "nothing yet 2"); await negotiationNeededPromise; - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [newUfrag1] = getUfrags(pc1.localDescription); const [newUfrag2] = getUfrags(pc2.localDescription); assert_ufrags_not_equals(newUfrag1, oldUfrag1, "ufrag 1 changed"); @@ -268,7 +268,7 @@ promise_test(async t => { pc1.addTransceiver("audio"); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [oldUfrag1] = getUfrags(pc1.localDescription); const [oldUfrag2] = getUfrags(pc2.localDescription); @@ -276,14 +276,14 @@ promise_test(async t => { pc1.restartIce(); pc2.restartIce(); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnSecond(pc2, pc1); + await exchangeOfferAnswerEndOnSecond(pc2, pc1); const [newUfrag1] = getUfrags(pc1.localDescription); const [newUfrag2] = getUfrags(pc2.localDescription); assert_ufrags_not_equals(newUfrag1, oldUfrag1, "ufrag 1 changed"); assert_ufrags_not_equals(newUfrag1, oldUfrag2, "ufrag 2 changed"); await assertNoNegotiationNeeded(t, pc1); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); assert_ufrags_equals(getUfrags(pc1.localDescription)[0], newUfrag1, "Unchanged 1"); assert_ufrags_equals(getUfrags(pc2.localDescription)[0], newUfrag2, "Unchanged 2"); await assertNoNegotiationNeeded(t, pc1); @@ -297,7 +297,7 @@ promise_test(async t => { pc1.addTransceiver("audio"); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [oldUfrag1] = getUfrags(pc1.localDescription); const [oldUfrag2] = getUfrags(pc2.localDescription); @@ -323,7 +323,7 @@ promise_test(async t => { pc1.addTransceiver("audio"); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [oldUfrag1] = getUfrags(pc1.localDescription); const [oldUfrag2] = getUfrags(pc2.localDescription); @@ -335,7 +335,7 @@ promise_test(async t => { new Promise(r => pc1.onnegotiationneeded = r); await pc1.setLocalDescription({type: "rollback"}); await negotiationNeededPromise; - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const [newUfrag1] = getUfrags(pc1.localDescription); const [newUfrag2] = getUfrags(pc2.localDescription); assert_ufrags_not_equals(newUfrag1, oldUfrag1, "ufrag 1 changed"); @@ -352,7 +352,7 @@ promise_test(async t => { pc1.addTransceiver("audio"); pc1.addTransceiver("video"); await new Promise(r => pc1.onnegotiationneeded = r); - await doSignalingHandshakeEndOnFirst(pc1, pc2); + await exchangeOfferAnswerEndOnFirst(pc1, pc2); const oldUfrags1 = getUfrags(pc1.localDescription); const oldUfrags2 = getUfrags(pc2.localDescription); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html index b56982fda4b..83c9f1916cd 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html @@ -11,7 +11,7 @@ 'use strict'; // The following helper functions are called from RTCPeerConnection-helper.js: - // doSignalingHandshake + // exchangeOfferAnswer // getUserMediaTracksAndStreams // waitForRtpAndRtcpStats @@ -208,7 +208,7 @@ t.add_cleanup(() => tracks.forEach(track => track.stop())); sendingTrack = tracks[0]; caller.addTrack(sendingTrack, streams[0]); - return doSignalingHandshake(caller, callee); + return exchangeOfferAnswer(caller, callee); })) .then(t.step_func(() => { return caller.getStats(); @@ -242,7 +242,7 @@ .then(t.step_func(([tracks, streams]) => { t.add_cleanup(() => tracks.forEach(track => track.stop())); caller.addTrack(tracks[0], streams[0]); - return doSignalingHandshake(caller, callee); + return exchangeOfferAnswer(caller, callee); })) .then(t.step_func(() => { return callee.getStats(); @@ -345,7 +345,7 @@ sendingTrack1 = tracks[0]; sendingTrack2 = tracks[1]; sender = caller.addTrack(sendingTrack1, streams[0]); - return doSignalingHandshake(caller, callee); + return exchangeOfferAnswer(caller, callee); })) .then(t.step_func(() => { return sender.replaceTrack(sendingTrack2); @@ -382,7 +382,7 @@ sendingTrack1 = tracks[0]; sendingTrack2 = tracks[1]; sender = caller.addTrack(sendingTrack1, streams[0]); - return doSignalingHandshake(caller, callee); + return exchangeOfferAnswer(caller, callee); })) .then(t.step_func(() => { return sender.replaceTrack(sendingTrack2); @@ -416,7 +416,7 @@ let sender = caller.addTrack(tracks[0], streams[0]); callee.addTrack(tracks[1], streams[1]); exchangeIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); await listenToConnected(caller); let receiver = caller.getReceivers()[0]; @@ -465,7 +465,7 @@ let sender = caller.addTrack(tracks[0], streams[0]); callee.addTrack(tracks[1], streams[1]); exchangeIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); await listenToConnected(caller); let receiver = caller.getReceivers()[0]; @@ -514,7 +514,7 @@ let sender = caller.addTrack(tracks[0], streams[0]); callee.addTrack(tracks[1], streams[1]); exchangeIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); await listenToIceConnected(caller); // Wait until RTCP has arrived so that it can not arrive between @@ -546,7 +546,7 @@ let sender = caller.addTrack(tracks[0], streams[0]); callee.addTrack(tracks[1], streams[1]); exchangeIceCandidates(caller, callee); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); await listenToIceConnected(caller); let receiver = caller.getReceivers()[0]; diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getStats.https.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getStats.https.html index 7cd59839370..20448d8a6c1 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getStats.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getStats.https.html @@ -14,7 +14,7 @@ // https://w3c.github.io/webrtc-stats/archives/20170614/webrtc-stats.html // The following helper functions are called from RTCPeerConnection-helper.js: - // doSignalingHandshake + // exchangeOfferAnswer // The following helper function is called from RTCStats-helper.js // validateStatsReport @@ -57,7 +57,7 @@ const { receiver } = caller.addTransceiver('audio'); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); const statsReport = await receiver.getStats(); validateStatsReport(statsReport); assert_stats_report_has_stats(statsReport, ['inbound-rtp']); @@ -73,7 +73,7 @@ const [track] = stream.getTracks(); caller.addTrack(track, stream); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); const receiver = callee.getReceivers()[0]; const statsReport = await receiver.getStats(); validateStatsReport(statsReport); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-getStats.https.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-getStats.https.html index 1af8285f4c3..70c63323232 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-getStats.https.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpSender-getStats.https.html @@ -14,7 +14,7 @@ // webrtc-stats 20171122 // The following helper functions are called from RTCPeerConnection-helper.js: - // doSignalingHandshake + // exchangeOfferAnswer // The following helper function is called from RTCStats-helper.js // validateStatsReport @@ -50,7 +50,7 @@ const [track] = stream.getTracks(); const { sender } = caller.addTransceiver(track); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); const statsReport = await sender.getStats(); validateStatsReport(statsReport); assert_stats_report_has_stats(statsReport, ['outbound-rtp']); @@ -66,7 +66,7 @@ const [track] = stream.getTracks(); const sender = caller.addTrack(track, stream); - await doSignalingHandshake(caller, callee); + await exchangeOfferAnswer(caller, callee); const statsReport = await sender.getStats(); validateStatsReport(statsReport); assert_stats_report_has_stats(statsReport, ['outbound-rtp']); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-maxChannels.html b/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-maxChannels.html index e62404a21a0..b173e11c74a 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-maxChannels.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCSctpTransport-maxChannels.html @@ -28,7 +28,7 @@ promise_test(async (t) => { t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); - coupleIceCandidates(pc1, pc2); + exchangeIceCandidates(pc1, pc2); pc1.createDataChannel(''); const offer = await pc1.createOffer(); await pc1.setLocalDescription(offer); diff --git a/tests/wpt/web-platform-tests/webrtc/protocol/candidate-exchange.https.html b/tests/wpt/web-platform-tests/webrtc/protocol/candidate-exchange.https.html index b741de55ecc..532bc4d0d13 100644 --- a/tests/wpt/web-platform-tests/webrtc/protocol/candidate-exchange.https.html +++ b/tests/wpt/web-platform-tests/webrtc/protocol/candidate-exchange.https.html @@ -50,8 +50,8 @@ promise_test(async t => { pc1.createDataChannel('datachannel'); pc1IceStates = new IceStateLogger(pc1); pc2IceStates = new IceStateLogger(pc1); - coupleIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + exchangeIceCandidates(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); // Note - it's been claimed that this state sometimes jumps straight // to "completed". If so, this test should be flaky. await waitForIceStateChange(pc1, ['connected']); @@ -73,7 +73,7 @@ promise_test(async t => { } // Candidates from PC2 are not delivered to pc1, so pc1 will use // peer-reflexive candidates. - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); const waiter = iceGatheringCompleteWaiter(pc1); await waiter; for (const candidate of candidates) { @@ -104,7 +104,7 @@ promise_test(async t => { } // Candidates from pc1 are not delivered to pc2. so pc2 will use // peer-reflexive candidates. - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); const waiter = iceGatheringCompleteWaiter(pc2); await waiter; for (const candidate of candidates) { @@ -144,7 +144,7 @@ promise_test(async t => { } // Candidates from |pc1| are not delivered to |pc2|. |pc2| will use // peer-reflexive candidates. - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await Promise.all([waitForIceStateChange(pc1, ['connected', 'completed']), waitForIceStateChange(pc2, ['connected', 'completed'])]); const candidate_pair = pc2.sctp.transport.iceTransport.getSelectedCandidatePair(); diff --git a/tests/wpt/web-platform-tests/webrtc/protocol/crypto-suite.https.html b/tests/wpt/web-platform-tests/webrtc/protocol/crypto-suite.https.html index f4e69e40dfd..f1b60561a14 100644 --- a/tests/wpt/web-platform-tests/webrtc/protocol/crypto-suite.https.html +++ b/tests/wpt/web-platform-tests/webrtc/protocol/crypto-suite.https.html @@ -57,8 +57,8 @@ for (const name of Object.keys(acceptableValues)) { t.add_cleanup(() => pc1.close()); t.add_cleanup(() => pc2.close()); pc1.createDataChannel('foo'); - coupleIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + exchangeIceCandidates(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await waitForState(pc1.sctp.transport, 'connected'); const statsReport = await pc1.getStats(); const transportStats = findStatsFromReport(statsReport, @@ -73,8 +73,8 @@ for (const name of Object.keys(acceptableValues)) { t.add_cleanup(() => pc2.close()); const transceiver = pc1.addTransceiver('video'); - coupleIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + exchangeIceCandidates(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await waitForState(transceiver.sender.transport, 'connected'); const statsReport = await pc1.getStats(); const transportStats = findStatsFromReport(statsReport, diff --git a/tests/wpt/web-platform-tests/webrtc/protocol/dtls-fingerprint-validation.html b/tests/wpt/web-platform-tests/webrtc/protocol/dtls-fingerprint-validation.html index 9a397785eec..0ddc8488ae5 100644 --- a/tests/wpt/web-platform-tests/webrtc/protocol/dtls-fingerprint-validation.html +++ b/tests/wpt/web-platform-tests/webrtc/protocol/dtls-fingerprint-validation.html @@ -16,7 +16,7 @@ promise_test(async t => { t.add_cleanup(() => pc1.close()); t.add_cleanup(() => pc2.close()); pc1.createDataChannel('datachannel'); - coupleIceCandidates(pc1, pc2); + exchangeIceCandidates(pc1, pc2); const offer = await pc1.createOffer(); await pc2.setRemoteDescription(offer); await pc1.setLocalDescription(offer); diff --git a/tests/wpt/web-platform-tests/webrtc/protocol/ice-state.https.html b/tests/wpt/web-platform-tests/webrtc/protocol/ice-state.https.html index 4a6b4333e16..becce59509b 100644 --- a/tests/wpt/web-platform-tests/webrtc/protocol/ice-state.https.html +++ b/tests/wpt/web-platform-tests/webrtc/protocol/ice-state.https.html @@ -93,7 +93,7 @@ promise_test(async t => { let [track, streams] = await getTrackFromUserMedia('video'); const sender = pc1.addTrack(track); exchangeIceCandidates(pc1, pc2); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); await waitForIceStateChange(pc1, ['connected', 'completed']); }, 'PC should enter connected (or completed) state when candidates are sent'); diff --git a/tests/wpt/web-platform-tests/webrtc/protocol/video-codecs.https.html b/tests/wpt/web-platform-tests/webrtc/protocol/video-codecs.https.html index e728effbeb9..a4905ae441a 100644 --- a/tests/wpt/web-platform-tests/webrtc/protocol/video-codecs.https.html +++ b/tests/wpt/web-platform-tests/webrtc/protocol/video-codecs.https.html @@ -50,7 +50,7 @@ async function negotiateParameters() { const pc2 = new RTCPeerConnection(); let [track, streams] = await getTrackFromUserMedia('video'); const sender = pc1.addTrack(track); - await doSignalingHandshake(pc1, pc2); + await exchangeOfferAnswer(pc1, pc2); return sender.getParameters(); } diff --git a/tests/wpt/web-platform-tests/webrtc/tools/.eslintrc.js b/tests/wpt/web-platform-tests/webrtc/tools/.eslintrc.js index 09f9c60c983..321f8e9a254 100644 --- a/tests/wpt/web-platform-tests/webrtc/tools/.eslintrc.js +++ b/tests/wpt/web-platform-tests/webrtc/tools/.eslintrc.js @@ -99,7 +99,7 @@ module.exports = { test_state_change_event: true, test_never_resolve: true, exchangeIceCandidates: true, - doSignalingHandshake: true, + exchangeOfferAnswer: true, createDataChannelPair: true, awaitMessage: true, blobToArrayBuffer: true, |