diff --git a/tests/wpt/meta-legacy-layout/css/css-fonts/font-size-adjust-ic-height.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-fonts/font-size-adjust-ic-height.tentative.html.ini new file mode 100644 index 00000000000..69a38ce77ee --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-fonts/font-size-adjust-ic-height.tentative.html.ini @@ -0,0 +1,2 @@ +[font-size-adjust-ic-height.tentative.html] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-fonts/parsing/font-palette-values-invalid.html.ini b/tests/wpt/meta-legacy-layout/css/css-fonts/parsing/font-palette-values-invalid.html.ini index 46c1576d853..86c285fb78a 100644 --- a/tests/wpt/meta-legacy-layout/css/css-fonts/parsing/font-palette-values-invalid.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-fonts/parsing/font-palette-values-invalid.html.ini @@ -70,3 +70,6 @@ [CSS Fonts Module Level 4: parsing @font-palette-values 24] expected: FAIL + + [CSS Fonts Module Level 4: parsing @font-palette-values 25] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-fonts/parsing/font-palette-values-valid.html.ini b/tests/wpt/meta-legacy-layout/css/css-fonts/parsing/font-palette-values-valid.html.ini index a20fe78d693..70e99209ae0 100644 --- a/tests/wpt/meta-legacy-layout/css/css-fonts/parsing/font-palette-values-valid.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-fonts/parsing/font-palette-values-valid.html.ini @@ -100,3 +100,6 @@ [CSS Fonts Module Level 4: parsing @font-palette-values 33] expected: FAIL + + [CSS Fonts Module Level 4: parsing @font-palette-values 34] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-overflow/parsing/scroll-markers-computed.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-overflow/parsing/scroll-markers-computed.tentative.html.ini new file mode 100644 index 00000000000..ab5459ae54c --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-overflow/parsing/scroll-markers-computed.tentative.html.ini @@ -0,0 +1,27 @@ +[scroll-markers-computed.tentative.html] + [Property scroll-markers value 'initial'] + expected: FAIL + + [Property scroll-markers value 'inherit'] + expected: FAIL + + [Property scroll-markers value 'unset'] + expected: FAIL + + [Property scroll-markers value 'revert'] + expected: FAIL + + [Property scroll-markers value 'none'] + expected: FAIL + + [Property scroll-markers value 'before'] + expected: FAIL + + [Property scroll-markers value 'after'] + expected: FAIL + + [The scroll-markers property shows up in CSSStyleDeclaration enumeration] + expected: FAIL + + [The scroll-markers property shows up in CSSStyleDeclaration.cssText] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-overflow/parsing/scroll-markers-valid.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-overflow/parsing/scroll-markers-valid.tentative.html.ini new file mode 100644 index 00000000000..157a05bffbe --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-overflow/parsing/scroll-markers-valid.tentative.html.ini @@ -0,0 +1,21 @@ +[scroll-markers-valid.tentative.html] + [e.style['scroll-markers'\] = "initial" should set the property value] + expected: FAIL + + [e.style['scroll-markers'\] = "inherit" should set the property value] + expected: FAIL + + [e.style['scroll-markers'\] = "unset" should set the property value] + expected: FAIL + + [e.style['scroll-markers'\] = "revert" should set the property value] + expected: FAIL + + [e.style['scroll-markers'\] = "none" should set the property value] + expected: FAIL + + [e.style['scroll-markers'\] = "before" should set the property value] + expected: FAIL + + [e.style['scroll-markers'\] = "after" should set the property value] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-pseudo/highlight-cascade/highlight-pseudos-computed-001.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-pseudo/highlight-cascade/highlight-pseudos-computed-001.tentative.html.ini new file mode 100644 index 00000000000..b963cc0fd2c --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-pseudo/highlight-cascade/highlight-pseudos-computed-001.tentative.html.ini @@ -0,0 +1,24 @@ +[highlight-pseudos-computed-001.tentative.html] + [getComputedStyle() for ::search-text] + expected: FAIL + + [getComputedStyle() for ::search-text: should return an empty CSSStyleDeclaration] + expected: FAIL + + [getComputedStyle() for ::search-text) should return an empty CSSStyleDeclaration] + expected: FAIL + + [getComputedStyle() for ::search-text( should return an empty CSSStyleDeclaration] + expected: FAIL + + [getComputedStyle() for ::search-text(foo) should return an empty CSSStyleDeclaration] + expected: FAIL + + [getComputedStyle() for ::search-text() should return an empty CSSStyleDeclaration] + expected: FAIL + + [getComputedStyle() for :::search-text should return an empty CSSStyleDeclaration] + expected: FAIL + + [getComputedStyle() for ::search-text. should return an empty CSSStyleDeclaration] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-pseudo/parsing/highlight-pseudos-001.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-pseudo/parsing/highlight-pseudos-001.tentative.html.ini new file mode 100644 index 00000000000..b416a0e6b82 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-pseudo/parsing/highlight-pseudos-001.tentative.html.ini @@ -0,0 +1,36 @@ +[highlight-pseudos-001.tentative.html] + ["::search-text" should be a valid selector] + expected: FAIL + + [".a::search-text" should be a valid selector] + expected: FAIL + + ["div ::search-text" should be a valid selector] + expected: FAIL + + ["::part(my-part)::search-text" should be a valid selector] + expected: FAIL + + ["::search-text:current" should be a valid selector] + expected: FAIL + + [".a::search-text:current" should be a valid selector] + expected: FAIL + + ["div ::search-text:current" should be a valid selector] + expected: FAIL + + ["::part(my-part)::search-text:current" should be a valid selector] + expected: FAIL + + ["::search-text:not(:current)" should be a valid selector] + expected: FAIL + + [".a::search-text:not(:current)" should be a valid selector] + expected: FAIL + + ["div ::search-text:not(:current)" should be a valid selector] + expected: FAIL + + ["::part(my-part)::search-text:not(:current)" should be a valid selector] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/custom-elements/CustomElementRegistry-getName.tentative.html.ini b/tests/wpt/meta-legacy-layout/custom-elements/CustomElementRegistry-getName.html.ini similarity index 90% rename from tests/wpt/meta-legacy-layout/custom-elements/CustomElementRegistry-getName.tentative.html.ini rename to tests/wpt/meta-legacy-layout/custom-elements/CustomElementRegistry-getName.html.ini index b380ba38d07..cb43c25dc3a 100644 --- a/tests/wpt/meta-legacy-layout/custom-elements/CustomElementRegistry-getName.tentative.html.ini +++ b/tests/wpt/meta-legacy-layout/custom-elements/CustomElementRegistry-getName.html.ini @@ -1,4 +1,4 @@ -[CustomElementRegistry-getName.tentative.html] +[CustomElementRegistry-getName.html] [customElements.getName must return null when the registry does not contain an entry with the given constructor] expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/custom-elements/ElementInternals-accessibility.html.ini b/tests/wpt/meta-legacy-layout/custom-elements/ElementInternals-accessibility.html.ini index d52ce3402d6..a5092997b2b 100644 --- a/tests/wpt/meta-legacy-layout/custom-elements/ElementInternals-accessibility.html.ini +++ b/tests/wpt/meta-legacy-layout/custom-elements/ElementInternals-accessibility.html.ini @@ -136,3 +136,21 @@ [ariaValueText is defined in ElementInternals] expected: FAIL + + [ariaBrailleLabel is defined in ElementInternals] + expected: FAIL + + [ariaBrailleRoleDescription is defined in ElementInternals] + expected: FAIL + + [ariaColIndexText is defined in ElementInternals] + expected: FAIL + + [ariaDescription is defined in ElementInternals] + expected: FAIL + + [ariaRowIndexText is defined in ElementInternals] + expected: FAIL + + [ariaSetSize is defined in ElementInternals] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/dom/nodes/moveBefore/tentative/iframe-document-preserve.window.js.ini b/tests/wpt/meta-legacy-layout/dom/nodes/moveBefore/tentative/iframe-document-preserve.window.js.ini new file mode 100644 index 00000000000..4c8fde3f8de --- /dev/null +++ b/tests/wpt/meta-legacy-layout/dom/nodes/moveBefore/tentative/iframe-document-preserve.window.js.ini @@ -0,0 +1,21 @@ +[iframe-document-preserve.window.html] + [moveBefore(): about:blank iframe's document is preserved] + expected: FAIL + + [moveBefore(): simple same-origin document is preserved] + expected: FAIL + + [moveBefore(): cross-origin iframe is preserved: remove new parent] + expected: FAIL + + [moveBefore(): cross-origin iframe is preserved: remove self] + expected: FAIL + + [moveBefore(): cross-origin iframe is preserved: remove self via replaceChildren()] + expected: FAIL + + [moveBefore(): cross-origin iframe is preserved: remove self via innerHTML] + expected: FAIL + + [window.frames ordering does not change due to moveBefore()] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/fetch/api/abort/general.any.js.ini b/tests/wpt/meta-legacy-layout/fetch/api/abort/general.any.js.ini index 1e20bc6ed8e..692b5406faf 100644 --- a/tests/wpt/meta-legacy-layout/fetch/api/abort/general.any.js.ini +++ b/tests/wpt/meta-legacy-layout/fetch/api/abort/general.any.js.ini @@ -159,6 +159,12 @@ [Signal on request object should also have abort reason] expected: FAIL + [response.bytes() rejects if already aborted] + expected: FAIL + + [Fetch aborted & connection closed when aborted after calling response.bytes()] + expected: FAIL + [general.any.html] type: testharness @@ -321,6 +327,12 @@ [Signal on request object should also have abort reason] expected: FAIL + [response.bytes() rejects if already aborted] + expected: FAIL + + [Fetch aborted & connection closed when aborted after calling response.bytes()] + expected: FAIL + [general.any.serviceworker.html] expected: ERROR diff --git a/tests/wpt/meta-legacy-layout/fetch/api/abort/serviceworker-intercepted.https.html.ini b/tests/wpt/meta-legacy-layout/fetch/api/abort/serviceworker-intercepted.https.html.ini index 93165008ded..4bb2c7fb0a4 100644 --- a/tests/wpt/meta-legacy-layout/fetch/api/abort/serviceworker-intercepted.https.html.ini +++ b/tests/wpt/meta-legacy-layout/fetch/api/abort/serviceworker-intercepted.https.html.ini @@ -35,3 +35,6 @@ [Abort reason serialization happens on abort] expected: FAIL + + [response.bytes() rejects if already aborted] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/fetch/api/basic/request-headers.any.js.ini b/tests/wpt/meta-legacy-layout/fetch/api/basic/request-headers.any.js.ini index 3d0a15c7101..d8111b4e0ce 100644 --- a/tests/wpt/meta-legacy-layout/fetch/api/basic/request-headers.any.js.ini +++ b/tests/wpt/meta-legacy-layout/fetch/api/basic/request-headers.any.js.ini @@ -1,16 +1,20 @@ [request-headers.any.html] type: testharness - expected: ERROR [Fetch with POST with FormData body] expected: FAIL + [Fetch with POST with Float16Array body] + expected: FAIL + [request-headers.any.worker.html] type: testharness - expected: ERROR [Fetch with POST with FormData body] expected: FAIL + [Fetch with POST with Float16Array body] + expected: FAIL + [request-headers.any.serviceworker.html] expected: ERROR diff --git a/tests/wpt/meta-legacy-layout/fetch/api/request/request-consume.any.js.ini b/tests/wpt/meta-legacy-layout/fetch/api/request/request-consume.any.js.ini index 24f7b9a642f..317f7a2ff85 100644 --- a/tests/wpt/meta-legacy-layout/fetch/api/request/request-consume.any.js.ini +++ b/tests/wpt/meta-legacy-layout/fetch/api/request/request-consume.any.js.ini @@ -2,11 +2,53 @@ [Consume FormData request's body as FormData] expected: FAIL + [Consume String request's body as bytes] + expected: FAIL + + [Consume ArrayBuffer request's body as bytes] + expected: FAIL + + [Consume Uint8Array request's body as bytes] + expected: FAIL + + [Consume Int8Array request's body as bytes] + expected: FAIL + + [Consume Float32Array request's body as bytes] + expected: FAIL + + [Consume DataView request's body as bytes] + expected: FAIL + + [Consume blob response's body as bytes] + expected: FAIL + [request-consume.any.worker.html] [Consume FormData request's body as FormData] expected: FAIL + [Consume String request's body as bytes] + expected: FAIL + + [Consume ArrayBuffer request's body as bytes] + expected: FAIL + + [Consume Uint8Array request's body as bytes] + expected: FAIL + + [Consume Int8Array request's body as bytes] + expected: FAIL + + [Consume Float32Array request's body as bytes] + expected: FAIL + + [Consume DataView request's body as bytes] + expected: FAIL + + [Consume blob response's body as bytes] + expected: FAIL + [request-consume.any.serviceworker.html] expected: ERROR diff --git a/tests/wpt/meta-legacy-layout/fetch/api/response/response-blob-realm.any.js.ini b/tests/wpt/meta-legacy-layout/fetch/api/response/response-blob-realm.any.js.ini new file mode 100644 index 00000000000..cbb16c4bb93 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/fetch/api/response/response-blob-realm.any.js.ini @@ -0,0 +1,8 @@ +[response-blob-realm.any.html] + [realm of the Uint8Array from Response bytes()] + expected: FAIL + + +[response-blob-realm.any.worker.html] + [realm of the Uint8Array from Response bytes()] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/fetch/api/response/response-error-from-stream.any.js.ini b/tests/wpt/meta-legacy-layout/fetch/api/response/response-error-from-stream.any.js.ini index 93d1ce9c644..33616a01abc 100644 --- a/tests/wpt/meta-legacy-layout/fetch/api/response/response-error-from-stream.any.js.ini +++ b/tests/wpt/meta-legacy-layout/fetch/api/response/response-error-from-stream.any.js.ini @@ -1,9 +1,21 @@ [response-error-from-stream.any.worker.html] + [ReadableStream start() Error propagates to Response.bytes() Promise] + expected: FAIL + + [ReadableStream pull() Error propagates to Response.bytes() Promise] + expected: FAIL + [response-error-from-stream.any.serviceworker.html] expected: ERROR [response-error-from-stream.any.html] + [ReadableStream start() Error propagates to Response.bytes() Promise] + expected: FAIL + + [ReadableStream pull() Error propagates to Response.bytes() Promise] + expected: FAIL + [response-error-from-stream.any.sharedworker.html] expected: ERROR diff --git a/tests/wpt/meta-legacy-layout/fetch/api/response/response-stream-bad-chunk.any.js.ini b/tests/wpt/meta-legacy-layout/fetch/api/response/response-stream-bad-chunk.any.js.ini index 9fdc5a9bd14..8c2a6f1d9ba 100644 --- a/tests/wpt/meta-legacy-layout/fetch/api/response/response-stream-bad-chunk.any.js.ini +++ b/tests/wpt/meta-legacy-layout/fetch/api/response/response-stream-bad-chunk.any.js.ini @@ -1,4 +1,7 @@ [response-stream-bad-chunk.any.html] + [ReadableStream with non-Uint8Array chunk passed to Response.bytes() causes TypeError] + expected: FAIL + [response-stream-bad-chunk.any.sharedworker.html] expected: ERROR @@ -7,3 +10,5 @@ expected: ERROR [response-stream-bad-chunk.any.worker.html] + [ReadableStream with non-Uint8Array chunk passed to Response.bytes() causes TypeError] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html.ini b/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html.ini index 149bcb4ff8c..b8fd22e2b81 100644 --- a/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html.ini +++ b/tests/wpt/meta-legacy-layout/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html.ini @@ -10,3 +10,6 @@ [load & pageshow events do not fire on contentWindow of + + + diff --git a/tests/wpt/tests/css/css-view-transitions/sibling-frames-transition.html b/tests/wpt/tests/css/css-view-transitions/sibling-frames-transition.html new file mode 100644 index 00000000000..b4814c5ca81 --- /dev/null +++ b/tests/wpt/tests/css/css-view-transitions/sibling-frames-transition.html @@ -0,0 +1,101 @@ + + +View transitions: main frame and sibling frames transition at the same time + + + + + + + + + + diff --git a/tests/wpt/tests/custom-elements/CustomElementRegistry-getName.tentative.html b/tests/wpt/tests/custom-elements/CustomElementRegistry-getName.html similarity index 100% rename from tests/wpt/tests/custom-elements/CustomElementRegistry-getName.tentative.html rename to tests/wpt/tests/custom-elements/CustomElementRegistry-getName.html diff --git a/tests/wpt/tests/custom-elements/ElementInternals-accessibility.html b/tests/wpt/tests/custom-elements/ElementInternals-accessibility.html index 8a8f1c9aea0..3b04f257dea 100644 --- a/tests/wpt/tests/custom-elements/ElementInternals-accessibility.html +++ b/tests/wpt/tests/custom-elements/ElementInternals-accessibility.html @@ -28,14 +28,18 @@ const properties = [ "ariaActiveDescendantElement", "ariaAtomic", "ariaAutoComplete", + "ariaBrailleLabel", + "ariaBrailleRoleDescription", "ariaBusy", "ariaChecked", "ariaColCount", "ariaColIndex", + "ariaColIndexText", "ariaColSpan", "ariaControlsElements", "ariaCurrent", "ariaDescribedByElements", + "ariaDescription", "ariaDetailsElements", "ariaDisabled", "ariaErrorMessageElements", @@ -63,8 +67,10 @@ const properties = [ "ariaRoleDescription", "ariaRowCount", "ariaRowIndex", + "ariaRowIndexText", "ariaRowSpan", "ariaSelected", + "ariaSetSize", "ariaSort", "ariaValueMax", "ariaValueMin", diff --git a/tests/wpt/tests/custom-elements/HTMLElement-constructor-customized-bulitins.html b/tests/wpt/tests/custom-elements/HTMLElement-constructor-customized-builtins.html similarity index 100% rename from tests/wpt/tests/custom-elements/HTMLElement-constructor-customized-bulitins.html rename to tests/wpt/tests/custom-elements/HTMLElement-constructor-customized-builtins.html diff --git a/tests/wpt/tests/custom-elements/reactions/AriaMixin-string-attributes.html b/tests/wpt/tests/custom-elements/reactions/AriaMixin-string-attributes.html index f71bf2daa9b..c058084ab28 100644 --- a/tests/wpt/tests/custom-elements/reactions/AriaMixin-string-attributes.html +++ b/tests/wpt/tests/custom-elements/reactions/AriaMixin-string-attributes.html @@ -15,34 +15,32 @@
diff --git a/tests/wpt/tests/docs/reviewing-tests/reverting.md b/tests/wpt/tests/docs/reviewing-tests/reverting.md index d374f0558e3..a45b86a969c 100644 --- a/tests/wpt/tests/docs/reviewing-tests/reverting.md +++ b/tests/wpt/tests/docs/reviewing-tests/reverting.md @@ -3,7 +3,7 @@ Testing is imperfect and from time to time changes are merged into master which break things for users of web-platform-tests. Such breakage can include: - * Failures in Travis or Taskcluster runs for this repository, either on the + * Failures in CI runs for this repository, either on the master branch or on pull requests following the breaking change. * Breakage in browser engine repositories which import and run diff --git a/tests/wpt/tests/document-policy/echo-policy-nested.html.headers b/tests/wpt/tests/document-policy/echo-policy-nested.html.headers index 419a3c3dd16..ab319fc4ceb 100644 --- a/tests/wpt/tests/document-policy/echo-policy-nested.html.headers +++ b/tests/wpt/tests/document-policy/echo-policy-nested.html.headers @@ -1 +1 @@ -Document-Policy: lossless-images-max-bpp=0.0 +Document-Policy: sync-xhr=?0 diff --git a/tests/wpt/tests/document-policy/experimental-features/document-write.tentative.html b/tests/wpt/tests/document-policy/experimental-features/document-write.tentative.html deleted file mode 100644 index 551703c6f56..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/document-write.tentative.html +++ /dev/null @@ -1,91 +0,0 @@ - -'document-write' tests - - - - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-tentative.html b/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-tentative.html deleted file mode 100644 index fd32ace78e2..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-tentative.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 'layout-animations' Policy : Correct behavior for affected and unaffected properties when - feature is disabled. - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers b/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers deleted file mode 100644 index 745da550ee5..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy: layout-animations=?0 diff --git a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html b/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html deleted file mode 100644 index ee7c295156f..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - 'layout-animations' Policy : violation reports from javascript - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers b/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers deleted file mode 100644 index 745da550ee5..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy: layout-animations=?0 diff --git a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html b/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html deleted file mode 100644 index cd9210cc138..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - 'layout-animations' Policy : violation reports from CSS keyframes - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers b/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers deleted file mode 100644 index 745da550ee5..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy: layout-animations=?0 diff --git a/tests/wpt/tests/document-policy/experimental-features/layout-animations-enabled-tentative.html b/tests/wpt/tests/document-policy/experimental-features/layout-animations-enabled-tentative.html deleted file mode 100644 index 19e405496ee..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/layout-animations-enabled-tentative.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - 'layout-animations' Policy : Correct behavior for affected and unaffected properties when - feature is enabled. - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/animation-property-height.js b/tests/wpt/tests/document-policy/experimental-features/resources/animation-property-height.js deleted file mode 100644 index 79316cb488f..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/animation-property-height.js +++ /dev/null @@ -1,3 +0,0 @@ -let div = document.createElement("div"); -document.body.appendChild(div); -div.animate([{"height": "0px"}, {"height": "100px"}]); diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/async-script.js b/tests/wpt/tests/document-policy/experimental-features/resources/async-script.js deleted file mode 100644 index 3c0ee6d0234..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/async-script.js +++ /dev/null @@ -1 +0,0 @@ -window.didExecuteExternalAsyncScript = true; diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/defer-script.js b/tests/wpt/tests/document-policy/experimental-features/resources/defer-script.js deleted file mode 100644 index 8d248ee0d01..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/defer-script.js +++ /dev/null @@ -1 +0,0 @@ -window.didExecuteExternalDeferredScript = true; diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/document-policy-image.html b/tests/wpt/tests/document-policy/experimental-features/resources/document-policy-image.html deleted file mode 100644 index 4e5b919bd11..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/document-policy-image.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/document-write-allowed.html b/tests/wpt/tests/document-policy/experimental-features/resources/document-write-allowed.html deleted file mode 100644 index 633fa85e6ac..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/document-write-allowed.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/document-write-disallowed.html b/tests/wpt/tests/document-policy/experimental-features/resources/document-write-disallowed.html deleted file mode 100644 index 633fa85e6ac..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/document-write-disallowed.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/document-write-disallowed.html.headers b/tests/wpt/tests/document-policy/experimental-features/resources/document-write-disallowed.html.headers deleted file mode 100644 index 32846f724a4..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/document-write-disallowed.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy: document-write=?0 \ No newline at end of file diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/image.jpg b/tests/wpt/tests/document-policy/experimental-features/resources/image.jpg deleted file mode 100644 index 430f5c514a8..00000000000 Binary files a/tests/wpt/tests/document-policy/experimental-features/resources/image.jpg and /dev/null differ diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/image.png b/tests/wpt/tests/document-policy/experimental-features/resources/image.png deleted file mode 100644 index 556fa727040..00000000000 Binary files a/tests/wpt/tests/document-policy/experimental-features/resources/image.png and /dev/null differ diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/image.svg b/tests/wpt/tests/document-policy/experimental-features/resources/image.svg deleted file mode 100644 index 73ca820915b..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/image.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/parser-blocking-script.js b/tests/wpt/tests/document-policy/experimental-features/resources/parser-blocking-script.js deleted file mode 100644 index c61efee8a0a..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/parser-blocking-script.js +++ /dev/null @@ -1 +0,0 @@ -window.didExecuteExternalParsingBlockingScript = true; diff --git a/tests/wpt/tests/document-policy/experimental-features/resources/sync-script-test.js b/tests/wpt/tests/document-policy/experimental-features/resources/sync-script-test.js deleted file mode 100644 index 65c1b21e6e8..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/resources/sync-script-test.js +++ /dev/null @@ -1,9 +0,0 @@ -var t = async_test('Test behavior of sync-script feature policy for different script types'); - -window.onload = t.step_func(function() { - assert_equals(undefined, window.didExecuteInlineParsingBlockingScript, 'inline parser blocking script should be blocked'); - assert_equals(undefined, window.didExecuteExternalParsingBlockingScript, 'external parser blocking script should be blocked'); - assert_true(window.didExecuteExternalAsyncScript, 'external async script should not be blocked'); - assert_true(window.didExecuteExternalDeferredScript, 'external defer script should not be blocked'); - t.done(); -}); diff --git a/tests/wpt/tests/document-policy/experimental-features/sync-script.tentative.https.sub.html b/tests/wpt/tests/document-policy/experimental-features/sync-script.tentative.https.sub.html deleted file mode 100644 index a199a4ed3f9..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/sync-script.tentative.https.sub.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/sync-script.tentative.https.sub.html.headers b/tests/wpt/tests/document-policy/experimental-features/sync-script.tentative.https.sub.html.headers deleted file mode 100644 index cfe200c27b0..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/sync-script.tentative.https.sub.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy: sync-script=?0 diff --git a/tests/wpt/tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html b/tests/wpt/tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html deleted file mode 100644 index 4e5fbc65558..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - diff --git a/tests/wpt/tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers b/tests/wpt/tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers deleted file mode 100644 index cf59933e8dd..00000000000 --- a/tests/wpt/tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy: unsized-media=?0 diff --git a/tests/wpt/tests/document-policy/reporting/document-write-report-only-tentative.html b/tests/wpt/tests/document-policy/reporting/document-write-report-only-tentative.html deleted file mode 100644 index bf17807f4a9..00000000000 --- a/tests/wpt/tests/document-policy/reporting/document-write-report-only-tentative.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - diff --git a/tests/wpt/tests/document-policy/reporting/document-write-report-only-tentative.html.headers b/tests/wpt/tests/document-policy/reporting/document-write-report-only-tentative.html.headers deleted file mode 100644 index 924dac8e87b..00000000000 --- a/tests/wpt/tests/document-policy/reporting/document-write-report-only-tentative.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy-Report-Only: document-write=?0 diff --git a/tests/wpt/tests/document-policy/reporting/document-write-reporting-tentative.html b/tests/wpt/tests/document-policy/reporting/document-write-reporting-tentative.html deleted file mode 100644 index 65a584ce19d..00000000000 --- a/tests/wpt/tests/document-policy/reporting/document-write-reporting-tentative.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - diff --git a/tests/wpt/tests/document-policy/reporting/document-write-reporting-tentative.html.headers b/tests/wpt/tests/document-policy/reporting/document-write-reporting-tentative.html.headers deleted file mode 100644 index 6d05e969b50..00000000000 --- a/tests/wpt/tests/document-policy/reporting/document-write-reporting-tentative.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy: document-write=?0 diff --git a/tests/wpt/tests/document-policy/reporting/image.jpg b/tests/wpt/tests/document-policy/reporting/image.jpg deleted file mode 100644 index c059b96d97f..00000000000 Binary files a/tests/wpt/tests/document-policy/reporting/image.jpg and /dev/null differ diff --git a/tests/wpt/tests/document-policy/reporting/resources/sync-script.js b/tests/wpt/tests/document-policy/reporting/resources/sync-script.js deleted file mode 100644 index 10d582cb0ec..00000000000 --- a/tests/wpt/tests/document-policy/reporting/resources/sync-script.js +++ /dev/null @@ -1,20 +0,0 @@ -// This is deliberately split from sync-script-reporting.html so that it will -// not be blocked by policy, and can actuall be executed. - -var t = async_test("Sync-script Report Format"); - -var check_report_format = (reports, observer) => { - let report = reports[0]; - assert_equals(report.type, "document-policy-violation"); - assert_equals(report.url, document.location.href); - assert_equals(report.body.featureId, "sync-script"); - assert_equals(report.body.sourceFile, null); - assert_equals(report.body.lineNumber, null); - assert_equals(report.body.columnNumber, null); - assert_equals(report.body.disposition, "enforce"); - check_report_json(report); -}; - -new ReportingObserver(t.step_func_done(check_report_format), - { types: ['document-policy-violation'], - buffered: true}).observe(); diff --git a/tests/wpt/tests/document-policy/reporting/sync-script-reporting.html b/tests/wpt/tests/document-policy/reporting/sync-script-reporting.html deleted file mode 100644 index 45e1b8fc3c8..00000000000 --- a/tests/wpt/tests/document-policy/reporting/sync-script-reporting.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - diff --git a/tests/wpt/tests/document-policy/reporting/sync-script-reporting.html.headers b/tests/wpt/tests/document-policy/reporting/sync-script-reporting.html.headers deleted file mode 100644 index cfe200c27b0..00000000000 --- a/tests/wpt/tests/document-policy/reporting/sync-script-reporting.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy: sync-script=?0 diff --git a/tests/wpt/tests/document-policy/reporting/unsized-media-reporting-tentative.html b/tests/wpt/tests/document-policy/reporting/unsized-media-reporting-tentative.html deleted file mode 100644 index 47a36436464..00000000000 --- a/tests/wpt/tests/document-policy/reporting/unsized-media-reporting-tentative.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/tests/wpt/tests/document-policy/reporting/unsized-media-reporting-tentative.html.headers b/tests/wpt/tests/document-policy/reporting/unsized-media-reporting-tentative.html.headers deleted file mode 100644 index cf59933e8dd..00000000000 --- a/tests/wpt/tests/document-policy/reporting/unsized-media-reporting-tentative.html.headers +++ /dev/null @@ -1 +0,0 @@ -Document-Policy: unsized-media=?0 diff --git a/tests/wpt/tests/document-policy/required-policy/document-policy.html b/tests/wpt/tests/document-policy/required-policy/document-policy.html index aaa8d692001..4beaf3f2164 100644 --- a/tests/wpt/tests/document-policy/required-policy/document-policy.html +++ b/tests/wpt/tests/document-policy/required-policy/document-policy.html @@ -33,9 +33,9 @@ async_test(t => { async_test(t => { var iframe = document.createElement('iframe'); iframe.src = "/document-policy/echo-policy.py?id=2"; - iframe.policy = "font-display-late-swap=?0"; + iframe.policy = "force-load-at-top"; callbacks["2"] = t.step_func_done(result => { - assert_equals(result, "font-display-late-swap=?0"); + assert_equals(result, "force-load-at-top"); }); document.body.appendChild(iframe); }, "Child frame can have a required policy independent of the parent document."); @@ -43,9 +43,9 @@ async_test(t => { async_test(t => { var iframe = document.createElement('iframe'); iframe.src = "/document-policy/echo-policy.py?id=3"; - iframe.policy = "lossless-images-max-bpp=4"; + iframe.policy = "sync-xhr"; callbacks["3"] = t.step_func_done(result => { - assert_equals(result, "lossless-images-max-bpp=4.0"); + assert_equals(result, "sync-xhr"); }); document.body.appendChild(iframe); }, "Child frame can have a required policy which is less strict than the parent document's policy."); diff --git a/tests/wpt/tests/document-policy/required-policy/document-policy.html.headers b/tests/wpt/tests/document-policy/required-policy/document-policy.html.headers index 20629ac15f5..ab319fc4ceb 100644 --- a/tests/wpt/tests/document-policy/required-policy/document-policy.html.headers +++ b/tests/wpt/tests/document-policy/required-policy/document-policy.html.headers @@ -1 +1 @@ -Document-Policy: lossless-images-max-bpp=1.1 +Document-Policy: sync-xhr=?0 diff --git a/tests/wpt/tests/document-policy/required-policy/no-document-policy.html b/tests/wpt/tests/document-policy/required-policy/no-document-policy.html index 8a3624440f3..00a721e8150 100644 --- a/tests/wpt/tests/document-policy/required-policy/no-document-policy.html +++ b/tests/wpt/tests/document-policy/required-policy/no-document-policy.html @@ -33,9 +33,9 @@ async_test(t => { async_test(t => { var iframe = document.createElement('iframe'); iframe.src = "/document-policy/echo-policy.py?id=2"; - iframe.policy = "font-display-late-swap=?0"; + iframe.policy = "force-load-at-top=?0"; callbacks["2"] = t.step_func_done(result => { - assert_equals(result, "font-display-late-swap=?0"); + assert_equals(result, "force-load-at-top=?0"); }); document.body.appendChild(iframe); }, "Child frame can have an explicit required policy."); diff --git a/tests/wpt/tests/document-policy/required-policy/required-document-policy-nested.html b/tests/wpt/tests/document-policy/required-policy/required-document-policy-nested.html index 33de2533a25..0adba51c199 100644 --- a/tests/wpt/tests/document-policy/required-policy/required-document-policy-nested.html +++ b/tests/wpt/tests/document-policy/required-policy/required-document-policy-nested.html @@ -34,29 +34,29 @@ async_test(t => { // Frame tree should be: // Top: -// + diff --git a/tests/wpt/tests/infrastructure/reftest/reftest_wait_0-print.html b/tests/wpt/tests/infrastructure/reftest/reftest_wait_0-print.html new file mode 100644 index 00000000000..fec62a3cae0 --- /dev/null +++ b/tests/wpt/tests/infrastructure/reftest/reftest_wait_0-print.html @@ -0,0 +1,13 @@ + +Test with reftest-wait + + + + diff --git a/tests/wpt/tests/intersection-observer/transform-animation.html b/tests/wpt/tests/intersection-observer/transform-animation.html new file mode 100644 index 00000000000..f27fac40940 --- /dev/null +++ b/tests/wpt/tests/intersection-observer/transform-animation.html @@ -0,0 +1,38 @@ + + + + + + + +
+ + diff --git a/tests/wpt/tests/lint.ignore b/tests/wpt/tests/lint.ignore index 14e02983f75..9d846b35194 100644 --- a/tests/wpt/tests/lint.ignore +++ b/tests/wpt/tests/lint.ignore @@ -808,10 +808,12 @@ TESTDRIVER-IN-UNSUPPORTED-TYPE: html/rendering/non-replaced-elements/the-fieldse TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-select-element/stylable-select/native-popup-with-datalist-ref.html TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-select-element/stylable-select/native-popup-with-datalist.tentative.html TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-select-element/stylable-select/select-appearance-custom-button-no-datalist.tentative.html +TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-select-element/stylable-select/select-appearance-dark-mode.tentative.html TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-select-element/stylable-select/select-appearance-no-button-custom-datalist.tentative.html TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-select-element/stylable-select/select-appearance-no-button-no-datalist.tentative.html TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-select-element/stylable-select/select-appearance-writing-mode-vertical-lr.tentative.html TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-select-element/stylable-select/select-appearance-writing-mode-vertical-rl.tentative.html +TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-select-element/stylable-select/select-appearance-dark-mode.tentative.html TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/forms/the-selectlist-element/selectlist-option-arbitrary-content-displayed.tentative.html TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/popovers/popover-dialog-crash.html TESTDRIVER-IN-UNSUPPORTED-TYPE: html/semantics/popovers/popover-hint-crash.tentative.html diff --git a/tests/wpt/tests/notifications/getnotifications-sw.js b/tests/wpt/tests/notifications/getnotifications-sw.js index 331913b9935..ad2c11c6d5f 100644 --- a/tests/wpt/tests/notifications/getnotifications-sw.js +++ b/tests/wpt/tests/notifications/getnotifications-sw.js @@ -1,4 +1,5 @@ importScripts("/resources/testharness.js"); +importScripts("resources/helpers.js"); async function cleanup() { for (const n of await registration.getNotifications()) { @@ -29,14 +30,9 @@ async function postAll(data) { } } -async function untilActivate() { - if (registration.active) { - return; - } - return new Promise(resolve => { - addEventListener("activate", resolve, { once: true }); - }); -} +promise_setup(async () => { + await untilActivate(); +}); promise_test(async t => { await new Promise((resolve, reject) => { @@ -45,7 +41,7 @@ promise_test(async t => { resolve(); } }); - untilActivate().then(() => postAll("notification-create")).catch(reject); + postAll("notification-create").catch(reject); }); await test_notification(t, "Created from window"); }, "Get notification created from window"); diff --git a/tests/wpt/tests/notifications/instance-checks.js b/tests/wpt/tests/notifications/instance-checks.js new file mode 100644 index 00000000000..31ff0b87093 --- /dev/null +++ b/tests/wpt/tests/notifications/instance-checks.js @@ -0,0 +1,40 @@ +const notification_args = [ + "Radio check", + { + dir: "ltr", + lang: "aa", + body: "This is a radio check.", + tag: "radio_check999", + icon: `${location.origin}/icon.png`, + data: fakeCustomData, + } +]; + +// promise_tests because we need to wait for promise_setup +function notification_instance_test(createFn, testTitle) { + let n; + promise_test(async t => { + n = await createFn(t); + }, `${testTitle}: Setup`); + promise_test(async () => { + assert_equals("Radio check", n.title) + }, `${testTitle}: Attribute exists with expected value: title`) + promise_test(async () => { + assert_equals("ltr", n.dir) + }, `${testTitle}: Attribute exists with expected value: dir`) + promise_test(async () => { + assert_equals("aa", n.lang) + }, `${testTitle}: Attribute exists with expected value: lang`) + promise_test(async () => { + assert_equals("This is a radio check.", n.body) + }, `${testTitle}: Attribute exists with expected value: body`) + promise_test(async () => { + assert_equals("radio_check999", n.tag) + }, `${testTitle}: Attribute exists with expected value: tag`) + promise_test(async () => { + assert_equals(`${location.origin}/icon.png`, n.icon) + }, `${testTitle}: Attribute exists with expected value: icon`) + promise_test(async () => { + assert_custom_data(n.data); + }, `${testTitle}: Attribute exists with expected value: data`) +} diff --git a/tests/wpt/tests/notifications/instance-sw.js b/tests/wpt/tests/notifications/instance-sw.js new file mode 100644 index 00000000000..f08b17e15f8 --- /dev/null +++ b/tests/wpt/tests/notifications/instance-sw.js @@ -0,0 +1,34 @@ +importScripts("/resources/testharness.js"); +importScripts("resources/helpers.js"); +importScripts("resources/custom-data.js"); +importScripts("instance-checks.js"); + +promise_setup(async () => { + await untilActivate(); +}); + +notification_instance_test(async t => { + t.add_cleanup(closeAllNotifications); + + await registration.showNotification(...notification_args); + + let notifications = await registration.getNotifications(); + assert_equals(notifications.length, 1, "The list should include one notification"); + + return notifications[0]; +}, "getNotifications()"); + +// Doing this separately because this times out on Blink and GeckoView +notification_instance_test(async t => { + t.add_cleanup(closeAllNotifications); + + await registration.showNotification(...notification_args); + + let notifications = await registration.getNotifications(); + assert_equals(notifications.length, 1, "The list should include one notification"); + + notifications[0].close(); + const ev = await new Promise(resolve => addEventListener("notificationclose", resolve, { once: true })); + + return ev.notification; +}, "notificationclose"); diff --git a/tests/wpt/tests/notifications/instance.https.html b/tests/wpt/tests/notifications/instance.https.html deleted file mode 100644 index 5ccc6cd1e3a..00000000000 --- a/tests/wpt/tests/notifications/instance.https.html +++ /dev/null @@ -1,60 +0,0 @@ - - -Notification instance basic tests - - - - diff --git a/tests/wpt/tests/notifications/instance.https.window.js b/tests/wpt/tests/notifications/instance.https.window.js new file mode 100644 index 00000000000..ba7c103048f --- /dev/null +++ b/tests/wpt/tests/notifications/instance.https.window.js @@ -0,0 +1,18 @@ +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/service-workers/service-worker/resources/test-helpers.sub.js +// META: script=resources/helpers.js +// META: script=resources/custom-data.js +// META: script=instance-checks.js + +promise_setup(async () => { + await trySettingPermission("granted"); +}); + +notification_instance_test(() => { + const n = new Notification(...notification_args); + n.close(); + return n; +}, "new Notification()"); + +service_worker_test("instance-sw.js", "Service worker test setup"); diff --git a/tests/wpt/tests/notifications/resources/custom-data.js b/tests/wpt/tests/notifications/resources/custom-data.js index b21d28a1bb3..49a5c60d811 100644 --- a/tests/wpt/tests/notifications/resources/custom-data.js +++ b/tests/wpt/tests/notifications/resources/custom-data.js @@ -1,8 +1,7 @@ var fakeCustomData = (function() { var buffer = new ArrayBuffer(2); new DataView(buffer).setInt16(0, 42, true); - var canvas = document.createElement("canvas"); - canvas.width = canvas.height = 100; + var canvas = new OffscreenCanvas(100, 100); var context = canvas.getContext("2d"); var map = new Map(); diff --git a/tests/wpt/tests/notifications/resources/helpers.js b/tests/wpt/tests/notifications/resources/helpers.js index ca44e32f7f4..6b418be03ed 100644 --- a/tests/wpt/tests/notifications/resources/helpers.js +++ b/tests/wpt/tests/notifications/resources/helpers.js @@ -33,3 +33,13 @@ async function trySettingPermission(perm) { throw new Error(`Should have the permission ${perm} to continue`); } } + +// Use this in service workers where activation is required e.g. when testing showNotification() +async function untilActivate() { + if (registration.active) { + return; + } + return new Promise(resolve => { + addEventListener("activate", resolve, { once: true }); + }); +} diff --git a/tests/wpt/tests/permissions-policy/payment-extension-allowed-by-permissions-policy-attribute.https.sub.html b/tests/wpt/tests/permissions-policy/payment-extension-allowed-by-permissions-policy-attribute.https.sub.html index d96bc5a0d1b..ba6d033257f 100644 --- a/tests/wpt/tests/permissions-policy/payment-extension-allowed-by-permissions-policy-attribute.https.sub.html +++ b/tests/wpt/tests/permissions-policy/payment-extension-allowed-by-permissions-policy-attribute.https.sub.html @@ -8,14 +8,12 @@ var same_origin_src = '/permissions-policy/resources/permissions-policy-payment-extension.html'; var cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' + same_origin_src; - var feature_name = 'permissions policy "payment"'; + var feature_name = 'WebAuthn "payment" extension'; var header = 'allow="payment" attribute'; promise_test(t => { return test_feature_availability_with_post_message_result( - t, cross_origin_src, "NotSupportedError#The 'payment' or 'publickey-credentials-create' features are not " + - "enabled in this document. Permissions Policy may be used to " + - "delegate Web Payment capabilities to cross-origin child frames."); + t, cross_origin_src, "NotSupportedError"); }, feature_name + ' is not supported in cross-origin iframe without ' + header); promise_test(t => { diff --git a/tests/wpt/tests/permissions-policy/permissions-policy-frame-policy-timing.https.sub.html b/tests/wpt/tests/permissions-policy/permissions-policy-frame-policy-timing.https.sub.html index 5b2a4888631..bea9673d620 100644 --- a/tests/wpt/tests/permissions-policy/permissions-policy-frame-policy-timing.https.sub.html +++ b/tests/wpt/tests/permissions-policy/permissions-policy-frame-policy-timing.https.sub.html @@ -43,11 +43,11 @@ const iframe = document.createElement('iframe'); document.body.appendChild(iframe); iframe_pre_nav_callback(iframe); - iframe.src = url; - iframe_post_nav_callback(iframe); iframe.onload = t.step_func(() => { + iframe_post_nav_callback(iframe); postMessageToFrame(iframe, t.step_func_done(result_handler)); }); + iframe.src = url; }, test_name); } diff --git a/tests/wpt/tests/permissions-policy/resources/permissions-policy-payment-extension.html b/tests/wpt/tests/permissions-policy/resources/permissions-policy-payment-extension.html index 3f628ae25d8..bb9f86ef016 100644 --- a/tests/wpt/tests/permissions-policy/resources/permissions-policy-payment-extension.html +++ b/tests/wpt/tests/permissions-policy/resources/permissions-policy-payment-extension.html @@ -53,7 +53,7 @@ window.onload = async function() { }); } catch (e) { enabled = false; - name = e.name + '#' + e.message; + name = e.name; } parent.postMessage({ type: 'availability-result', enabled, name }, '*'); } diff --git a/tests/wpt/tests/pointerevents/pointerevent_after_target_appended.html b/tests/wpt/tests/pointerevents/pointerevent_after_target_appended.html index 712670d6479..a5cb82088e8 100644 --- a/tests/wpt/tests/pointerevents/pointerevent_after_target_appended.html +++ b/tests/wpt/tests/pointerevents/pointerevent_after_target_appended.html @@ -158,15 +158,29 @@ setup(); + const hoverable = pointer_type != "touch"; + // Tests for dispatched pointer events. - addPromiseTestForNewChild("pointerdown", "pointer", [ - "pointerover@parent", "pointerenter@parent", - "pointerdown@parent", "(child-attached)", - "pointerout@parent", "pointerover@child", "pointerenter@child", - "pointerup@child", - "pointerdown@child", "pointerup@child", - "pointerout@child", "pointerleave@child", "pointerleave@parent" - ]); + addPromiseTestForNewChild( + "pointerdown", + "pointer", + hoverable + ? ["pointerover@parent", "pointerenter@parent", + "pointerdown@parent", "(child-attached)", + "pointerout@parent", "pointerover@child", "pointerenter@child", + "pointerup@child", + "pointerdown@child", "pointerup@child", + "pointerout@child", "pointerleave@child", "pointerleave@parent"] + : ["pointerover@parent", "pointerenter@parent", + "pointerdown@parent", "(child-attached)", + // pointerup should imply a pointermove over the attached child. + "pointerout@parent", "pointerover@child", "pointerenter@child", + // pointerup should cause pointerout/pointerleave if the input source is not hoverable. + "pointerup@child", "pointerout@child", "pointerleave@child", "pointerleave@parent", + // then, pointerdown should imply a pointermove again. + "pointerover@child", "pointerenter@child", "pointerenter@parent", "pointerdown@child", + "pointerup@child", "pointerout@child", "pointerleave@child", "pointerleave@parent"] + ); addPromiseTestForNewChild("pointerup", "pointer", [ "pointerover@parent", "pointerenter@parent", "pointerdown@parent", "pointerup@parent", "(child-attached)", diff --git a/tests/wpt/tests/pointerevents/pointerevent_after_target_removed.html b/tests/wpt/tests/pointerevents/pointerevent_after_target_removed.html index b63e8b92d18..97a1a83fc87 100644 --- a/tests/wpt/tests/pointerevents/pointerevent_after_target_removed.html +++ b/tests/wpt/tests/pointerevents/pointerevent_after_target_removed.html @@ -104,19 +104,43 @@ setup(); + const hoverable = pointer_type != "touch"; + // Tests for dispatched pointer events. - addPromiseTest("pointerdown", "pointer", [ - "pointerover@child", "pointerenter@parent", "pointerenter@child", - "pointerdown@child", "(child-removed)", "pointerover@parent", "pointerup@parent", - "pointerdown@parent", "pointerup@parent", - "pointerout@parent", "pointerleave@parent" - ]); - addPromiseTest("pointerup", "pointer", [ - "pointerover@child", "pointerenter@parent", "pointerenter@child", - "pointerdown@child", "pointerup@child", "(child-removed)", - "pointerover@parent", "pointerdown@parent", "pointerup@parent", - "pointerout@parent", "pointerleave@parent" - ]); + addPromiseTest( + "pointerdown", + "pointer", + hoverable + ? ["pointerover@child", "pointerenter@parent", "pointerenter@child", + "pointerdown@child", "(child-removed)", "pointerover@parent", "pointerup@parent", + "pointerdown@parent", "pointerup@parent", + "pointerout@parent", "pointerleave@parent"] + : ["pointerover@child", "pointerenter@parent", "pointerenter@child", "pointerdown@child", + "(child-removed)", "pointerover@parent", + // pointerup should cause pointerout/pointerleave if the input source is not hoverable. + "pointerup@parent", "pointerout@parent", "pointerleave@parent", + // then, pointerdown should imply a pointermove again. + "pointerover@parent", "pointerenter@parent", "pointerdown@parent", + "pointerup@parent", "pointerout@parent", "pointerleave@parent"] + ); + addPromiseTest( + "pointerup", + "pointer", + hoverable + ? ["pointerover@child", "pointerenter@parent", "pointerenter@child", + "pointerdown@child", "pointerup@child", "(child-removed)", + "pointerover@parent", "pointerdown@parent", "pointerup@parent", + "pointerout@parent", "pointerleave@parent"] + : ["pointerover@child", "pointerenter@parent", "pointerenter@child", + "pointerdown@child", "pointerup@child", "(child-removed)", + // only pointerleave should be fired if the input source is not hoverable + // because pointerup removed the pointerout event target which is not + // received pointerover event, but the pointer becomes invalid. + "pointerleave@parent", + // then, pointerdown should imply a pointermove again. + "pointerover@parent", "pointerenter@parent", "pointerdown@parent", "pointerup@parent", + "pointerout@parent", "pointerleave@parent"] + ); // Same tests for dispatched compatibility mouse events. addPromiseTest("mousedown", "mouse", [ diff --git a/tests/wpt/tests/pointerevents/pointerevent_capture_mouse_and_release_and_capture_again.html b/tests/wpt/tests/pointerevents/pointerevent_capture_mouse_and_release_and_capture_again.html new file mode 100644 index 00000000000..d060338116c --- /dev/null +++ b/tests/wpt/tests/pointerevents/pointerevent_capture_mouse_and_release_and_capture_again.html @@ -0,0 +1,90 @@ + + + + +Testing pointer events for mouse when capturing the pointer with different element from the pointerdown target and +release it at got capture and capture it again at lost the first capture + + + + + + + + +
div id=listener
+
div id=target
+ + diff --git a/tests/wpt/tests/pointerevents/pointerevent_capture_touch_and_release_at_got_capture.html b/tests/wpt/tests/pointerevents/pointerevent_capture_touch_and_release_at_got_capture.html new file mode 100644 index 00000000000..095b67010d4 --- /dev/null +++ b/tests/wpt/tests/pointerevents/pointerevent_capture_touch_and_release_at_got_capture.html @@ -0,0 +1,88 @@ + + + + +Testing pointer events for touch when capturing the pointer with different element from the pointerdown target and release it at got pointer capture + + + + + + + + +
div id=listener
+
div id=target
+ + diff --git a/tests/wpt/tests/pointerevents/pointerevent_pointer_boundary_events_after_reappending_last_over_target.html b/tests/wpt/tests/pointerevents/pointerevent_pointer_boundary_events_after_reappending_last_over_target.html new file mode 100644 index 00000000000..644bbb3229f --- /dev/null +++ b/tests/wpt/tests/pointerevents/pointerevent_pointer_boundary_events_after_reappending_last_over_target.html @@ -0,0 +1,221 @@ + + + + + +Even temporary removal of "pointerover" target should be considered as removed + + + + + + + + + diff --git a/tests/wpt/tests/reporting/document-reporting-bypass-report-to.https.sub.html b/tests/wpt/tests/reporting/document-reporting-bypass-report-to.https.sub.html index 394bc9e40a0..f599ef8511b 100644 --- a/tests/wpt/tests/reporting/document-reporting-bypass-report-to.https.sub.html +++ b/tests/wpt/tests/reporting/document-reporting-bypass-report-to.https.sub.html @@ -19,7 +19,12 @@ }) }, "document policy violation observed"); - + - + - + + + + + + +
+ This is a line of text. +
diff --git a/tests/wpt/tests/selection/shadow-dom/select-later-become-slotted-content.html b/tests/wpt/tests/selection/shadow-dom/select-later-become-slotted-content.html new file mode 100644 index 00000000000..f38105dd0bb --- /dev/null +++ b/tests/wpt/tests/selection/shadow-dom/select-later-become-slotted-content.html @@ -0,0 +1,33 @@ + + + + +
+ slotted +
+outer + diff --git a/tests/wpt/tests/service-workers/cache-storage/cache-abort.https.any.js b/tests/wpt/tests/service-workers/cache-storage/cache-abort.https.any.js index 960d1bb1bff..99f29b0a08b 100644 --- a/tests/wpt/tests/service-workers/cache-storage/cache-abort.https.any.js +++ b/tests/wpt/tests/service-workers/cache-storage/cache-abort.https.any.js @@ -73,7 +73,7 @@ for (const method in methodsToTest) { `${method} should reject`); // infinite-slow-response.py doesn't know when to stop. - return fetch(`../../../fetch/api/resources/stash-put.py?key=${abortKey}`); + return fetch(`../../../fetch/api/resources/stash-put.py?key=${abortKey}&value=close`); }, `${method}() followed by abort after headers received should reject ` + `with AbortError`); } diff --git a/tests/wpt/tests/service-workers/service-worker/ServiceWorkerGlobalScope/message-event-ports-worker.js b/tests/wpt/tests/service-workers/service-worker/ServiceWorkerGlobalScope/message-event-ports-worker.js new file mode 100644 index 00000000000..78cd0d86c01 --- /dev/null +++ b/tests/wpt/tests/service-workers/service-worker/ServiceWorkerGlobalScope/message-event-ports-worker.js @@ -0,0 +1,3 @@ +self.onmessage = e => { + e.source.postMessage(e.ports === e.ports ? "same ports array" : "different ports array"); +}; diff --git a/tests/wpt/tests/service-workers/service-worker/ServiceWorkerGlobalScope/message-event-ports.https.html b/tests/wpt/tests/service-workers/service-worker/ServiceWorkerGlobalScope/message-event-ports.https.html new file mode 100644 index 00000000000..a0eac39e9b3 --- /dev/null +++ b/tests/wpt/tests/service-workers/service-worker/ServiceWorkerGlobalScope/message-event-ports.https.html @@ -0,0 +1,43 @@ + + + +Service Worker GlobalScope onerror event + + + + + + + + diff --git a/tests/wpt/tests/shadow-dom/Document-caretPositionFromPoint.tentative.html b/tests/wpt/tests/shadow-dom/Document-caretPositionFromPoint.tentative.html index 2b97546d2e2..f3053ee7115 100644 --- a/tests/wpt/tests/shadow-dom/Document-caretPositionFromPoint.tentative.html +++ b/tests/wpt/tests/shadow-dom/Document-caretPositionFromPoint.tentative.html @@ -30,6 +30,34 @@ test(() => { assert_equals(caretPosition.offset, characterIndex); }, "document.caretPositionFromPoint() should return a CaretPosition at the specified location"); +test(() => { + container.setHTMLUnsafe(``); + const rect = container.firstChild.getBoundingClientRect(); + // Get x and y coordinate at left-most location inside input element. + const x = rect.left + 1; + const y = rect.top + rect.height / 2; + const caretPosition = document.caretPositionFromPoint(x, y); + assert_true(caretPosition instanceof CaretPosition); + assert_true(caretPosition.offsetNode instanceof Node); + assert_equals(typeof(caretPosition.offset), "number"); + assert_equals(caretPosition.offsetNode, container.firstChild); + assert_equals(caretPosition.offset, 0); +}, "document.caretPositionFromPoint() should return a CaretPosition at the specified location pointing to an input element which is the offsetNode."); + +test(() => { + container.setHTMLUnsafe(``); + const rect = container.firstChild.getBoundingClientRect(); + // Get x and y coordinate at "1234|5678..." + const x = rect.left + 1; + const y = rect.top + rect.height * 0.75; + const caretPosition = document.caretPositionFromPoint(x, y); + assert_true(caretPosition instanceof CaretPosition); + assert_true(caretPosition.offsetNode instanceof Node); + assert_equals(typeof(caretPosition.offset), "number"); + assert_equals(caretPosition.offsetNode, container.firstChild); + assert_equals(caretPosition.offset, 4); +}, "document.caretPositionFromPoint() should return a CaretPosition at the specified location pointing to a textarea element which is the offsetNode."); + test(() => { container.setHTMLUnsafe(`a
b`); const shadowRoot = host.attachShadow({mode: 'closed'}); @@ -72,6 +100,48 @@ test(() => { assert_equals(caretPosition.offset, characterIndex); }, 'document.caretPositionFromPoint() should return a CaretPosition at the specified location when the non-intersecting shadow tree is specified as an argument'); +test(() => { + container.setHTMLUnsafe(` + a
+ +
efg`); + const shadowRoot = host.shadowRoot; + const shadowRootInputElement = shadowRoot.querySelector("input"); + const rect = shadowRootInputElement.getBoundingClientRect(); + // Get x and y coordinate at left-most location inside input element. + const x = rect.left + 1; + const y = rect.top + rect.height / 2; + const caretPosition = document.caretPositionFromPoint(x, y, shadowRoot); + assert_true(caretPosition instanceof CaretPosition); + assert_true(caretPosition.offsetNode instanceof Node); + assert_equals(typeof(caretPosition.offset), "number"); + assert_equals(caretPosition.offsetNode, shadowRootInputElement); + assert_equals(caretPosition.offset, 0); +}, "document.caretPositionFromPoint() should return a CaretPosition at the specified location pointing to an input element when the shadow tree is specified as an argument."); + +test(() => { + container.setHTMLUnsafe(` + a
+ +
efg`); + const shadowRoot = host.shadowRoot; + const shadowRootInputElement = shadowRoot.querySelector("input"); + const rect = shadowRootInputElement.getBoundingClientRect(); + // Get x and y coordinate at left-most location inside input element. + const x = rect.left + 1; + const y = rect.top + rect.height / 2; + const caretPosition = document.caretPositionFromPoint(x, y); + assert_true(caretPosition instanceof CaretPosition); + assert_true(caretPosition.offsetNode instanceof Node); + assert_equals(typeof(caretPosition.offset), "number"); + assert_equals(caretPosition.offsetNode, container); + assert_equals(caretPosition.offset, 1); +}, "document.caretPositionFromPoint() should return a CaretPosition at the specified location pointing to the input element's shadow host\'s parent when the shadow tree is not specified as an argument."); + test(() => { container.setHTMLUnsafe(` a
diff --git a/tests/wpt/tests/shadow-dom/declarative/declarative-shadow-dom-write-to-iframe.html b/tests/wpt/tests/shadow-dom/declarative/declarative-shadow-dom-write-to-iframe.html new file mode 100644 index 00000000000..ab0af5878de --- /dev/null +++ b/tests/wpt/tests/shadow-dom/declarative/declarative-shadow-dom-write-to-iframe.html @@ -0,0 +1,22 @@ + + +`document.write` on inner iframe handles declarative shadow DOM + + + + diff --git a/tests/wpt/tests/soft-navigation-heuristics/soft-navigation-detection-web-component-lifecycle.tentative.html b/tests/wpt/tests/soft-navigation-heuristics/soft-navigation-detection-web-component-lifecycle.tentative.html index 7e27b0073c9..43848935038 100644 --- a/tests/wpt/tests/soft-navigation-heuristics/soft-navigation-detection-web-component-lifecycle.tentative.html +++ b/tests/wpt/tests/soft-navigation-heuristics/soft-navigation-detection-web-component-lifecycle.tentative.html @@ -38,6 +38,7 @@ main.appendChild(spaContent); }, link: link, + pushState: null, test: "Test that a soft navigation is detected when the click is done " + "on a custom element."}); diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/chrome_ios.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/chrome_ios.py index d3beb449e24..20fcb908898 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/chrome_ios.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/chrome_ios.py @@ -1,7 +1,9 @@ # mypy: allow-untyped-defs +import traceback from .base import WebDriverBrowser, require_arg from .base import get_timeout_multiplier # noqa: F401 +from ..environment import wait_for_service from ..executors import executor_kwargs as base_executor_kwargs from ..executors.base import WdspecExecutor # noqa: F401 from ..executors.executorchrome import ChromeDriverPrintRefTestExecutor # noqa: F401 @@ -60,3 +62,19 @@ class ChromeiOSBrowser(WebDriverBrowser): def make_command(self): return ([self.webdriver_binary, f"--port={self.port}"] + self.webdriver_args) + + def start(self, group_metadata, **kwargs): + super().start(group_metadata, **kwargs) + try: + wait_for_service( + self.logger, + self.host, + self.port, + timeout=self.init_timeout, + server_process=self._proc, + ) + except Exception: + self.logger.error( + "WebDriver was not accessible " + f"within the timeout:\n{traceback.format_exc()}") + raise diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/environment.py b/tests/wpt/tests/tools/wptrunner/wptrunner/environment.py index 37951f41d2e..f8538b7da1d 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/environment.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/environment.py @@ -291,12 +291,18 @@ class TestEnvironment: failed.append((scheme, port)) if not failed and self.test_server_port: + # The webtransport-h3 server test blocks (i.e., doesn't fail quickly + # with "Connection refused" like the sockets do), so testing these + # first improves the likelihood the non-webtransport-h3 servers are + # ready by the time they're checked. + for port, server in self.servers.get("webtransport-h3", []): + if not webtranport_h3_server_is_running(host, port, timeout=5): + pending.append((host, port)) + for scheme, servers in self.servers.items(): + if scheme == "webtransport-h3": + continue for port, server in servers: - if scheme == "webtransport-h3": - if not webtranport_h3_server_is_running(host, port, timeout=5.0): - pending.append((host, port)) - continue s = socket.socket() s.settimeout(0.1) try: diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py b/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py index 92a782e835c..20bddaa4bc9 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/executors/base.py @@ -215,8 +215,10 @@ class TimedRunner: else: if self.protocol.is_alive(): message = "Executor hit external timeout (this may indicate a hang)\n" - # get a traceback for the current stack of the executor thread - message += "".join(traceback.format_stack(sys._current_frames()[executor.ident])) + if executor.ident in sys._current_frames(): + # get a traceback for the current stack of the executor thread + message += "".join(traceback.format_stack( + sys._current_frames()[executor.ident])) self.result = False, ("EXTERNAL-TIMEOUT", message) else: self.logger.info("Browser not responding, setting status to CRASH") diff --git a/tests/wpt/tests/trusted-types/trusted-types-event-handlers.html b/tests/wpt/tests/trusted-types/trusted-types-event-handlers.html index 9dd7133cbb0..8dd70757e34 100644 --- a/tests/wpt/tests/trusted-types/trusted-types-event-handlers.html +++ b/tests/wpt/tests/trusted-types/trusted-types-event-handlers.html @@ -46,10 +46,15 @@ for(name in div.__proto__) { _ => element.setAttribute(name, "2+2")); }, `Event handler div.${name} should be blocked.`); } else { - test(t => { - element.setAttribute(name, "2+2"); - }, `Non-event handler div.${name} should not be blocked.`); + // Rather than going through all the non-event handler, we randomly choose + // a few examples to test. + if (name == "align" || name == "title" || name == "inert" || name == "draggable") { + test(t => { + element.setAttribute(name, "2+2"); + }, `Non-event handler div.${name} should not be blocked.`); + } } } + diff --git a/tests/wpt/tests/uievents/mouse/mouse_boundary_events_after_reappending_last_over_target.tentative.html b/tests/wpt/tests/uievents/mouse/mouse_boundary_events_after_reappending_last_over_target.tentative.html index f75404ad782..62eef0f03e1 100644 --- a/tests/wpt/tests/uievents/mouse/mouse_boundary_events_after_reappending_last_over_target.tentative.html +++ b/tests/wpt/tests/uievents/mouse/mouse_boundary_events_after_reappending_last_over_target.tentative.html @@ -145,6 +145,463 @@ addEventListener("load", () => { }, "After re-appending the last over element at mouseenter, " + "mouse boundary events should not be fired"); + + promise_test(async () => { + const {div1, div2, div3} = append3NestedDivElementsToBody(); + const bodyRect = document.body.getBoundingClientRect(); + const div3Rect = div3.getBoundingClientRect(); + let events = []; + for (const type of ["mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove"]) { + for (const node of [document.body, div1, div2, div3]) { + node.addEventListener(type, event => { + if (event.target == node) { + events.push({type: event.type, target: event.target}); + } + }, {capture: true}); + } + } + div3.addEventListener("mouseover", event => { + events = []; + events.push({type: event.type, target: event.target}); + }, {once: true}); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .pointerMove(div3Rect.x + 10, div3Rect.y + 10, {}) + .send(); + await promiseTick(); + div2.appendChild(div3); + await promiseTick(); + const expectedEvents = [ + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: document.body }, + { type: "mouseenter", target: div1 }, + { type: "mouseenter", target: div2 }, + { type: "mouseenter", target: div3 }, + { type: "mousemove", target: div3 }, + // Removing the node temporarily should not cause mouse boundary events. + ]; + assert_equals( + stringifyEvents(events), + stringifyEvents(expectedEvents), + ); + div1.remove(); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .send(); + }, + "After re-appending the last over element after mouseover, " + + "mouse boundary events should not be fired"); + + promise_test(async () => { + const {div1, div2, div3} = append3NestedDivElementsToBody(); + const bodyRect = document.body.getBoundingClientRect(); + const div3Rect = div3.getBoundingClientRect(); + let events = []; + for (const type of ["mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove"]) { + for (const node of [document.body, div1, div2, div3]) { + node.addEventListener(type, event => { + if (event.target == node) { + events.push({type: event.type, target: event.target}); + } + }, {capture: true}); + } + } + let firstMouseOver = true; + div3.addEventListener("mouseover", event => { + div1.insertBefore(div3, div2); + events = []; + events.push({type: event.type, target: event.target}); + }, {once: true}); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .pointerMove(div3Rect.x + 10, div3Rect.y + 10, {}) + .send(); + await promiseTick(); + const expectedEvents = [ + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: document.body }, + { type: "mouseenter", target: div1 }, + { type: "mouseenter", target: div2 }, + { type: "mouseenter", target: div3 }, + { type: "mousemove", target: div3 }, + // The "mouseover" target was moved to outside the deepest "mouseenter" + // target after the node is removed. Therefore, mouse boundary events + // should be fired on the original "mouseover" target again. + { type: "mouseleave", target: div2 }, + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: div3 }, + ]; + assert_equals( + stringifyEvents(events), + stringifyEvents(expectedEvents), + ); + div1.remove(); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .send(); + }, + "After re-appending the last over element to outside the deepest mouseenter target (but keeps it as under the cursor) at mouseover, " + + "mouse boundary events should be fired on it again to correct the following mouseleave targets"); + + promise_test(async () => { + const {div1, div2, div3} = append3NestedDivElementsToBody(); + const bodyRect = document.body.getBoundingClientRect(); + const div3Rect = div3.getBoundingClientRect(); + let events = []; + for (const type of ["mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove"]) { + for (const node of [document.body, div1, div2, div3]) { + node.addEventListener(type, event => { + if (event.target == node) { + events.push({type: event.type, target: event.target}); + } + }, {capture: true}); + } + } + let firstMouseOver = true; + div3.addEventListener("mouseover", event => { + div1.append(div3); + events = []; + events.push({type: event.type, target: event.target}); + }, {once: true}); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .pointerMove(div3Rect.x + 10, div3Rect.y + 10, {}) + .send(); + await promiseTick(); + const expectedEvents = [ + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: document.body }, + { type: "mouseenter", target: div1 }, + { type: "mouseenter", target: div2 }, + { type: "mouseenter", target: div3 }, + { type: "mousemove", target: div3 }, + // Now, div2 (id=parent) should be under the mouse cursor. However, + // the "mouseover" target was once removed and not reconnected under the + // deepest "mouseenter" target. Therefore, mouse boundary events should + // not be fired on the div3, but should be fired on the div2. + { type: "mouseover", target: div2}, + ]; + assert_equals( + stringifyEvents(events), + stringifyEvents(expectedEvents), + ); + div1.remove(); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .send(); + }, + "After re-appending the last over element to outside the deepest mouseenter target at mouseover, " + + "mouse boundary events should be fired only on the element under the cursor"); + + promise_test(async () => { + const {div1, div2, div3} = append3NestedDivElementsToBody(); + const bodyRect = document.body.getBoundingClientRect(); + const div3Rect = div3.getBoundingClientRect(); + let events = []; + for (const type of ["mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove"]) { + for (const node of [document.body, div1, div2, div3]) { + node.addEventListener(type, event => { + if (event.target == node) { + events.push({type: event.type, target: event.target}); + } + }, {capture: true}); + } + } + let firstMouseOver = true; + div3.addEventListener("mouseover", event => { + div2.remove(); + div1.appendChild(div3); + events = []; + events.push({type: event.type, target: event.target}); + }, {once: true}); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .pointerMove(div3Rect.x + 10, div3Rect.y + 10, {}) + .send(); + await promiseTick(); + const expectedEvents = [ + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: document.body }, + { type: "mouseenter", target: div1 }, + { type: "mouseenter", target: div2 }, + { type: "mouseenter", target: div3 }, + { type: "mousemove", target: div3 }, + // Reconnecting the last "mouseover" target to a grandparent, div3, (i.e., + // without parent, div2) immediately should be treated as a temporary + // removal because browsers can store only the deepest last "mouseenter" + // target instead of the full path of the event targets. Therefore, + // "mouseover" nor "mouseenter" should not be fired again on div3. + ]; + assert_equals( + stringifyEvents(events), + stringifyEvents(expectedEvents), + ); + div1.remove(); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .send(); + }, + "After re-appending the last over element to the deepest mouseenter target without the original parent at mouseover, " + + "mouse boundary events should not be fired"); + + promise_test(async () => { + const {div1, div2, div3} = append3NestedDivElementsToBody(); + const bodyRect = document.body.getBoundingClientRect(); + const div3Rect = div3.getBoundingClientRect(); + let events = []; + for (const type of ["mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove"]) { + for (const node of [document.body, div1, div2, div3]) { + node.addEventListener(type, event => { + if (event.target == node) { + events.push({type: event.type, target: event.target}); + } + }, {capture: true}); + } + } + let firstMouseOver = true; + div3.addEventListener("mouseover", event => { + events = []; + events.push({type: event.type, target: event.target}); + }, {once: true}); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .pointerMove(div3Rect.x + 10, div3Rect.y + 10, {}) + .send(); + await promiseTick(); + div1.insertBefore(div3, div2); + await promiseTick(); + const expectedEvents = [ + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: document.body }, + { type: "mouseenter", target: div1 }, + { type: "mouseenter", target: div2 }, + { type: "mouseenter", target: div3 }, + { type: "mousemove", target: div3 }, + // The "mouseover" target was moved to outside the deepest "mouseenter" + // target after the node is removed. Therefore, mouse boundary events + // should be fired on the original "mouseover" target again. + { type: "mouseleave", target: div2 }, + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: div3 }, + ]; + assert_equals( + stringifyEvents(events), + stringifyEvents(expectedEvents), + ); + div1.remove(); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .send(); + }, + "After re-appending the last over element to outside the deepest mouseenter target (but keeps under the cursor) after mouseover, " + + "mouse boundary events should be fired on it again to correct the following mouseleave event targets"); + + promise_test(async () => { + const {div1, div2, div3} = append3NestedDivElementsToBody(); + const bodyRect = document.body.getBoundingClientRect(); + const div3Rect = div3.getBoundingClientRect(); + let events = []; + for (const type of ["mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove"]) { + for (const node of [document.body, div1, div2, div3]) { + node.addEventListener(type, event => { + if (event.target == node) { + events.push({type: event.type, target: event.target}); + } + }, {capture: true}); + } + } + let firstMouseOver = true; + div3.addEventListener("mouseover", event => { + events = []; + events.push({type: event.type, target: event.target}); + }, {once: true}); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .pointerMove(div3Rect.x + 10, div3Rect.y + 10, {}) + .send(); + await promiseTick(); + div1.append(div3); + await promiseTick(); + const expectedEvents = [ + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: document.body }, + { type: "mouseenter", target: div1 }, + { type: "mouseenter", target: div2 }, + { type: "mouseenter", target: div3 }, + { type: "mousemove", target: div3 }, + // Now, div2 (id=parent) should be under the mouse cursor. However, + // the "mouseover" target was once removed and not reconnected under the + // deepest "mouseenter" target. Therefore, mouse boundary events should + // not be fired on the div3, but should be fired on the div2. + { type: "mouseover", target: div2}, + ]; + assert_equals( + stringifyEvents(events), + stringifyEvents(expectedEvents), + ); + div1.remove(); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .send(); + }, + "After re-appending the last over element to outside the deepest mouseenter target after mouseover, " + + "mouse boundary events should be fired only on the element under the cursor"); + + promise_test(async () => { + const {div1, div2, div3} = append3NestedDivElementsToBody(); + const bodyRect = document.body.getBoundingClientRect(); + const div3Rect = div3.getBoundingClientRect(); + let events = []; + for (const type of ["mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove"]) { + for (const node of [document.body, div1, div2, div3]) { + node.addEventListener(type, event => { + if (event.target == node) { + events.push({type: event.type, target: event.target}); + } + }, {capture: true}); + } + } + let firstMouseOver = true; + div3.addEventListener("mouseover", event => { + div2.remove(); + div1.appendChild(div3); + events = []; + events.push({type: event.type, target: event.target}); + }, {once: true}); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .pointerMove(div3Rect.x + 10, div3Rect.y + 10, {}) + .send(); + await promiseTick(); + div2.remove(); + div1.appendChild(div3); + await promiseTick(); + const expectedEvents = [ + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: document.body }, + { type: "mouseenter", target: div1 }, + { type: "mouseenter", target: div2 }, + { type: "mouseenter", target: div3 }, + { type: "mousemove", target: div3 }, + // Reconnecting the last "mouseover" target to a grandparent, div3, (i.e., + // without parent, div2) immediately should be treated as a temporary + // removal because browsers can store only the deepest last "mouseenter" + // target instead of the full path of the event targets. Therefore, + // "mouseover" nor "mouseenter" should not be fired again on div3. + ]; + assert_equals( + stringifyEvents(events), + stringifyEvents(expectedEvents), + ); + div1.remove(); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .send(); + }, + "After re-appending the last over element to the deepest mouseenter target without the original parent after mouseover, " + + "mouse boundary events should not be fired"); + + promise_test(async () => { + const {div1, div2, div3} = append3NestedDivElementsToBody(); + const bodyRect = document.body.getBoundingClientRect(); + const div3Rect = div3.getBoundingClientRect(); + let events = []; + for (const type of ["mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove"]) { + for (const node of [document.body, div1, div2, div3]) { + node.addEventListener(type, event => { + if (event.target == node) { + events.push({type: event.type, target: event.target}); + } + }, {capture: true}); + } + } + div3.addEventListener("mouseover", event => { + events = []; + events.push({type: event.type, target: event.target}); + }, {once: true}); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .pointerMove(div3Rect.x + 10, div3Rect.y + 10, {}) + .send(); + await promiseTick(); + div3.remove(); + div2.getBoundingClientRect(); // maybe refresh the layout + div2.appendChild(div3); + await promiseTick(); + const expectedEvents = [ + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: document.body }, + { type: "mouseenter", target: div1 }, + { type: "mouseenter", target: div2 }, + { type: "mouseenter", target: div3 }, + { type: "mousemove", target: div3 }, + // Removing the node temporarily should not cause mouse boundary events. + ]; + assert_equals( + stringifyEvents(events), + stringifyEvents(expectedEvents), + ); + div1.remove(); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .send(); + }, + "After removing and re-appending the last over element with flushing layout after mouseover, " + + "mouse boundary events should not be fired"); + + promise_test(async () => { + const {div1, div2, div3} = append3NestedDivElementsToBody(); + const bodyRect = document.body.getBoundingClientRect(); + const div3Rect = div3.getBoundingClientRect(); + let events = []; + for (const type of ["mouseenter", "mouseleave", "mouseover", "mouseout", "mousemove"]) { + for (const node of [document.body, div1, div2, div3]) { + node.addEventListener(type, event => { + if (event.target == node) { + events.push({type: event.type, target: event.target}); + } + }, {capture: true}); + } + } + div3.addEventListener("mouseover", event => { + events = []; + events.push({type: event.type, target: event.target}); + }, {once: true}); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .pointerMove(div3Rect.x + 10, div3Rect.y + 10, {}) + .send(); + await promiseTick(); + div3.remove(); + await new Promise(resolve => requestAnimationFrame(resolve)); + div2.appendChild(div3); + await promiseTick(); + const expectedEvents = [ + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: document.body }, + { type: "mouseenter", target: div1 }, + { type: "mouseenter", target: div2 }, + { type: "mouseenter", target: div3 }, + { type: "mousemove", target: div3 }, + // Removing the node and appending it occurred in different animation + // frames. Therefore, it shouldn't be treated as a temporary removal + // since user may have seen the layout change. + { type: "mouseover", target: div2 }, // no mouseout on div3 because it's not connected at this moment + { type: "mouseout", target: div2 }, + { type: "mouseover", target: div3 }, + { type: "mouseenter", target: div3 }, + ]; + assert_equals( + stringifyEvents(events), + stringifyEvents(expectedEvents), + ); + div1.remove(); + await new test_driver.Actions() + .pointerMove(1, 1, {}) + .send(); + }, + "After removing after mouseover and re-appending the last over element at next animation frame, " + + "mouse boundary events should be fired"); }, {once: true}); diff --git a/tests/wpt/tests/webaudio/META.yml b/tests/wpt/tests/webaudio/META.yml index 3bcd1cb8d37..735f0ebd391 100644 --- a/tests/wpt/tests/webaudio/META.yml +++ b/tests/wpt/tests/webaudio/META.yml @@ -2,3 +2,4 @@ spec: https://webaudio.github.io/web-audio-api/ suggested_reviewers: - hoch - padenot + - chrisguttandin diff --git a/tests/wpt/tests/webcodecs/video-encoder-flush.https.any.js b/tests/wpt/tests/webcodecs/video-encoder-flush.https.any.js index c1ebafc4a3c..291f4df3bc0 100644 --- a/tests/wpt/tests/webcodecs/video-encoder-flush.https.any.js +++ b/tests/wpt/tests/webcodecs/video-encoder-flush.https.any.js @@ -2,32 +2,22 @@ // META: script=/common/media.js // META: script=/webcodecs/utils.js // META: script=/webcodecs/video-encoder-utils.js +// META: variant=?av1 // META: variant=?vp8 // META: variant=?h264_avc -const VP8_CONFIG = { - codec: 'vp8', - width: 640, - height: 480, - displayWidth: 800, - displayHeight: 600, -}; - -const H264_AVC_CONFIG = { - codec: 'avc1.42001e', // Baseline - width: 640, - height: 480, - displayWidth: 800, - displayHeight: 600, - avc: {format: 'avc'}, -}; - let CONFIG = null; promise_setup(async () => { - CONFIG = { - '?vp8': VP8_CONFIG, - '?h264_avc': H264_AVC_CONFIG, + const config = { + '?av1': {codec: 'av01.0.04M.08'}, + '?vp8': {codec: 'vp8'}, + '?h264_avc': {codec: 'avc1.42001e', avc: {format: 'avc'}}, }[location.search]; + config.width = 640; + config.height = 480; + config.displayWidth = 800; + config.displayHeight = 600; + CONFIG = config; }); promise_test(async t => { diff --git a/tests/wpt/tests/webcodecs/videoFrame-drawImage-hbd.any.js b/tests/wpt/tests/webcodecs/videoFrame-drawImage-hbd.any.js new file mode 100644 index 00000000000..f03fce796b0 --- /dev/null +++ b/tests/wpt/tests/webcodecs/videoFrame-drawImage-hbd.any.js @@ -0,0 +1,31 @@ +// META: global=window,dedicatedworker +// META: script=/webcodecs/utils.js + +test(_ => { + let width = 48; + let height = 36; + let expectedPixel = kSRGBPixel; + let canvasOptions = undefined; + let imageSetting = undefined; + let tolerance = 5; + let vfInit = + {format: 'I420P10', timestamp: 0, codedWidth: width, codedHeight: height}; + let data = new Uint16Array(3 * width * height / 2); + let uOffset = width * height; + let vOffset = uOffset + width * height / 4; + // RGB(50, 100, 150) converted to 8-bit YCbCr using BT.709 YUV matrix, then + // shifted to produce approximate 10-bit YUV colors. It would be more accurate + // to directly compute 10-bit colors. + data.fill(96 << 2, 0, uOffset); + data.fill(155 << 2, uOffset, vOffset); + data.fill(104 << 2, vOffset); + let frame = new VideoFrame(data, vfInit); + let canvas = new OffscreenCanvas(width, height); + let ctx = canvas.getContext('2d', canvasOptions); + ctx.drawImage(frame, 0, 0); + testCanvas(ctx, width, height, expectedPixel, imageSetting, + (actual, expected) => { + assert_approx_equals(actual, expected, tolerance); + }); + frame.close(); +}, 'drawImage with 10-bit YUV VideoFrame'); diff --git a/tests/wpt/tests/webdriver/tests/bidi/external/permissions/set_permission/set_permission.py b/tests/wpt/tests/webdriver/tests/bidi/external/permissions/set_permission/set_permission.py index 18f8e6fed00..574f2149841 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/external/permissions/set_permission/set_permission.py +++ b/tests/wpt/tests/webdriver/tests/bidi/external/permissions/set_permission/set_permission.py @@ -100,41 +100,3 @@ async def test_set_permission_origin_unknown(bidi_session, new_tab, origin, url) origin=origin, ) assert await get_permission_state(bidi_session, new_tab, "geolocation") == "prompt" - - -@pytest.mark.asyncio -async def test_set_permission_user_context(bidi_session, new_tab, url, create_user_context): - test_url = url("/common/blank.html", protocol="https") - - user_context = await create_user_context() - # new_tab is in the default user context. new_tab2 is in the non-default user context. - new_tab2 = await bidi_session.browsing_context.create(type_hint="tab", user_context=user_context) - - # Navigate a context in the default user context. - await bidi_session.browsing_context.navigate( - context=new_tab["context"], - url=test_url, - wait="complete", - ) - - # Navigate a context in the non-default user context. - await bidi_session.browsing_context.navigate( - context=new_tab2["context"], - url=test_url, - wait="complete", - ) - - origin = await get_context_origin(bidi_session, new_tab) - - assert await get_permission_state(bidi_session, new_tab, "geolocation") == "prompt" - assert await get_permission_state(bidi_session, new_tab2, "geolocation") == "prompt" - - await bidi_session.permissions.set_permission( - descriptor={"name": "geolocation"}, - state="granted", - origin=origin, - user_context=user_context, - ) - - assert await get_permission_state(bidi_session, new_tab, "geolocation") == "prompt" - assert await get_permission_state(bidi_session, new_tab2, "geolocation") == "granted" diff --git a/tests/wpt/tests/webdriver/tests/bidi/external/permissions/set_permission/user_context.py b/tests/wpt/tests/webdriver/tests/bidi/external/permissions/set_permission/user_context.py new file mode 100644 index 00000000000..b45ddb12b7e --- /dev/null +++ b/tests/wpt/tests/webdriver/tests/bidi/external/permissions/set_permission/user_context.py @@ -0,0 +1,131 @@ +import pytest + +from . import get_context_origin, get_permission_state + +pytestmark = pytest.mark.asyncio + + +async def test_set_permission_user_context( + bidi_session, new_tab, url, create_user_context +): + test_url = url("/common/blank.html", protocol="https", domain="alt") + + user_context = await create_user_context() + # new_tab is in the default user context. new_tab2 is in the non-default user context. + new_tab2 = await bidi_session.browsing_context.create( + type_hint="tab", user_context=user_context + ) + + # Navigate a context in the default user context. + await bidi_session.browsing_context.navigate( + context=new_tab["context"], + url=test_url, + wait="complete", + ) + + # Navigate a context in the non-default user context. + await bidi_session.browsing_context.navigate( + context=new_tab2["context"], + url=test_url, + wait="complete", + ) + + origin = await get_context_origin(bidi_session, new_tab) + + assert await get_permission_state(bidi_session, new_tab, "geolocation") == "prompt" + assert await get_permission_state(bidi_session, new_tab2, "geolocation") == "prompt" + + await bidi_session.permissions.set_permission( + descriptor={"name": "geolocation"}, + state="granted", + origin=origin, + user_context=user_context, + ) + + assert await get_permission_state(bidi_session, new_tab, "geolocation") == "prompt" + assert ( + await get_permission_state(bidi_session, new_tab2, "geolocation") == "granted" + ) + + # Create another tab in the non-default user context + new_tab3 = await bidi_session.browsing_context.create( + type_hint="tab", user_context=user_context + ) + await bidi_session.browsing_context.navigate( + context=new_tab3["context"], + url=test_url, + wait="complete", + ) + + # Make sure that the permission state is still present. + assert ( + await get_permission_state(bidi_session, new_tab3, "geolocation") == "granted" + ) + + +async def test_set_permission_with_reload(bidi_session, url, create_user_context): + user_context = await create_user_context() + new_tab = await bidi_session.browsing_context.create( + type_hint="tab", user_context=user_context + ) + + test_url = url("/common/blank.html", protocol="https") + await bidi_session.browsing_context.navigate( + context=new_tab["context"], + url=test_url, + wait="complete", + ) + + origin = await get_context_origin(bidi_session, new_tab) + + await bidi_session.permissions.set_permission( + descriptor={"name": "geolocation"}, + state="granted", + origin=origin, + user_context=user_context, + ) + + assert await get_permission_state(bidi_session, new_tab, "geolocation") == "granted" + + await bidi_session.browsing_context.reload( + context=new_tab["context"], + wait="complete", + ) + + # Make sure that permission state is still set. + assert await get_permission_state(bidi_session, new_tab, "geolocation") == "granted" + + +async def test_reset_permission(bidi_session, url, create_user_context): + test_url = url("/common/blank.html", protocol="https") + + user_context = await create_user_context() + new_tab = await bidi_session.browsing_context.create( + type_hint="tab", user_context=user_context + ) + + await bidi_session.browsing_context.navigate( + context=new_tab["context"], + url=test_url, + wait="complete", + ) + + origin = await get_context_origin(bidi_session, new_tab) + + await bidi_session.permissions.set_permission( + descriptor={"name": "geolocation"}, + state="granted", + origin=origin, + user_context=user_context, + ) + + assert await get_permission_state(bidi_session, new_tab, "geolocation") == "granted" + + # Reset the permission state + await bidi_session.permissions.set_permission( + descriptor={"name": "geolocation"}, + state="prompt", + origin=origin, + user_context=user_context, + ) + assert await get_permission_state(bidi_session, new_tab, "geolocation") == "prompt" diff --git a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/wheel.py b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/wheel.py index ee0d4d4600d..3129e9b0e63 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/wheel.py +++ b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/wheel.py @@ -4,6 +4,7 @@ from webdriver.bidi.error import NoSuchFrameException from webdriver.bidi.modules.input import Actions, get_element_origin from webdriver.bidi.modules.script import ContextTarget +from tests.support.sync import AsyncPoll from tests.support.keys import Keys from .. import get_events, get_object_from_context from . import get_shadow_root_from_test_page @@ -73,7 +74,7 @@ async def test_scroll_scrollable_overflow( @pytest.mark.parametrize("delta_x, delta_y", [(0, 10), (5, 0), (5, 10)]) async def test_scroll_iframe( - bidi_session, setup_wheel_test, top_context, get_element, delta_x, delta_y + bidi_session, setup_wheel_test, top_context, get_element, delta_x, delta_y, wait_for_future_safe ): actions = Actions() @@ -85,7 +86,14 @@ async def test_scroll_iframe( await bidi_session.input.perform_actions( actions=actions, context=top_context["context"] ) + + # Chrome requires some time (~10-20ms) to process the event from the iframe, so we wait for it. + async def wait_for_events(_): + return len(await get_events(bidi_session, top_context["context"])) > 0 + + await AsyncPoll(bidi_session, timeout=0.5, interval=0.01, message='No wheel events emitted').until(wait_for_events) events = await get_events(bidi_session, top_context["context"]) + assert len(events) == 1 assert events[0]["type"] == "wheel" assert events[0]["deltaX"] == delta_x diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/get_realms/get_realms.py b/tests/wpt/tests/webdriver/tests/bidi/script/get_realms/get_realms.py index 4dfce5ab494..6e57e7266f0 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/get_realms/get_realms.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/get_realms/get_realms.py @@ -14,7 +14,6 @@ async def test_payload_types(bidi_session): recursive_compare( [ { - "context": any_string, "origin": any_string, "realm": any_string, "type": any_string, diff --git a/tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py b/tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py index 6d0f9ddb11f..1c9bf082270 100644 --- a/tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py +++ b/tests/wpt/tests/webdriver/tests/classic/perform_actions/wheel.py @@ -2,9 +2,10 @@ import pytest from webdriver.error import NoSuchWindowException - +import time from tests.classic.perform_actions.support.refine import get_events from tests.support.keys import Keys +from tests.support.sync import Poll def test_null_response_value(session, wheel_chain): @@ -55,7 +56,13 @@ def test_scroll_iframe(session, test_actions_scroll_page, wheel_chain): wheel_chain.scroll(0, 0, 5, 10, origin=target).perform() + # Chrome requires some time (~10-20ms) to process the event from the iframe, so we wait for it. + def wait_for_events(_): + return len(get_events(session)) > 0 + + Poll(session, timeout=0.5, interval=0.01, message='No wheel events found').until(wait_for_events) events = get_events(session) + assert len(events) == 1 assert events[0]["type"] == "wheel" assert events[0]["deltaX"] == 5 diff --git a/tests/wpt/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js b/tests/wpt/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js index 62ce16c93e4..96a20f1fe57 100644 --- a/tests/wpt/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js +++ b/tests/wpt/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js @@ -1,5 +1,6 @@ // META: title=test WebNN MLContext.compute() for ArrayBufferView created from bigger ArrayBuffer // META: global=window,dedicatedworker +// META: variant=?cpu // META: variant=?gpu // META: script=../resources/utils.js diff --git a/tests/wpt/tests/webnn/resources/test_data/gather.json b/tests/wpt/tests/webnn/resources/test_data/gather.json index a01654637f1..acd7ad8775e 100644 --- a/tests/wpt/tests/webnn/resources/test_data/gather.json +++ b/tests/wpt/tests/webnn/resources/test_data/gather.json @@ -50,6 +50,56 @@ "type": "float32" } }, + { + "name": "gather float32 1D tensor and int32 0D scalar indices default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + -66.05901336669922, + -68.9197006225586, + -77.02045440673828, + -26.158037185668945, + 89.0337142944336, + -45.89653396606445, + 43.84803771972656, + 48.81806945800781, + 51.79948425292969, + 41.94132614135742, + -1.1303654909133911, + -50.42131042480469, + 90.2870101928711, + 55.620765686035156, + 44.92119598388672, + 56.828636169433594, + 10.829925537109375, + -19.693084716796875, + -37.696800231933594, + 43.11057662963867, + 0.9129875898361206, + -7.699817180633545, + 25.76774024963379, + 73.60064697265625 + ], + "type": "float32" + }, + "indices": { + "shape": [], + "data": [ + 4 + ], + "type": "int32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 89.0337142944336 + ], + "type": "float32" + } + }, { "name": "gather float32 1D tensor and int64 0D scalar indices default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_l1.json b/tests/wpt/tests/webnn/resources/test_data/reduce_l1.json index c3f2b618e9b..7637c02be23 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_l1.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_l1.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceL1 float32 0D constant tensor default options", // default options: {axes: null, keepDimensions: false} + "inputs": { + "input": { + "shape": [], + "data": [ + 5.50882625579834 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 5.50882625579834, + "type": "float32" + } + }, + { + "name": "reduceL1 float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + 5.50882625579834 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": 5.50882625579834, + "type": "float32" + } + }, { "name": "reduceL1 float32 1D constant tensor all positive default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_l2.json b/tests/wpt/tests/webnn/resources/test_data/reduce_l2.json index d83eea9dfb9..b4d270a7019 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_l2.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_l2.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceL2 float32 0D constant tensor default options", // default options: {axes: null, keepDimensions: false} + "inputs": { + "input": { + "shape": [], + "data": [ + 4.860228061676025 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 4.860228061676025, + "type": "float32" + } + }, + { + "name": "reduceL2 float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + 4.860228061676025 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": 4.860228061676025, + "type": "float32" + } + }, { "name": "reduceL2 float32 1D constant tensor all positive default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum.json b/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum.json index 061e12ad516..f3de240e458 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceLogSum float32 0D constant tensor default options", // default options: {axes: null, keepDimensions: false} + "inputs": { + "input": { + "shape": [], + "data": [ + 64.54827117919922 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 4.167413234710693, + "type": "float32" + } + }, + { + "name": "reduceLogSum float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + 64.54827117919922 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": 4.167413234710693, + "type": "float32" + } + }, { "name": "reduceLogSum float32 1D constant tensor all non-negative default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum_exp.json b/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum_exp.json index 3577d6aa9ee..b999a567aa5 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum_exp.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_log_sum_exp.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceLogSumExp float32 0D constant tensor default options", // default options: {axes: null, keepDimensions: false} + "inputs": { + "input": { + "shape": [], + "data": [ + 0.7974132895469666 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 0.7974132895469666, + "type": "float32" + } + }, + { + "name": "reduceLogSumExp float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + 0.7974132895469666 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": 0.7974132895469666, + "type": "float32" + } + }, { "name": "reduceLogSumExp float32 1D constant tensor all positive default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_max.json b/tests/wpt/tests/webnn/resources/test_data/reduce_max.json index 11ed0ed9191..6cd55492692 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_max.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_max.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceMax float32 0D constant tensor default options", + "inputs": { + "input": { + "shape": [], + "data": [ + 32.16658401489258 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 32.16658401489258, + "type": "float32" + } + }, + { + "name": "reduceMax float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + 32.16658401489258 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": 32.16658401489258, + "type": "float32" + } + }, { "name": "reduceMax float32 1D constant tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_mean.json b/tests/wpt/tests/webnn/resources/test_data/reduce_mean.json index 8c26d0a5623..b990b0f93bb 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_mean.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_mean.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceMean float32 0D constant tensor default options", + "inputs": { + "input": { + "shape": [], + "data": [ + 95.84498596191406 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 95.84498596191406, + "type": "float32" + } + }, + { + "name": "reduceMean float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + 95.84498596191406 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": 95.84498596191406, + "type": "float32" + } + }, { "name": "reduceMean float32 1D constant tensor all positive default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_min.json b/tests/wpt/tests/webnn/resources/test_data/reduce_min.json index 6c26df5db16..4d91480bb95 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_min.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_min.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceMin float32 0D constant tensor default options", + "inputs": { + "input": { + "shape": [], + "data": [ + -58.76195526123047 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": -58.76195526123047, + "type": "float32" + } + }, + { + "name": "reduceMin float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + -58.76195526123047 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": -58.76195526123047, + "type": "float32" + } + }, { "name": "reduceMin float32 1D constant tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_product.json b/tests/wpt/tests/webnn/resources/test_data/reduce_product.json index d58af30ec1a..e9b2dc34c26 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_product.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_product.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceProduct float32 0D constant tensor default options", + "inputs": { + "input": { + "shape": [], + "data": [ + -68.75911712646484 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": -68.75911712646484, + "type": "float32" + } + }, + { + "name": "reduceProduct float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + -68.75911712646484 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": -68.75911712646484, + "type": "float32" + } + }, { "name": "reduceProduct float32 1D constant tensor default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_sum.json b/tests/wpt/tests/webnn/resources/test_data/reduce_sum.json index 7027d38b676..fd93e131b3e 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_sum.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_sum.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceSum float32 0D constant tensor default options", + "inputs": { + "input": { + "shape": [], + "data": [ + 69.6038589477539 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 69.6038589477539, + "type": "float32" + } + }, + { + "name": "reduceSum float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + 69.6038589477539 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": 69.6038589477539, + "type": "float32" + } + }, { "name": "reduceSum float32 1D constant tensor all positive default options", "inputs": { diff --git a/tests/wpt/tests/webnn/resources/test_data/reduce_sum_square.json b/tests/wpt/tests/webnn/resources/test_data/reduce_sum_square.json index bd2ebb341a7..d308cad463a 100644 --- a/tests/wpt/tests/webnn/resources/test_data/reduce_sum_square.json +++ b/tests/wpt/tests/webnn/resources/test_data/reduce_sum_square.json @@ -1,5 +1,44 @@ { "tests": [ + { + "name": "reduceSumSquare float32 0D constant tensor default options", + "inputs": { + "input": { + "shape": [], + "data": [ + 52.5615348815918 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "data": 2762.71484375, + "type": "float32" + } + }, + { + "name": "reduceSumSquare float32 0D constant tensor empty axes", + "inputs": { + "input": { + "shape": [], + "data": [ + 52.5615348815918 + ], + "type": "float32", + "constant": true + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "data": 2762.71484375, + "type": "float32" + } + }, { "name": "reduceSumSquare float32 1D constant tensor all positive default options", // default options: {axes: null, keepDimensions: false} "inputs": { diff --git a/tests/wpt/tests/webnn/resources/utils.js b/tests/wpt/tests/webnn/resources/utils.js index c231f46bcf5..0d3443b3dc9 100644 --- a/tests/wpt/tests/webnn/resources/utils.js +++ b/tests/wpt/tests/webnn/resources/utils.js @@ -274,9 +274,9 @@ const getReductionPrecisionTolerance = (resources, operationName) => { } else { sizes = inputShape; } - const reducedElementCount = sizes.reduce( - (accumulator, currentValue) => accumulator * currentValue - ); + const reducedElementCount = sizes.length ? + sizes.reduce((accumulator, currentValue) => accumulator * currentValue) : + 1; let tolerance; switch (operationName) { case 'reduceL1': diff --git a/tests/wpt/tests/webnn/resources/utils_validation.js b/tests/wpt/tests/webnn/resources/utils_validation.js index 5c4eb087617..35e634530d7 100644 --- a/tests/wpt/tests/webnn/resources/utils_validation.js +++ b/tests/wpt/tests/webnn/resources/utils_validation.js @@ -219,13 +219,15 @@ function validateTwoInputsBroadcastable(operationName) { const unbroadcastableDimensionsArray = generateUnbroadcastableDimensionsArray(dimensions); for (let unbroadcastableDimensions of unbroadcastableDimensionsArray) { const inputB = builder.input(`inputB${++inputBIndex}`, {dataType, dimensions: unbroadcastableDimensions}); - assert_throws_dom('DataError', () => builder[operationName](inputA, inputB)); - assert_throws_dom('DataError', () => builder[operationName](inputB, inputA)); + assert_throws_js( + TypeError, () => builder[operationName](inputA, inputB)); + assert_throws_js( + TypeError, () => builder[operationName](inputB, inputA)); } } } } - }, `[${operationName}] DataError is expected if two inputs aren't broadcastable`); + }, `[${operationName}] TypeError is expected if two inputs aren't broadcastable`); } function validateTwoInputsOfSameDataType(operationName) { @@ -248,12 +250,13 @@ function validateTwoInputsOfSameDataType(operationName) { for (let dataTypeB of allWebNNOperandDataTypes) { if (dataType !== dataTypeB) { const inputB = builder.input(`inputB${++inputBIndex}`, {dataType: dataTypeB, dimensions}); - assert_throws_dom('DataError', () => builder[subOperationName](inputA, inputB)); + assert_throws_js( + TypeError, () => builder[subOperationName](inputA, inputB)); } } } } - }, `[${subOperationName}] DataError is expected if two inputs aren't of same data type`); + }, `[${subOperationName}] TypeError is expected if two inputs aren't of same data type`); } } diff --git a/tests/wpt/tests/webnn/validation_tests/elementwise-binary.https.any.js b/tests/wpt/tests/webnn/validation_tests/elementwise-binary.https.any.js index f54626b50db..7b3fec938bb 100644 --- a/tests/wpt/tests/webnn/validation_tests/elementwise-binary.https.any.js +++ b/tests/wpt/tests/webnn/validation_tests/elementwise-binary.https.any.js @@ -14,8 +14,64 @@ const kElementwiseBinaryOperators = [ 'pow', ]; + +const tests = [ + { + name: '[binary] Test bidirectionally broadcastable dimensions.', + // Both inputs have axes of length one which are expanded + // during broadcasting. + a: {dataType: 'float32', dimensions: [8, 1, 6, 1]}, + b: {dataType: 'float32', dimensions: [7, 1, 5]}, + output: {dataType: 'float32', dimensions: [8, 7, 6, 5]} + }, + { + name: '[binary] Test unidirectionally broadcastable dimensions.', + // Input a has a single axis of length one which is + // expanded during broadcasting. + a: {dataType: 'float32', dimensions: [4, 2, 1]}, + b: {dataType: 'float32', dimensions: [4]}, + output: {dataType: 'float32', dimensions: [4, 2, 4]} + }, + { + name: '[binary] Test scalar broadcasting.', + a: {dataType: 'float32', dimensions: [4, 2, 4]}, + b: {dataType: 'float32', dimensions: []}, + output: {dataType: 'float32', dimensions: [4, 2, 4]} + }, + { + name: '[binary] Throw if the input shapes are not broadcastable.', + a: {dataType: 'float32', dimensions: [4, 2]}, + b: {dataType: 'float32', dimensions: [4]}, + }, + { + name: '[binary] Throw if the input types don\'t match.', + a: {dataType: 'float32', dimensions: [4, 2]}, + b: {dataType: 'int32', dimensions: [1]}, + }, +]; + +function runElementWiseBinaryTests(operatorName, tests) { + tests.forEach(test => { + promise_test(async t => { + const a = builder.input( + 'a', {dataType: test.a.dataType, dimensions: test.a.dimensions}); + const b = builder.input( + 'b', {dataType: test.b.dataType, dimensions: test.b.dimensions}); + + if (test.output) { + const output = builder[operatorName](a, b); + assert_equals(output.dataType(), test.output.dataType); + assert_array_equals(output.shape(), test.output.dimensions); + } else { + assert_throws_js(TypeError, () => builder[operatorName](a, b)); + } + }, test.name.replace('[binary]', `[${operatorName}]`)); + }); +} + kElementwiseBinaryOperators.forEach((operatorName) => { validateTwoInputsOfSameDataType(operatorName); validateTwoInputsBroadcastable(operatorName); validateTwoInputsFromMultipleBuilders(operatorName); + runElementWiseBinaryTests(operatorName, tests); }); diff --git a/tests/wpt/tests/webnn/validation_tests/elementwise-logical.https.any copy.js b/tests/wpt/tests/webnn/validation_tests/elementwise-logical.https.any.js similarity index 100% rename from tests/wpt/tests/webnn/validation_tests/elementwise-logical.https.any copy.js rename to tests/wpt/tests/webnn/validation_tests/elementwise-logical.https.any.js diff --git a/tests/wpt/tests/webnn/validation_tests/gather.https.any.js b/tests/wpt/tests/webnn/validation_tests/gather.https.any.js index 184e8033e66..668112cc10f 100644 --- a/tests/wpt/tests/webnn/validation_tests/gather.https.any.js +++ b/tests/wpt/tests/webnn/validation_tests/gather.https.any.js @@ -8,7 +8,7 @@ const tests = [ { name: '[gather] Test gather with default options and 0-D indices', input: {dataType: 'int32', dimensions: [3]}, - indices: {dataType: 'uint64', dimensions: []}, + indices: {dataType: 'int64', dimensions: []}, output: {dataType: 'int32', dimensions: []} }, { @@ -24,13 +24,15 @@ const tests = [ indices: {dataType: 'int64', dimensions: [1]} }, { - name: '[gather] TypeError is expected if the axis is greater than the rank of input', + name: + '[gather] TypeError is expected if the axis is greater than the rank of input', input: {dataType: 'float16', dimensions: [1, 2, 3]}, indices: {dataType: 'int32', dimensions: [5, 6]}, axis: 4 }, { - name: '[gather] TypeError is expected if the data type of indices is invalid', + name: + '[gather] TypeError is expected if the data type of indices is invalid', input: {dataType: 'float16', dimensions: [1, 2, 3, 4]}, indices: {dataType: 'float32', dimensions: [5, 6]} } diff --git a/tests/wpt/tests/webrtc-extensions/RTCRtpParameters-codec.html b/tests/wpt/tests/webrtc-extensions/RTCRtpParameters-codec.html index 5fc1401badf..a93e028e6f6 100644 --- a/tests/wpt/tests/webrtc-extensions/RTCRtpParameters-codec.html +++ b/tests/wpt/tests/webrtc-extensions/RTCRtpParameters-codec.html @@ -292,13 +292,13 @@ const opus = findFirstCodec('audio/opus'); const nonOpus = codecsNotMatching(opus.mimeType); - pc2.ontrack = e => { - e.transceiver.setCodecPreferences(nonOpus); - }; const transceiver = pc1.addTransceiver('audio'); exchangeIceCandidates(pc1, pc2); - await exchangeOfferAnswer(pc1, pc2); + const negotiated = exchangeOfferAnswer(pc1, pc2); + const trackEvent = await new Promise(r => pc2.ontrack = r); + trackEvent.transceiver.setCodecPreferences(nonOpus); + await negotiated; const sender = transceiver.sender; let param = sender.getParameters(); @@ -316,13 +316,13 @@ const vp8 = findFirstCodec('video/VP8'); const nonVP8 = codecsNotMatching(vp8.mimeType); - pc2.ontrack = e => { - e.transceiver.setCodecPreferences(nonVP8); - }; const transceiver = pc1.addTransceiver('video'); exchangeIceCandidates(pc1, pc2); - await exchangeOfferAnswer(pc1, pc2); + const negotiated = exchangeOfferAnswer(pc1, pc2); + const trackEvent = await new Promise(r => pc2.ontrack = r); + trackEvent.transceiver.setCodecPreferences(nonVP8); + await negotiated; const sender = transceiver.sender; let param = sender.getParameters(); @@ -340,14 +340,14 @@ const opus = findFirstCodec('audio/opus'); const nonOpus = codecsNotMatching(opus.mimeType); - pc2.ontrack = e => { - e.transceiver.setCodecPreferences(nonOpus); - }; const transceiver = pc1.addTransceiver('audio'); exchangeIceCandidates(pc1, pc2); - await exchangeOfferAnswer(pc1, pc2); + const negotiated = exchangeOfferAnswer(pc1, pc2); + const trackEvent = await new Promise(r => pc2.ontrack = r); + trackEvent.transceiver.setCodecPreferences(nonOpus); + await negotiated; const sender = transceiver.sender; let param = sender.getParameters(); @@ -365,13 +365,13 @@ const vp8 = findFirstCodec('video/VP8'); const nonVP8 = codecsNotMatching(vp8.mimeType); - pc2.ontrack = e => { - e.transceiver.setCodecPreferences(nonVP8); - }; const transceiver = pc1.addTransceiver('video'); exchangeIceCandidates(pc1, pc2); - await exchangeOfferAnswer(pc1, pc2); + const negotiated = exchangeOfferAnswer(pc1, pc2); + const trackEvent = await new Promise(r => pc2.ontrack = r); + trackEvent.transceiver.setCodecPreferences(nonVP8); + await negotiated; const sender = transceiver.sender; let param = sender.getParameters(); @@ -452,15 +452,16 @@ const opus = findFirstCodec('audio/opus'); const nonOpus = codecsNotMatching(opus.mimeType); - pc2.ontrack = e => { - e.transceiver.setCodecPreferences(nonOpus.concat([opus])); - }; const transceiver = pc1.addTransceiver(stream.getTracks()[0]); const sender = transceiver.sender; exchangeIceCandidates(pc1, pc2); - await exchangeOfferAnswer(pc1, pc2); + const negotiated = exchangeOfferAnswer(pc1, pc2); + const trackEvent = await new Promise(r => pc2.ontrack = r); + trackEvent.transceiver.setCodecPreferences(nonOpus.concat([opus])); + await negotiated; + let codecs = await codecsForSender(sender); assert_not_equals(codecs[0], opus.mimeType); @@ -490,15 +491,15 @@ const vp8 = findFirstCodec('video/VP8'); const nonVP8 = codecsNotMatching(vp8.mimeType); - pc2.ontrack = e => { - e.transceiver.setCodecPreferences(nonVP8.concat([vp8])); - }; const transceiver = pc1.addTransceiver(stream.getTracks()[0]); const sender = transceiver.sender; exchangeIceCandidates(pc1, pc2); - await exchangeOfferAnswer(pc1, pc2); + const negotiated = exchangeOfferAnswer(pc1, pc2); + const trackEvent = await new Promise(r => pc2.ontrack = r); + trackEvent.transceiver.setCodecPreferences(nonVP8.concat([vp8])); + await negotiated; let codecs = await codecsForSender(sender); assert_not_equals(codecs[0], vp8.mimeType); @@ -528,16 +529,17 @@ const vp8 = findFirstCodec('video/VP8'); const h264 = findFirstCodec('video/H264'); - pc2.ontrack = e => { - e.transceiver.setCodecPreferences([h264, vp8]); - }; + const transceiver = pc1.addTransceiver(stream.getTracks()[0], { sendEncodings: [{rid: '0'}, {rid: '1'}, {rid: '2'}], }); const sender = transceiver.sender; exchangeIceCandidates(pc1, pc2); - await doOfferToSendSimulcastAndAnswer(pc1, pc2, ['0', '1', '2']); + const negotiated = doOfferToSendSimulcastAndAnswer(pc1, pc2, ['0', '1', '2']); + const trackEvent = await new Promise(r => pc2.ontrack = r); + trackEvent.transceiver.setCodecPreferences([h264, vp8]); + await negotiated; await waitForAllLayers(t, sender); @@ -573,9 +575,6 @@ const vp8 = findFirstCodec('video/VP8'); const h264 = findFirstCodec('video/H264'); - pc2.ontrack = e => { - e.transceiver.setCodecPreferences([h264, vp8]); - }; const transceiver = pc1.addTransceiver(stream.getTracks()[0], { sendEncodings: [{rid: '0'}, {rid: '1'}, {rid: '2'}], @@ -583,7 +582,11 @@ const sender = transceiver.sender; exchangeIceCandidates(pc1, pc2); - await doOfferToSendSimulcastAndAnswer(pc1, pc2, ['0', '1', '2']); + const negotiated = doOfferToSendSimulcastAndAnswer(pc1, pc2, ['0', '1', '2']); + const trackEvent = await new Promise(r => pc2.ontrack = r); + trackEvent.transceiver.setCodecPreferences([h264, vp8]); + await negotiated; + await waitForAllLayers(t, sender); diff --git a/tests/wpt/tests/webxr/webxr-supported-by-feature-policy.html b/tests/wpt/tests/webxr/webxr-supported-by-feature-policy.html deleted file mode 100644 index 2843849a34a..00000000000 --- a/tests/wpt/tests/webxr/webxr-supported-by-feature-policy.html +++ /dev/null @@ -1,10 +0,0 @@ - -Test that xr is advertised in the feature list - - - - diff --git a/tests/wpt/tests/workers/WorkerGlobalScope_requestAnimationFrame.tentative.worker.js b/tests/wpt/tests/workers/WorkerGlobalScope_requestAnimationFrame.worker.js similarity index 100% rename from tests/wpt/tests/workers/WorkerGlobalScope_requestAnimationFrame.tentative.worker.js rename to tests/wpt/tests/workers/WorkerGlobalScope_requestAnimationFrame.worker.js