diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-002.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-002.html.ini index 5f0d16e9286..c3b8af7cb96 100644 --- a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-002.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-002.html.ini @@ -1,2 +1,51 @@ [align-content-block-002.html] - expected: FAIL + [.test 1: start] + expected: FAIL + + [.test 2: center] + expected: FAIL + + [.test 3: end] + expected: FAIL + + [.test 4: baseline] + expected: FAIL + + [.test 5: last baseline] + expected: FAIL + + [.test 6: flex-start] + expected: FAIL + + [.test 7: flex-end] + expected: FAIL + + [.test 8: unsafe start] + expected: FAIL + + [.test 9: unsafe center] + expected: FAIL + + [.test 10: unsafe end] + expected: FAIL + + [.test 11: safe start] + expected: FAIL + + [.test 12: safe center] + expected: FAIL + + [.test 13: safe end] + expected: FAIL + + [.test 14: space-evenly] + expected: FAIL + + [.test 15: space-between] + expected: FAIL + + [.test 16: space-around] + expected: FAIL + + [.test 17: normal] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-003.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-003.html.ini index c1bb4746647..e3984954251 100644 --- a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-003.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-003.html.ini @@ -1,2 +1,51 @@ [align-content-block-003.html] - expected: FAIL + [.test 1: start] + expected: FAIL + + [.test 2: center] + expected: FAIL + + [.test 3: end] + expected: FAIL + + [.test 4: baseline] + expected: FAIL + + [.test 5: last baseline] + expected: FAIL + + [.test 6: flex-start] + expected: FAIL + + [.test 7: flex-end] + expected: FAIL + + [.test 8: unsafe start] + expected: FAIL + + [.test 9: unsafe center] + expected: FAIL + + [.test 10: unsafe end] + expected: FAIL + + [.test 11: safe start] + expected: FAIL + + [.test 12: safe center] + expected: FAIL + + [.test 13: safe end] + expected: FAIL + + [.test 14: space-evently] + expected: FAIL + + [.test 15: space-between] + expected: FAIL + + [.test 16: space-around] + expected: FAIL + + [.test 17: normal] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-004.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-004.html.ini index 229571e9dfa..c5c745adf80 100644 --- a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-004.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-004.html.ini @@ -1,2 +1,48 @@ [align-content-block-004.html] - expected: FAIL + [.test 1: start] + expected: FAIL + + [.test 2: center] + expected: FAIL + + [.test 3: end] + expected: FAIL + + [.test 4: baseline] + expected: FAIL + + [.test 5: last baseline] + expected: FAIL + + [.test 6: flex-start] + expected: FAIL + + [.test 7: flex-end] + expected: FAIL + + [.test 8: unsafe start] + expected: FAIL + + [.test 9: unsafe center] + expected: FAIL + + [.test 10: unsafe end] + expected: FAIL + + [.test 11: safe start] + expected: FAIL + + [.test 12: safe center] + expected: FAIL + + [.test 13: safe end] + expected: FAIL + + [.test 14: space-evenly] + expected: FAIL + + [.test 15: space-between] + expected: FAIL + + [.test 16: space-around] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-005.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-005.html.ini index 5fe5827c538..b614323968d 100644 --- a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-005.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-005.html.ini @@ -1,2 +1,48 @@ [align-content-block-005.html] - expected: FAIL + [.test 1: start] + expected: FAIL + + [.test 2: center] + expected: FAIL + + [.test 3: end] + expected: FAIL + + [.test 4: baseline] + expected: FAIL + + [.test 5: last baseline] + expected: FAIL + + [.test 6: flex-start] + expected: FAIL + + [.test 7: flex-end] + expected: FAIL + + [.test 8: unsafe start] + expected: FAIL + + [.test 9: unsafe center] + expected: FAIL + + [.test 10: unsafe end] + expected: FAIL + + [.test 11: safe start] + expected: FAIL + + [.test 12: safe center] + expected: FAIL + + [.test 13: safe end] + expected: FAIL + + [.test 14: space-evenly] + expected: FAIL + + [.test 15: space-between] + expected: FAIL + + [.test 16: space-around] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-007.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-007.html.ini index 1311a1028d4..cb515ba2868 100644 --- a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-007.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-007.html.ini @@ -1,2 +1,48 @@ [align-content-block-007.html] - expected: TIMEOUT + [.test 1: start] + expected: FAIL + + [.test 2: center] + expected: FAIL + + [.test 3: end] + expected: FAIL + + [.test 4: baseline] + expected: FAIL + + [.test 5: last baseline] + expected: FAIL + + [.test 6: flex-start] + expected: FAIL + + [.test 7: flex-end] + expected: FAIL + + [.test 8: unsafe start] + expected: FAIL + + [.test 9: unsafe center] + expected: FAIL + + [.test 10: unsafe end] + expected: FAIL + + [.test 11: safe start] + expected: FAIL + + [.test 12: safe center] + expected: FAIL + + [.test 13: safe end] + expected: FAIL + + [.test 14: space-evenly] + expected: FAIL + + [.test 15: space-between] + expected: FAIL + + [.test 16: space-around] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-008.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-008.html.ini index 561a9cca389..e5926f3ca56 100644 --- a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-008.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-008.html.ini @@ -1,2 +1,48 @@ [align-content-block-008.html] - expected: TIMEOUT + [.test 1: start] + expected: FAIL + + [.test 2: center] + expected: FAIL + + [.test 3: end] + expected: FAIL + + [.test 4: baseline] + expected: FAIL + + [.test 5: last baseline] + expected: FAIL + + [.test 6: flex-start] + expected: FAIL + + [.test 7: flex-end] + expected: FAIL + + [.test 8: unsafe start] + expected: FAIL + + [.test 9: unsafe center] + expected: FAIL + + [.test 10: unsafe end] + expected: FAIL + + [.test 11: safe start] + expected: FAIL + + [.test 12: safe center] + expected: FAIL + + [.test 13: safe end] + expected: FAIL + + [.test 14: space-evenly] + expected: FAIL + + [.test 15: space-between] + expected: FAIL + + [.test 16: space-around] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-009.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-009.html.ini index 0d75e4f3a29..697afae1fc8 100644 --- a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-009.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-009.html.ini @@ -1,2 +1,48 @@ [align-content-block-009.html] - expected: TIMEOUT + [.test 1: start] + expected: FAIL + + [.test 2: center] + expected: FAIL + + [.test 3: end] + expected: FAIL + + [.test 4: baseline] + expected: FAIL + + [.test 5: last baseline] + expected: FAIL + + [.test 6: flex-start] + expected: FAIL + + [.test 7: flex-end] + expected: FAIL + + [.test 8: unsafe start] + expected: FAIL + + [.test 9: unsafe center] + expected: FAIL + + [.test 10: unsafe end] + expected: FAIL + + [.test 11: safe start] + expected: FAIL + + [.test 12: safe center] + expected: FAIL + + [.test 13: safe end] + expected: FAIL + + [.test 14: space-evenly] + expected: FAIL + + [.test 15: space-between] + expected: FAIL + + [.test 16: space-around] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-010.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-010.html.ini index cccd55e5e31..f6602527850 100644 --- a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-010.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-010.html.ini @@ -1,2 +1,48 @@ [align-content-block-010.html] - expected: TIMEOUT + [.test 1: start] + expected: FAIL + + [.test 2: center] + expected: FAIL + + [.test 3: end] + expected: FAIL + + [.test 4: baseline] + expected: FAIL + + [.test 5: last baseline] + expected: FAIL + + [.test 6: flex-start] + expected: FAIL + + [.test 7: flex-end] + expected: FAIL + + [.test 8: unsafe start] + expected: FAIL + + [.test 9: unsafe center] + expected: FAIL + + [.test 10: unsafe end] + expected: FAIL + + [.test 11: safe start] + expected: FAIL + + [.test 12: safe center] + expected: FAIL + + [.test 13: safe end] + expected: FAIL + + [.test 14: space-evenly] + expected: FAIL + + [.test 15: space-between] + expected: FAIL + + [.test 16: space-around] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-011.html.ini b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-011.html.ini index cf02c4422cc..086df1d9746 100644 --- a/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-011.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-align/blocks/align-content-block-011.html.ini @@ -1,2 +1,48 @@ [align-content-block-011.html] - expected: TIMEOUT + [.test 1: start] + expected: FAIL + + [.test 2: center] + expected: FAIL + + [.test 3: end] + expected: FAIL + + [.test 4: baseline] + expected: FAIL + + [.test 5: last baseline] + expected: FAIL + + [.test 6: flex-start] + expected: FAIL + + [.test 7: flex-end] + expected: FAIL + + [.test 8: unsafe start] + expected: FAIL + + [.test 9: unsafe center] + expected: FAIL + + [.test 10: unsafe end] + expected: FAIL + + [.test 11: safe start] + expected: FAIL + + [.test 12: safe center] + expected: FAIL + + [.test 13: safe end] + expected: FAIL + + [.test 14: space-evenly] + expected: FAIL + + [.test 15: space-between] + expected: FAIL + + [.test 16: space-around] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-color-mix-function.html.ini b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-color-mix-function.html.ini index d39fd6878db..10a96f587e9 100644 --- a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-color-mix-function.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-color-mix-function.html.ini @@ -2008,3 +2008,15 @@ [Property color value 'color-mix(in xyz-d65, color(xyz-d65 .1 .2 .3 / 25%) 0%, color(xyz-d65 0.5 none none / 50%))'] expected: FAIL + + [Property color value 'color-mix(in hsl shorter hue, hsl(60deg 50% 50%), hsl(60deg 50% 50%))'] + expected: FAIL + + [Property color value 'color-mix(in hsl longer hue, hsl(60deg 50% 50%), hsl(60deg 50% 50%))'] + expected: FAIL + + [Property color value 'color-mix(in hsl increasing hue, hsl(60deg 50% 50%), hsl(60deg 50% 50%))'] + expected: FAIL + + [Property color value 'color-mix(in hsl decreasing hue, hsl(60deg 50% 50%), hsl(60deg 50% 50%))'] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-relative-color.html.ini b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-relative-color.html.ini index 4bdb4add61a..53aa01a0c08 100644 --- a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-relative-color.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-valid-relative-color.html.ini @@ -3205,3 +3205,33 @@ [e.style['color'\] = "color(from currentColor xyz-d65 x y z)" should set the property value] expected: FAIL + + [e.style['color'\] = "lab(from lab(50 -30 40) calc(l - 20) a b)" should set the property value] + expected: FAIL + + [e.style['color'\] = "lab(from lab(50 -30 40) l calc(a / 3) calc(b / 2))" should set the property value] + expected: FAIL + + [e.style['color'\] = "oklab(from oklab(0.7 0.25 -0.15) calc(l - 0.2) a b)" should set the property value] + expected: FAIL + + [e.style['color'\] = "oklab(from oklab(0.7 0.25 -0.15) l calc(a / 2) calc(b / 3))" should set the property value] + expected: FAIL + + [e.style['color'\] = "lch(from lch(50 100 300) calc(l - 20) c h)" should set the property value] + expected: FAIL + + [e.style['color'\] = "lch(from lch(50 100 300) l calc(c / 2) h)" should set the property value] + expected: FAIL + + [e.style['color'\] = "lch(from lch(50 100 300) l c calc(h * 2.5))" should set the property value] + expected: FAIL + + [e.style['color'\] = "oklch(from oklch(0.7 0.2 300) calc(l - 0.2) c h)" should set the property value] + expected: FAIL + + [e.style['color'\] = "oklch(from oklch(0.7 0.2 300) l calc(c / 2) h)" should set the property value] + expected: FAIL + + [e.style['color'\] = "oklch(from oklch(0.7 0.2 300) l c calc(h * 2.5))" should set the property value] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-flexbox/svg-root-as-flex-item-006.html.ini b/tests/wpt/meta-legacy-layout/css/css-flexbox/svg-root-as-flex-item-006.html.ini index 6f5b9e95ccc..7d9a4e7a9c7 100644 --- a/tests/wpt/meta-legacy-layout/css/css-flexbox/svg-root-as-flex-item-006.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-flexbox/svg-root-as-flex-item-006.html.ini @@ -1,3 +1,6 @@ [svg-root-as-flex-item-006.html] [svg 1] expected: FAIL + + [svg 1: undefined] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-paint-api/hidpi/canvas-reset.https.html.ini b/tests/wpt/meta-legacy-layout/css/css-paint-api/hidpi/canvas-reset.https.html.ini new file mode 100644 index 00000000000..d01b6efdc5d --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-paint-api/hidpi/canvas-reset.https.html.ini @@ -0,0 +1,2 @@ +[canvas-reset.https.html] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-ui/outline-auto-width-001.html.ini b/tests/wpt/meta-legacy-layout/css/css-ui/outline-auto-width-001.html.ini deleted file mode 100644 index 8f0a06ac917..00000000000 --- a/tests/wpt/meta-legacy-layout/css/css-ui/outline-auto-width-001.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[outline-auto-width-001.html] - expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-ui/outline-color-002.html.ini b/tests/wpt/meta-legacy-layout/css/css-ui/outline-color-002.html.ini new file mode 100644 index 00000000000..e5949d14ee8 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-ui/outline-color-002.html.ini @@ -0,0 +1,2 @@ +[outline-color-002.html] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-ui/outline-color-003.html.ini b/tests/wpt/meta-legacy-layout/css/css-ui/outline-color-003.html.ini new file mode 100644 index 00000000000..b50b529ae67 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-ui/outline-color-003.html.ini @@ -0,0 +1,2 @@ +[outline-color-003.html] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-ui/outline-color-004.html.ini b/tests/wpt/meta-legacy-layout/css/css-ui/outline-color-004.html.ini new file mode 100644 index 00000000000..8e9ee858a4d --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-ui/outline-color-004.html.ini @@ -0,0 +1,2 @@ +[outline-color-004.html] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-values/signs-abs-computed.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/signs-abs-computed.html.ini index 0f388bd5995..700fc02cfe6 100644 --- a/tests/wpt/meta-legacy-layout/css/css-values/signs-abs-computed.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-values/signs-abs-computed.html.ini @@ -721,3 +721,24 @@ [abs(NaN) should be used-value-equivalent to calc(NaN)] expected: FAIL + + [calc(20 - abs(-10)) should be used-value-equivalent to 10] + expected: FAIL + + [calc(20 - abs(10)) should be used-value-equivalent to 10] + expected: FAIL + + [calc(10 - abs(10 - abs(-30)) should be used-value-equivalent to -10] + expected: FAIL + + [calc(2 - sign(1)) should be used-value-equivalent to 1] + expected: FAIL + + [calc(2 - sign(-1)) should be used-value-equivalent to 3] + expected: FAIL + + [calc(2 - sign(1 - sign(-1))) should be used-value-equivalent to 1] + expected: FAIL + + [calc(10 - abs(20 - sign(2 - abs(-20)))) should be used-value-equivalent to -11] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-values/sin-cos-tan-computed.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/sin-cos-tan-computed.html.ini index 019fa978111..a7f10b1e2b9 100644 --- a/tests/wpt/meta-legacy-layout/css/css-values/sin-cos-tan-computed.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-values/sin-cos-tan-computed.html.ini @@ -49,3 +49,12 @@ [calc(sin(tan(pi/4)*pi/2) ) should be used-value-equivalent to 1] expected: FAIL + + [tan(315deg) should be used-value-equivalent to -1] + expected: FAIL + + [tan(360deg) should be used-value-equivalent to 0] + expected: FAIL + + [tan(405deg) should be used-value-equivalent to 1] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini b/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini index 314dca9c1f5..d52a3e77a70 100644 --- a/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini +++ b/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini @@ -1,3 +1,6 @@ [MediaQueryList-addListener-removeListener.html] [listeners are called when + + + - - - diff --git a/tests/wpt/tests/browsing-topics/xhr-topics.tentative.https.html b/tests/wpt/tests/browsing-topics/xhr-topics.tentative.https.html deleted file mode 100644 index fcca74a1ce5..00000000000 --- a/tests/wpt/tests/browsing-topics/xhr-topics.tentative.https.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - diff --git a/tests/wpt/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html b/tests/wpt/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html deleted file mode 100644 index 47bc1049e4c..00000000000 --- a/tests/wpt/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - diff --git a/tests/wpt/tests/compute-pressure/compute_pressure_factors.tentative.https.any.js b/tests/wpt/tests/compute-pressure/compute_pressure_factors.tentative.https.any.js deleted file mode 100644 index 60d38d3f336..00000000000 --- a/tests/wpt/tests/compute-pressure/compute_pressure_factors.tentative.https.any.js +++ /dev/null @@ -1,19 +0,0 @@ -// META: script=/resources/test-only-api.js -// META: script=resources/pressure-helpers.js -// META: global=window,dedicatedworker,sharedworker - -'use strict'; - -pressure_test(async (t, mockPressureService) => { - const changes = await new Promise(resolve => { - const observer = new PressureObserver(resolve); - t.add_cleanup(() => observer.disconnect()); - observer.observe('cpu'); - mockPressureService.setPressureUpdate('cpu', 'critical'); - mockPressureService.startPlatformCollector(/*sampleRate=*/ 5.0); - }); - assert_true(changes.length === 1); - assert_equals(changes[0].state, 'critical'); - assert_equals(changes[0].source, 'cpu'); - assert_equals(typeof changes[0].time, 'number'); -}, 'Basic factors functionality test'); diff --git a/tests/wpt/tests/content-security-policy/embedded-enforcement/subsumption_algorithm-unsafe_inline.html b/tests/wpt/tests/content-security-policy/embedded-enforcement/subsumption_algorithm-unsafe_inline.html index 4b839209c65..5b87c60b62a 100644 --- a/tests/wpt/tests/content-security-policy/embedded-enforcement/subsumption_algorithm-unsafe_inline.html +++ b/tests/wpt/tests/content-security-policy/embedded-enforcement/subsumption_algorithm-unsafe_inline.html @@ -2,9 +2,12 @@ Embedded Enforcement: Subsumption Algorithm - 'unsafe-inline' keyword. + + + diff --git a/tests/wpt/tests/credential-management/fedcm-revoke.https.html b/tests/wpt/tests/credential-management/fedcm-revoke.https.html deleted file mode 100644 index fb631978af6..00000000000 --- a/tests/wpt/tests/credential-management/fedcm-revoke.https.html +++ /dev/null @@ -1,37 +0,0 @@ - -Federated Credential Management API revoke() tests. - - - - - - - - - diff --git a/tests/wpt/tests/credential-management/fedcm-revoke.sub.https.html b/tests/wpt/tests/credential-management/fedcm-revoke.sub.https.html new file mode 100644 index 00000000000..b16c0162de3 --- /dev/null +++ b/tests/wpt/tests/credential-management/fedcm-revoke.sub.https.html @@ -0,0 +1,81 @@ + +Federated Credential Management API revoke() tests. + + + + + + + + + diff --git a/tests/wpt/tests/credential-management/support/fedcm-helper.sub.js b/tests/wpt/tests/credential-management/support/fedcm-helper.sub.js index 319dc08c350..8c3a52c5b22 100644 --- a/tests/wpt/tests/credential-management/support/fedcm-helper.sub.js +++ b/tests/wpt/tests/credential-management/support/fedcm-helper.sub.js @@ -225,3 +225,16 @@ credential-management/support/fedcm/${manifest_filename}`; accountHint: accountHint }; } + +export function alt_revoke_options(accountHint, manifest_filename) { + if (manifest_filename === undefined) { + manifest_filename = "manifest.py"; + } + const manifest_path = `${alt_manifest_origin}/\ +credential-management/support/fedcm/${manifest_filename}`; + return { + configURL: manifest_path, + clientId: '1', + accountHint: accountHint + }; +} diff --git a/tests/wpt/tests/credential-management/support/fedcm/revoke.py b/tests/wpt/tests/credential-management/support/fedcm/revoke.py index 3b06526353c..cf62ceda225 100644 --- a/tests/wpt/tests/credential-management/support/fedcm/revoke.py +++ b/tests/wpt/tests/credential-management/support/fedcm/revoke.py @@ -2,12 +2,13 @@ import importlib error_checker = importlib.import_module("credential-management.support.fedcm.request-params-check") def main(request, response): + response.headers.set(b"Content-Type", b"application/json") + response.headers.set(b"Access-Control-Allow-Origin", request.headers.get(b"origin")) + response.headers.set(b"Access-Control-Allow-Credentials", b"true") request_error = error_checker.revokeCheck(request) - if (request_error): + if request_error: return request_error - response.headers.set(b"Content-Type", b"application/json") - # Pass the account_hint as the accountId. - account_hint = request.POST.get(b"account_hint"); + account_hint = request.POST.get(b"account_hint") return f"{{\"account_id\": \"{account_hint}\"}}" diff --git a/tests/wpt/tests/credential-management/support/set_cookie.headers b/tests/wpt/tests/credential-management/support/set_cookie.headers index cf5ea7fff91..b19ff933a6f 100644 --- a/tests/wpt/tests/credential-management/support/set_cookie.headers +++ b/tests/wpt/tests/credential-management/support/set_cookie.headers @@ -1,2 +1,2 @@ Content-Type: text/html -Set-Cookie: cookie=1; SameSite=Strict; Secure +Set-Cookie: cookie=1; SameSite=None; Secure diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-002-ref.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-002-ref.html deleted file mode 100644 index d7bde74e9eb..00000000000 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-002-ref.html +++ /dev/null @@ -1,231 +0,0 @@ - -CSS Box Alignment: align-content on large block container - - - - - - -
-
-
-
- START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- BASELINE - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- LAST BASELINE - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- FLEX-START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- FLEX-END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- UNSAFE START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- UNSAFE CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- UNSAFE END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SAFE START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SAFE CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SAFE END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SPACE-EVENLY - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SPACE-BETWEEN - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SPACE-AROUND - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- NORMAL - ABS - REL -
OVERFLOW
-
-
-
- -

- diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-002.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-002.html index bad174d86f7..795872e20b7 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-002.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-002.html @@ -2,7 +2,9 @@ CSS Box Alignment: align-content on large block container - + + + +

-
-
+
+
START - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
CENTER - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
END - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
BASELINE - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
LAST BASELINE - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
FLEX-START - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
FLEX-END - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
UNSAFE START - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
UNSAFE CENTER - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
UNSAFE END - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SAFE START - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SAFE CENTER - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SAFE END - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SPACE-EVENLY - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SPACE-BETWEEN - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SPACE-AROUND - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
NORMAL - ABS - REL + ABS + REL
OVERFLOW
@@ -227,3 +230,4 @@

+ diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-003-ref.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-003-ref.html deleted file mode 100644 index 34414804bfa..00000000000 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-003-ref.html +++ /dev/null @@ -1,230 +0,0 @@ - -CSS Box Alignment: align-content on small block container - - - - - - -

-
-
-
- START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- BASELINE - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- LAST BASELINE - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- FLEX-START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- FLEX-END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- UNSAFE START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- UNSAFE CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- UNSAFE END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SAFE START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SAFE CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SAFE END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SPACE-EVENLY - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SPACE-BETWEEN - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- SPACE-AROUND - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
- NORMAL - ABS - REL -
OVERFLOW
-
-
-
- -

- diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-003.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-003.html index 9356d2a3ff5..2f3fea9be3a 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-003.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-003.html @@ -2,7 +2,9 @@ CSS Box Alignment: align-content on small block container - + + + +

-
-
+
+
START - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
CENTER - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
END - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
BASELINE - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
LAST BASELINE - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
FLEX-START - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
FLEX-END - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
UNSAFE START - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
UNSAFE CENTER - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
UNSAFE END - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SAFE START - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SAFE CENTER - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SAFE END - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SPACE-EVENLY - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SPACE-BETWEEN - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
SPACE-AROUND - ABS - REL + ABS + REL
OVERFLOW
-
-
+
+
NORMAL - ABS - REL + ABS + REL
OVERFLOW
@@ -227,3 +230,4 @@

+ diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-004-ref.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-004-ref.html deleted file mode 100644 index ba1182b643d..00000000000 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-004-ref.html +++ /dev/null @@ -1,264 +0,0 @@ - -CSS Box Alignment: align-content on large block container with floats - - - - - - -

-
-
FLT
-
-
-
FLT
- START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- BASELINE - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- LAST BASELINE - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- FLEX-START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- FLEX-END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- UNSAFE START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- UNSAFE CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- UNSAFE END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SAFE START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SAFE CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SAFE END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SPACE-EVENLY - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SPACE-BETWEEN - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SPACE-AROUND - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- NORMAL - ABS - REL -
OVERFLOW
-
-
-
- -

- diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-004.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-004.html index 38a330909d4..18ac4422b83 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-004.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-004.html @@ -2,7 +2,9 @@ CSS Box Alignment: align-content on large block container with floats - + + + +

-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
START ABS REL @@ -51,11 +54,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
CENTER ABS REL @@ -64,11 +67,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
END ABS REL @@ -77,11 +80,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
BASELINE ABS REL @@ -90,11 +93,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
LAST BASELINE ABS REL @@ -103,11 +106,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-START ABS REL @@ -116,11 +119,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-END ABS REL @@ -129,11 +132,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE START ABS REL @@ -142,11 +145,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE CENTER ABS REL @@ -155,11 +158,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE END ABS REL @@ -168,11 +171,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE START ABS REL @@ -181,11 +184,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE CENTER ABS REL @@ -194,11 +197,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE END ABS REL @@ -207,11 +210,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-EVENLY ABS REL @@ -220,11 +223,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-BETWEEN ABS REL @@ -233,11 +236,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-AROUND ABS REL @@ -246,11 +249,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
NORMAL ABS REL @@ -261,3 +264,4 @@

+ diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-005-ref.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-005-ref.html deleted file mode 100644 index c3712610dcd..00000000000 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-005-ref.html +++ /dev/null @@ -1,261 +0,0 @@ - -CSS Box Alignment: align-content on small block container with floats - - - - - - -

-
-
FLT
-
-
-
FLT
- START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- BASELINE - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- LAST BASELINE - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- FLEX-START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- FLEX-END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- UNSAFE START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- UNSAFE CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
-
-
FLT
-
FLT
- UNSAFE END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SAFE START - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SAFE CENTER - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SAFE END - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SPACE-EVENLY - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SPACE-BETWEEN - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- SPACE-AROUND - ABS - REL -
OVERFLOW
-
-
-
-
-
-
FLT
-
-
-
FLT
- NORMAL - ABS - REL -
OVERFLOW
-
-
-
- -

- diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-005.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-005.html index 97fe6c97fe9..f20582d5771 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-005.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-005.html @@ -2,7 +2,9 @@ CSS Box Alignment: align-content on small block container with floats - + + + +

-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
START ABS REL @@ -51,11 +54,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
CENTER ABS REL @@ -64,11 +67,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
END ABS REL @@ -77,11 +80,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
BASELINE ABS REL @@ -90,11 +93,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
LAST BASELINE ABS REL @@ -103,11 +106,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-START ABS REL @@ -116,11 +119,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-END ABS REL @@ -129,11 +132,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE START ABS REL @@ -142,11 +145,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE CENTER ABS REL @@ -155,11 +158,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE END ABS REL @@ -168,11 +171,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE START ABS REL @@ -181,11 +184,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE CENTER ABS REL @@ -194,11 +197,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE END ABS REL @@ -207,11 +210,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-EVENLY ABS REL @@ -221,11 +224,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-BETWEEN ABS REL @@ -234,11 +237,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-AROUND ABS REL @@ -247,11 +250,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
NORMAL ABS REL @@ -262,3 +265,4 @@

+ diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-006.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-006.html index be62e78a706..acdb6454bd4 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-006.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-006.html @@ -1,9 +1,11 @@ - + CSS Box Alignment: align-content container change to large block container with floats - + + + @@ -53,14 +59,18 @@ .label { color: black; font-weight: bold; } + +

-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
START ABS REL @@ -69,11 +79,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
CENTER ABS REL @@ -82,11 +92,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
END ABS REL @@ -95,11 +105,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
BASELINE ABS REL @@ -108,11 +118,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
LAST BASELINE ABS REL @@ -121,11 +131,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-START ABS REL @@ -134,11 +144,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-END ABS REL @@ -147,11 +157,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE START ABS REL @@ -160,11 +170,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE CENTER ABS REL @@ -173,11 +183,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE END ABS REL @@ -186,11 +196,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE START ABS REL @@ -199,11 +209,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE CENTER ABS REL @@ -212,11 +222,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE END ABS REL @@ -225,11 +235,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-EVENLY ABS REL @@ -238,11 +248,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-BETWEEN ABS REL @@ -251,11 +261,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-AROUND ABS REL @@ -264,11 +274,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
NORMAL ABS REL @@ -279,4 +289,4 @@

- + diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-007.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-007.html index 61c4c684cd8..c60f640ab06 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-007.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-007.html @@ -1,9 +1,11 @@ - + CSS Box Alignment: align-content container change to small block container with floats - + + + @@ -53,12 +59,16 @@ .label { color: black; font-weight: bold; } + +

-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
START ABS REL @@ -67,11 +77,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
CENTER ABS REL @@ -80,11 +90,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
END ABS REL @@ -93,11 +103,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
BASELINE ABS REL @@ -106,11 +116,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
LAST BASELINE ABS REL @@ -119,11 +129,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-START ABS REL @@ -132,11 +142,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-END ABS REL @@ -145,11 +155,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE START ABS REL @@ -158,11 +168,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE CENTER ABS REL @@ -171,11 +181,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE END ABS REL @@ -184,11 +194,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE START ABS REL @@ -197,11 +207,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE CENTER ABS REL @@ -210,11 +220,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE END ABS REL @@ -223,11 +233,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-EVENLY ABS REL @@ -236,11 +246,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-BETWEEN ABS REL @@ -249,11 +259,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-AROUND ABS REL @@ -262,11 +272,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
NORMAL ABS REL @@ -277,4 +287,3 @@

- diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-008.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-008.html index e9a861c7148..7d088d6ae63 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-008.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-008.html @@ -1,9 +1,11 @@ - + CSS Box Alignment: align-content style change on large block container with floats - + + + @@ -70,14 +76,18 @@ .label { color: black; font-weight: bold; } + +

-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
START ABS REL @@ -86,11 +96,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
CENTER ABS REL @@ -99,11 +109,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
END ABS REL @@ -112,11 +122,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
BASELINE ABS REL @@ -125,11 +135,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
LAST BASELINE ABS REL @@ -138,11 +148,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-START ABS REL @@ -151,11 +161,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-END ABS REL @@ -164,11 +174,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE START ABS REL @@ -177,11 +187,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE CENTER ABS REL @@ -190,11 +200,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE END ABS REL @@ -203,11 +213,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE START ABS REL @@ -216,11 +226,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE CENTER ABS REL @@ -229,11 +239,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE END ABS REL @@ -242,11 +252,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-EVENLY ABS REL @@ -255,11 +265,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-BETWEEN ABS REL @@ -268,11 +278,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-AROUND ABS REL @@ -281,11 +291,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
NORMAL ABS REL @@ -296,4 +306,4 @@

- + diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-009.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-009.html index 0b2e8ec9fc4..df45aa588f9 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-009.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-009.html @@ -1,9 +1,11 @@ - + CSS Box Alignment: align-content style change on small block container with floats - + + + @@ -70,12 +76,16 @@ .label { color: black; font-weight: bold; } + +

-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
START ABS REL @@ -84,11 +94,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
CENTER ABS REL @@ -97,11 +107,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
END ABS REL @@ -110,11 +120,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
BASELINE ABS REL @@ -123,11 +133,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
LAST BASELINE ABS REL @@ -136,11 +146,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-START ABS REL @@ -149,11 +159,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-END ABS REL @@ -162,11 +172,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE START ABS REL @@ -175,11 +185,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE CENTER ABS REL @@ -188,11 +198,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE END ABS REL @@ -201,11 +211,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE START ABS REL @@ -214,11 +224,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE CENTER ABS REL @@ -227,11 +237,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE END ABS REL @@ -240,11 +250,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-EVENLY ABS REL @@ -253,11 +263,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-BETWEEN ABS REL @@ -266,11 +276,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-AROUND ABS REL @@ -279,11 +289,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
NORMAL ABS REL @@ -294,4 +304,3 @@

- diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-010.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-010.html index ffb0e9cc4db..f3ec7a4e929 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-010.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-010.html @@ -1,9 +1,11 @@ - + CSS Box Alignment: align-content content change in large block container with floats - + + + @@ -53,14 +59,18 @@ .label { color: black; font-weight: bold; } + +

-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
START ABS REL @@ -69,11 +79,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
CENTER ABS REL @@ -82,11 +92,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
END ABS REL @@ -95,11 +105,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
BASELINE ABS REL @@ -108,11 +118,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
LAST BASELINE ABS REL @@ -121,11 +131,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-START ABS REL @@ -134,11 +144,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-END ABS REL @@ -147,11 +157,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE START ABS REL @@ -160,11 +170,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE CENTER ABS REL @@ -173,11 +183,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE END ABS REL @@ -186,11 +196,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE START ABS REL @@ -199,11 +209,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE CENTER ABS REL @@ -212,11 +222,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE END ABS REL @@ -225,11 +235,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-EVENLY ABS REL @@ -238,11 +248,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-BETWEEN ABS REL @@ -251,11 +261,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-AROUND ABS REL @@ -264,11 +274,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
NORMAL ABS REL @@ -279,4 +289,4 @@

- + diff --git a/tests/wpt/tests/css/css-align/blocks/align-content-block-011.html b/tests/wpt/tests/css/css-align/blocks/align-content-block-011.html index 44b8d898729..9210f5a83a7 100644 --- a/tests/wpt/tests/css/css-align/blocks/align-content-block-011.html +++ b/tests/wpt/tests/css/css-align/blocks/align-content-block-011.html @@ -1,9 +1,11 @@ - + CSS Box Alignment: align-content content change on small block container with floats - + + + @@ -53,12 +59,16 @@ .label { color: black; font-weight: bold; } + +

-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
START ABS REL @@ -67,11 +77,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
CENTER ABS REL @@ -80,11 +90,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
END ABS REL @@ -93,11 +103,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
BASELINE ABS REL @@ -106,11 +116,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
LAST BASELINE ABS REL @@ -119,11 +129,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-START ABS REL @@ -132,11 +142,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
FLEX-END ABS REL @@ -145,11 +155,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE START ABS REL @@ -158,11 +168,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE CENTER ABS REL @@ -171,11 +181,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
UNSAFE END ABS REL @@ -184,11 +194,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE START ABS REL @@ -197,11 +207,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE CENTER ABS REL @@ -210,11 +220,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SAFE END ABS REL @@ -223,11 +233,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-EVENLY ABS REL @@ -236,11 +246,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-BETWEEN ABS REL @@ -249,11 +259,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
SPACE-AROUND ABS REL @@ -262,11 +272,11 @@
-
-
FLT
-
+
+
FLT
+
-
FLT
+
FLT
NORMAL ABS REL @@ -277,4 +287,4 @@

- + diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box.html index cab42dc40d6..bf1607287a1 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box.html @@ -18,7 +18,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : border-box; } @@ -35,9 +35,9 @@ -

+
-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_position.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_position.html index 9760d63a434..a2695d4fb71 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_position.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_position.html @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : border-box; background-position: -15px -15px; } @@ -37,7 +37,7 @@ -
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_radius.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_radius.html index d321fcad7a9..4b123cf6641 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_radius.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_radius.html @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : border-box; border-radius: 60px; } @@ -37,9 +37,9 @@ -
+
-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_size.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_size.html index 8eb8b849a62..7de6afbfb6c 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_size.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-border-box_with_size.html @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : border-box; background-size : 50%; } @@ -37,9 +37,9 @@ -
+
-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box.html index 76ee1eaf1e1..b8bb74405b7 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box.html @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : content-box; } @@ -36,9 +36,9 @@ -
+
-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_position.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_position.html index e5117cc27fd..5637df98869 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_position.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_position.html @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : content-box; background-position: -15px -15px; } @@ -33,7 +33,7 @@ -
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_radius.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_radius.html index 481e51cf5c5..5be4fc6b3e6 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_radius.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_radius.html @@ -2,7 +2,7 @@ - CSS Backgrounds Test: background-origin:content-box & background-size + CSS Backgrounds Test: background-origin:content-box & border-radius @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : content-box; border-radius: 60px; } @@ -37,9 +37,9 @@ -
+
-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_size.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_size.html index b5f68ff11d3..e0c26d5fe16 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_size.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-content-box_with_size.html @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : content-box; background-size : 50%; } @@ -37,9 +37,9 @@ -
+
-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box.html index 7d545c70c98..0e1cbe00f57 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box.html @@ -18,7 +18,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : padding-box; } @@ -35,9 +35,9 @@ -
+
-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_position.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_position.html index 9bfa53702d0..c7a2310b031 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_position.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_position.html @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : padding-box; background-position: -15px -15px; } @@ -33,7 +33,7 @@ -
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_radius.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_radius.html index 81a7a5b510c..d0010a66049 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_radius.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_radius.html @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : padding-box; border-radius: 60px; } @@ -37,9 +37,9 @@ -
+
-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_size.html b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_size.html index 5538275a0a0..71798266616 100644 --- a/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_size.html +++ b/tests/wpt/tests/css/css-backgrounds/background-origin/origin-padding-box_with_size.html @@ -19,7 +19,7 @@ height : 224px; padding : 16px; margin-top : 8px; - background-image : url("../support/css3.png"); + background-image : url("support/yellow-orange-blue-160x160.png"); background-origin : padding-box; background-size : 50%; } @@ -37,9 +37,9 @@ -
+
-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/background-origin/support/yellow-orange-blue-160x160.png b/tests/wpt/tests/css/css-backgrounds/background-origin/support/yellow-orange-blue-160x160.png new file mode 100644 index 00000000000..1372399ddf3 Binary files /dev/null and b/tests/wpt/tests/css/css-backgrounds/background-origin/support/yellow-orange-blue-160x160.png differ diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box-ref.html index 55c9b0ffbd8..f4f90e18302 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled

+
Image download support must be enabled

-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_position-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_position-ref.html index 0636c0c249f..49df147395b 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_position-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_position-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled
+
Image download support must be enabled
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_radius-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_radius-ref.html index a4f4f5e541e..6ef93269de1 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_radius-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_radius-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled

+
Image download support must be enabled

-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_size-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_size-ref.html index 33d06870347..9fe5402f22b 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_size-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-border-box_with_size-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled

+
Image download support must be enabled

-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box-ref.html index ed5b2ec4d47..eac03101829 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled

+
Image download support must be enabled

-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_position-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_position-ref.html index 2b541587ba3..f340208e44b 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_position-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_position-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled
+
Image download support must be enabled
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_radius-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_radius-ref.html index 276c77ce6a8..7c62fd35045 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_radius-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_radius-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + +
Image download support must be enabled

-
Image download support must be enabled

- -
+
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_size-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_size-ref.html index 3d9824908ad..74c4ffd749f 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_size-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-content-box_with_size-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled

+
Image download support must be enabled

-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box-ref.html index 26063b5690e..d534ca97337 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled

+
Image download support must be enabled

-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_position-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_position-ref.html index 11c3f282428..691924bfc5b 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_position-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_position-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled
+
Image download support must be enabled
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_radius-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_radius-ref.html index 9af38d15249..e4c44254dff 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_radius-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_radius-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled

+
Image download support must be enabled

-
+
diff --git a/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_size-ref.html b/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_size-ref.html index 2dbb536f90e..5bee0af6d8f 100644 --- a/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_size-ref.html +++ b/tests/wpt/tests/css/css-backgrounds/reference/origin-padding-box_with_size-ref.html @@ -4,6 +4,8 @@ CSS Reftest reference + + -
Image download support must be enabled

+
Image download support must be enabled

-
+
diff --git a/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-015.html b/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-015.html deleted file mode 100644 index 64c32c0692e..00000000000 --- a/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-015.html +++ /dev/null @@ -1,40 +0,0 @@ - - - Tests that a flexbox expands its intrinsic block-size, due to a - flex item fragmenting. - - - - -

Test passes if there is a filled green square and no red.

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-077.html b/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-077.html new file mode 100644 index 00000000000..4a0b0561134 --- /dev/null +++ b/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-077.html @@ -0,0 +1,31 @@ + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-078.html b/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-078.html new file mode 100644 index 00000000000..1427d5770d9 --- /dev/null +++ b/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-078.html @@ -0,0 +1,29 @@ + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-079.html b/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-079.html new file mode 100644 index 00000000000..57c094d586b --- /dev/null +++ b/tests/wpt/tests/css/css-break/flexbox/multi-line-row-flex-fragmentation-079.html @@ -0,0 +1,29 @@ + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/tests/css/css-color/currentcolor-visited-fallback-ref.html b/tests/wpt/tests/css/css-color/currentcolor-visited-fallback-ref.html new file mode 100644 index 00000000000..8e6bf0d3361 --- /dev/null +++ b/tests/wpt/tests/css/css-color/currentcolor-visited-fallback-ref.html @@ -0,0 +1,14 @@ + + +currentcolor and visited inherited parent color fallback + + + diff --git a/tests/wpt/tests/css/css-color/currentcolor-visited-fallback.html b/tests/wpt/tests/css/css-color/currentcolor-visited-fallback.html new file mode 100644 index 00000000000..a83506b5e58 --- /dev/null +++ b/tests/wpt/tests/css/css-color/currentcolor-visited-fallback.html @@ -0,0 +1,19 @@ + + + +currentcolor and visited inherited parent color fallback + + + + + diff --git a/tests/wpt/tests/css/css-color/parsing/color-computed-color-mix-function.html b/tests/wpt/tests/css/css-color/parsing/color-computed-color-mix-function.html index f8691ee2f39..9f77afed0fd 100644 --- a/tests/wpt/tests/css/css-color/parsing/color-computed-color-mix-function.html +++ b/tests/wpt/tests/css/css-color/parsing/color-computed-color-mix-function.html @@ -55,6 +55,7 @@ fuzzy_test_computed_color(`color-mix(in hsl shorter hue, hsl(330deg 50% 50%), hsl(50deg 50% 50%))`, `color(srgb 0.75 0.333333 0.25)`); fuzzy_test_computed_color(`color-mix(in hsl shorter hue, hsl(20deg 50% 50%), hsl(320deg 50% 50%))`, `color(srgb 0.75 0.25 0.333333)`); fuzzy_test_computed_color(`color-mix(in hsl shorter hue, hsl(320deg 50% 50%), hsl(20deg 50% 50%))`, `color(srgb 0.75 0.25 0.333333)`); + fuzzy_test_computed_color(`color-mix(in hsl shorter hue, hsl(60deg 50% 50%), hsl(60deg 50% 50%))`, `color(srgb 0.75 0.75 0.25)`); fuzzy_test_computed_color(`color-mix(in hsl longer hue, hsl(40deg 50% 50%), hsl(60deg 50% 50%))`, `color(srgb 0.25 0.333333 0.75)`); fuzzy_test_computed_color(`color-mix(in hsl longer hue, hsl(60deg 50% 50%), hsl(40deg 50% 50%))`, `color(srgb 0.25 0.333333 0.75)`); @@ -62,6 +63,7 @@ fuzzy_test_computed_color(`color-mix(in hsl longer hue, hsl(330deg 50% 50%), hsl(50deg 50% 50%))`, `color(srgb 0.25 0.666667 0.75)`); fuzzy_test_computed_color(`color-mix(in hsl longer hue, hsl(20deg 50% 50%), hsl(320deg 50% 50%))`, `color(srgb 0.25 0.75 0.666667)`); fuzzy_test_computed_color(`color-mix(in hsl longer hue, hsl(320deg 50% 50%), hsl(20deg 50% 50%))`, `color(srgb 0.25 0.75 0.666667)`); + fuzzy_test_computed_color(`color-mix(in hsl longer hue, hsl(60deg 50% 50%), hsl(60deg 50% 50%))`, `color(srgb 0.25 0.25 0.75)`); fuzzy_test_computed_color(`color-mix(in hsl increasing hue, hsl(40deg 50% 50%), hsl(60deg 50% 50%))`, `color(srgb 0.75 0.666667 0.25)`); fuzzy_test_computed_color(`color-mix(in hsl increasing hue, hsl(60deg 50% 50%), hsl(40deg 50% 50%))`, `color(srgb 0.25 0.333333 0.75)`); @@ -69,6 +71,7 @@ fuzzy_test_computed_color(`color-mix(in hsl increasing hue, hsl(330deg 50% 50%), hsl(50deg 50% 50%))`, `color(srgb 0.75 0.333333 0.25)`); fuzzy_test_computed_color(`color-mix(in hsl increasing hue, hsl(20deg 50% 50%), hsl(320deg 50% 50%))`, `color(srgb 0.25 0.75 0.666667)`); fuzzy_test_computed_color(`color-mix(in hsl increasing hue, hsl(320deg 50% 50%), hsl(20deg 50% 50%))`, `color(srgb 0.75 0.25 0.333333)`); + fuzzy_test_computed_color(`color-mix(in hsl increasing hue, hsl(60deg 50% 50%), hsl(60deg 50% 50%))`, `color(srgb 0.75 0.75 0.25)`); fuzzy_test_computed_color(`color-mix(in hsl decreasing hue, hsl(40deg 50% 50%), hsl(60deg 50% 50%))`, `color(srgb 0.25 0.333333 0.75)`); fuzzy_test_computed_color(`color-mix(in hsl decreasing hue, hsl(60deg 50% 50%), hsl(40deg 50% 50%))`, `color(srgb 0.75 0.666667 0.25)`); @@ -76,6 +79,7 @@ fuzzy_test_computed_color(`color-mix(in hsl decreasing hue, hsl(330deg 50% 50%), hsl(50deg 50% 50%))`, `color(srgb 0.25 0.666667 0.75)`); fuzzy_test_computed_color(`color-mix(in hsl decreasing hue, hsl(20deg 50% 50%), hsl(320deg 50% 50%))`, `color(srgb 0.75 0.25 0.333333)`); fuzzy_test_computed_color(`color-mix(in hsl decreasing hue, hsl(320deg 50% 50%), hsl(20deg 50% 50%))`, `color(srgb 0.25 0.75 0.666667)`); + fuzzy_test_computed_color(`color-mix(in hsl decreasing hue, hsl(60deg 50% 50%), hsl(60deg 50% 50%))`, `color(srgb 0.75 0.75 0.25)`); fuzzy_test_computed_color(`color-mix(in hsl, hsl(none none none), hsl(none none none))`, `color(srgb 0 0 0)`); fuzzy_test_computed_color(`color-mix(in hsl, hsl(none none none), hsl(30deg 40% 80%))`, `color(srgb 0.88 0.8 0.72)`); diff --git a/tests/wpt/tests/css/css-color/parsing/color-computed-relative-color.html b/tests/wpt/tests/css/css-color/parsing/color-computed-relative-color.html index fd51bc2d2d4..deb1159da45 100644 --- a/tests/wpt/tests/css/css-color/parsing/color-computed-relative-color.html +++ b/tests/wpt/tests/css/css-color/parsing/color-computed-relative-color.html @@ -104,15 +104,15 @@ fuzzy_test_computed_color(`rgb(from rebeccapurple r calc(b * .5 - g * .5) 10)`, `color(srgb 0.4 0.2 0.0392)`); fuzzy_test_computed_color(`rgb(from rgb(20%, 40%, 60%, 80%) calc(r) calc(g) calc(b) / calc(alpha))`, `color(srgb 0.2 0.4 0.6 / 0.8)`); - // Testing with 'none'. - fuzzy_test_computed_color(`rgb(from rebeccapurple none none none)`, `color(srgb none none none)`); - fuzzy_test_computed_color(`rgb(from rebeccapurple none none none / none)`, `color(srgb none none none / none)`); - fuzzy_test_computed_color(`rgb(from rebeccapurple r g none)`, `color(srgb 0.4 0.2 none)`); - fuzzy_test_computed_color(`rgb(from rebeccapurple r g none / alpha)`, `color(srgb 0.4 0.2 none)`); + // Testing with 'none'. Missing components are resolved to zero during color space conversion. + // https://drafts.csswg.org/css-color-4/#missing + fuzzy_test_computed_color(`rgb(from rebeccapurple none none none)`, `color(srgb 0 0 0)`); + fuzzy_test_computed_color(`rgb(from rebeccapurple none none none / none)`, `color(srgb 0 0 0 / none)`); + fuzzy_test_computed_color(`rgb(from rebeccapurple r g none)`, `color(srgb 0.4 0.2 0)`); + fuzzy_test_computed_color(`rgb(from rebeccapurple r g none / alpha)`, `color(srgb 0.4 0.2 0)`); fuzzy_test_computed_color(`rgb(from rebeccapurple r g b / none)`, `color(srgb 0.4 0.2 0.6 / none)`); - fuzzy_test_computed_color(`rgb(from rgb(20% 40% 60% / 80%) r g none / alpha)`, `color(srgb 0.2 0.4 none / 0.8)`); + fuzzy_test_computed_color(`rgb(from rgb(20% 40% 60% / 80%) r g none / alpha)`, `color(srgb 0.2 0.4 0 / 0.8)`); fuzzy_test_computed_color(`rgb(from rgb(20% 40% 60% / 80%) r g b / none)`, `color(srgb 0.2 0.4 0.6 / none)`); - // FIXME: Clarify with spec editors if 'none' should pass through to the constants. fuzzy_test_computed_color(`rgb(from rgb(none none none) r g b)`, `color(srgb 0 0 0)`); fuzzy_test_computed_color(`rgb(from rgb(none none none / none) r g b / alpha)`, `color(srgb 0 0 0 / 0)`); fuzzy_test_computed_color(`rgb(from rgb(20% none 60%) r g b)`, `color(srgb 0.2 0 0.6)`); @@ -173,17 +173,17 @@ fuzzy_test_computed_color(`hsl(from rebeccapurple calc(h) calc(s) calc(l))`, `color(srgb 0.4 0.2 0.6)`); fuzzy_test_computed_color(`hsl(from rgb(20%, 40%, 60%, 80%) calc(h) calc(s) calc(l) / calc(alpha))`, `color(srgb 0.2 0.4 0.6 / 0.8)`); - // Testing with 'none'. - fuzzy_test_computed_color(`hsl(from rebeccapurple none none none)`, `color(srgb none none none)`); - fuzzy_test_computed_color(`hsl(from rebeccapurple none none none / none)`, `color(srgb none none none / none)`); - fuzzy_test_computed_color(`hsl(from rebeccapurple h s none)`, `color(srgb 0 0 none)`); - fuzzy_test_computed_color(`hsl(from rebeccapurple h s none / alpha)`, `color(srgb 0 0 none)`); + // Testing with 'none'. Missing components are resolved to zero during color space conversion. + // https://drafts.csswg.org/css-color-4/#missing + fuzzy_test_computed_color(`hsl(from rebeccapurple none none none)`, `color(srgb 0 0 0)`); + fuzzy_test_computed_color(`hsl(from rebeccapurple none none none / none)`, `color(srgb 0 0 0 / none)`); + fuzzy_test_computed_color(`hsl(from rebeccapurple h s none)`, `color(srgb 0 0 0)`); + fuzzy_test_computed_color(`hsl(from rebeccapurple h s none / alpha)`, `color(srgb 0 0 0)`); fuzzy_test_computed_color(`hsl(from rebeccapurple h s l / none)`, `color(srgb 0.4 0.2 0.6 / none)`); - fuzzy_test_computed_color(`hsl(from rebeccapurple none s l / alpha)`, `color(srgb none 0.2 0.2)`); - fuzzy_test_computed_color(`hsl(from hsl(120deg 20% 50% / .5) h s none / alpha)`, `color(srgb 0 0 none / 0.5)`); + fuzzy_test_computed_color(`hsl(from rebeccapurple none s l / alpha)`, `color(srgb 0.6 0.2 0.2)`); + fuzzy_test_computed_color(`hsl(from hsl(120deg 20% 50% / .5) h s none / alpha)`, `color(srgb 0 0 0 / 0.5)`); fuzzy_test_computed_color(`hsl(from hsl(120deg 20% 50% / .5) h s l / none)`, `color(srgb 0.4 0.6 0.4 / none)`); - fuzzy_test_computed_color(`hsl(from hsl(120deg 20% 50% / .5) none s l / alpha)`, `color(srgb none 0.4 0.4 / 0.5)`); - // FIXME: Clarify with spec editors if 'none' should pass through to the constants. + fuzzy_test_computed_color(`hsl(from hsl(120deg 20% 50% / .5) none s l / alpha)`, `color(srgb 0.6 0.4 0.4 / 0.5)`); fuzzy_test_computed_color(`hsl(from hsl(none none none) h s l)`, `color(srgb 0 0 0)`); fuzzy_test_computed_color(`hsl(from hsl(none none none / none) h s l / alpha)`, `color(srgb 0 0 0 / 0)`); fuzzy_test_computed_color(`hsl(from hsl(120deg none 50% / .5) h s l)`, `color(srgb 0.5 0.5 0.5 / 0.5)`); @@ -243,17 +243,17 @@ fuzzy_test_computed_color(`hwb(from rebeccapurple calc(h) calc(w) calc(b))`, `color(srgb 0.4 0.2 0.6)`); fuzzy_test_computed_color(`hwb(from rgb(20%, 40%, 60%, 80%) calc(h) calc(w) calc(b) / calc(alpha))`, `color(srgb 0.2 0.4 0.6 / 0.8)`); - // Testing with 'none'. - fuzzy_test_computed_color(`hwb(from rebeccapurple none none none)`, `color(srgb none none none)`); - fuzzy_test_computed_color(`hwb(from rebeccapurple none none none / none)`, `color(srgb none none none / none)`); - fuzzy_test_computed_color(`hwb(from rebeccapurple h w none)`, `color(srgb 0.6 0.2 none)`); - fuzzy_test_computed_color(`hwb(from rebeccapurple h w none / alpha)`, `color(srgb 0.6 0.2 none)`); + // Testing with 'none'. Missing components are resolved to zero during color space conversion. + // https://drafts.csswg.org/css-color-4/#missing + fuzzy_test_computed_color(`hwb(from rebeccapurple none none none)`, `color(srgb 1 0 0)`); + fuzzy_test_computed_color(`hwb(from rebeccapurple none none none / none)`, `color(srgb 1 0 0 / none)`); + fuzzy_test_computed_color(`hwb(from rebeccapurple h w none)`, `color(srgb 0.6 0.2 1)`); + fuzzy_test_computed_color(`hwb(from rebeccapurple h w none / alpha)`, `color(srgb 0.6 0.2 1)`); fuzzy_test_computed_color(`hwb(from rebeccapurple h w b / none)`, `color(srgb 0.4 0.2 0.6 / none)`); - fuzzy_test_computed_color(`hwb(from rebeccapurple none w b / alpha)`, `color(srgb none 0.2 0.2)`); - fuzzy_test_computed_color(`hwb(from hwb(120deg 20% 50% / .5) h w none / alpha)`, `color(srgb 0.2 1 none / 0.5)`); + fuzzy_test_computed_color(`hwb(from rebeccapurple none w b / alpha)`, `color(srgb 0.6 0.2 0.2)`); + fuzzy_test_computed_color(`hwb(from hwb(120deg 20% 50% / .5) h w none / alpha)`, `color(srgb 0.2 1 0.2 / 0.5)`); fuzzy_test_computed_color(`hwb(from hwb(120deg 20% 50% / .5) h w b / none)`, `color(srgb 0.2 0.5 0.2 / none)`); - fuzzy_test_computed_color(`hwb(from hwb(120deg 20% 50% / .5) none w b / alpha)`, `color(srgb none 0.2 0.2 / 0.5)`); - // FIXME: Clarify with spec editors if 'none' should pass through to the constants. + fuzzy_test_computed_color(`hwb(from hwb(120deg 20% 50% / .5) none w b / alpha)`, `color(srgb 0.5 0.2 0.2 / 0.5)`); fuzzy_test_computed_color(`hwb(from hwb(none none none) h w b)`, `color(srgb 1 0 0)`); fuzzy_test_computed_color(`hwb(from hwb(none none none / none) h w b / alpha)`, `color(srgb 1 0 0 / 0)`); fuzzy_test_computed_color(`hwb(from hwb(120deg none 50% / .5) h w b)`, `color(srgb 0 0.5 0 / 0.5)`); diff --git a/tests/wpt/tests/css/css-color/parsing/color-valid-relative-color.html b/tests/wpt/tests/css/css-color/parsing/color-valid-relative-color.html index 26f766ed4ce..543c2486c01 100644 --- a/tests/wpt/tests/css/css-color/parsing/color-valid-relative-color.html +++ b/tests/wpt/tests/css/css-color/parsing/color-valid-relative-color.html @@ -319,6 +319,8 @@ // Testing with calc(). fuzzy_test_valid_color(`lab(from lab(25 20 50) calc(l) calc(a) calc(b))`, `lab(25 20 50)`); fuzzy_test_valid_color(`lab(from lab(25 20 50 / 40%) calc(l) calc(a) calc(b) / calc(alpha))`, `lab(25 20 50 / 0.4)`); + fuzzy_test_valid_color(`lab(from lab(50 -30 40) calc(l - 20) a b)`, `lab(30 -30 40)`); + fuzzy_test_valid_color(`lab(from lab(50 -30 40) l calc(a / 3) calc(b / 2))`, `lab(50 -10 20)`); // Testing with 'none'. fuzzy_test_valid_color(`lab(from lab(25 20 50) none none none)`, `lab(none none none)`); @@ -385,6 +387,8 @@ // Testing with calc(). fuzzy_test_valid_color(`oklab(from oklab(0.25 0.2 0.5) calc(l) calc(a) calc(b))`, `oklab(0.25 0.2 0.5)`); fuzzy_test_valid_color(`oklab(from oklab(0.25 0.2 0.5 / 40%) calc(l) calc(a) calc(b) / calc(alpha))`, `oklab(0.25 0.2 0.5 / 0.4)`); + fuzzy_test_valid_color(`oklab(from oklab(0.7 0.25 -0.15) calc(l - 0.2) a b)`, `oklab(0.5 0.25 -0.15)`); + fuzzy_test_valid_color(`oklab(from oklab(0.7 0.25 -0.15) l calc(a / 2) calc(b / 3))`, `oklab(0.7 0.125 -0.075)`); // Testing with 'none'. fuzzy_test_valid_color(`oklab(from oklab(0.25 0.2 0.5) none none none)`, `oklab(none none none)`); @@ -459,6 +463,9 @@ // Testing with calc(). fuzzy_test_valid_color(`lch(from lch(0.7 45 30) calc(l) calc(c) calc(h))`, `lch(0.7 45 30)`); fuzzy_test_valid_color(`lch(from lch(0.7 45 30 / 40%) calc(l) calc(c) calc(h) / calc(alpha))`, `lch(0.7 45 30 / 0.4)`); + fuzzy_test_valid_color(`lch(from lch(50 100 300) calc(l - 20) c h)`, `lch(30 100 300)`); + fuzzy_test_valid_color(`lch(from lch(50 100 300) l calc(c / 2) h)`, `lch(50 50 300)`); + fuzzy_test_valid_color(`lch(from lch(50 100 300) l c calc(h * 2.5))`, `lch(50 100 30)`); // Testing with 'none'. fuzzy_test_valid_color(`lch(from lch(0.7 45 30) none none none)`, `lch(none none none)`); @@ -534,6 +541,9 @@ // Testing with calc(). fuzzy_test_valid_color(`oklch(from oklch(0.7 0.45 30) calc(l) calc(c) calc(h))`, `oklch(0.7 0.45 30)`); fuzzy_test_valid_color(`oklch(from oklch(0.7 0.45 30 / 40%) calc(l) calc(c) calc(h) / calc(alpha))`, `oklch(0.7 0.45 30 / 0.4)`); + fuzzy_test_valid_color(`oklch(from oklch(0.7 0.2 300) calc(l - 0.2) c h)`, `oklch(0.5 0.2 300)`); + fuzzy_test_valid_color(`oklch(from oklch(0.7 0.2 300) l calc(c / 2) h)`, `oklch(0.7 0.1 300)`); + fuzzy_test_valid_color(`oklch(from oklch(0.7 0.2 300) l c calc(h * 2.5))`, `oklch(0.7 0.2 30)`); // Testing with 'none'. fuzzy_test_valid_color(`oklch(from oklch(0.7 0.45 30) none none none)`, `oklch(none none none)`); diff --git a/tests/wpt/tests/css/css-color/xyz-003-ref.html b/tests/wpt/tests/css/css-color/xyz-003-ref.html index 029a2569956..4b7077c706e 100644 --- a/tests/wpt/tests/css/css-color/xyz-003-ref.html +++ b/tests/wpt/tests/css/css-color/xyz-003-ref.html @@ -3,7 +3,7 @@ CSS Color 4: CSS Color 4: xyz

Test passes if you see a single square, and not two rectangles of different colors.

diff --git a/tests/wpt/tests/css/css-color/xyz-003.html b/tests/wpt/tests/css/css-color/xyz-003.html index fd73edd69dd..5b99771d1c0 100644 --- a/tests/wpt/tests/css/css-color/xyz-003.html +++ b/tests/wpt/tests/css/css-color/xyz-003.html @@ -8,7 +8,7 @@ diff --git a/tests/wpt/tests/css/css-color/xyz-d65-003-ref.html b/tests/wpt/tests/css/css-color/xyz-d65-003-ref.html index 2a04ac4dd53..c470db054f1 100644 --- a/tests/wpt/tests/css/css-color/xyz-d65-003-ref.html +++ b/tests/wpt/tests/css/css-color/xyz-d65-003-ref.html @@ -3,7 +3,7 @@ CSS Color 4: CSS Color 4: xyz-d65

Test passes if you see a single square, and not two rectangles of different colors.

diff --git a/tests/wpt/tests/css/css-color/xyz-d65-003.html b/tests/wpt/tests/css/css-color/xyz-d65-003.html index 20e4e775c50..4dc5e127ef2 100644 --- a/tests/wpt/tests/css/css-color/xyz-d65-003.html +++ b/tests/wpt/tests/css/css-color/xyz-d65-003.html @@ -8,7 +8,7 @@ diff --git a/tests/wpt/tests/css/css-contain/content-visibility/content-visibility-019.sub.https.html b/tests/wpt/tests/css/css-contain/content-visibility/content-visibility-019.sub.https.html index 19497af007f..fe48390a7c0 100644 --- a/tests/wpt/tests/css/css-contain/content-visibility/content-visibility-019.sub.https.html +++ b/tests/wpt/tests/css/css-contain/content-visibility/content-visibility-019.sub.https.html @@ -6,7 +6,6 @@ - + + + + +
+
+
X
+
X
+
+
+ diff --git a/tests/wpt/tests/css/css-grid/subgrid/subgrid-baseline-011.html b/tests/wpt/tests/css/css-grid/subgrid/subgrid-baseline-011.html new file mode 100644 index 00000000000..ed1e13354d0 --- /dev/null +++ b/tests/wpt/tests/css/css-grid/subgrid/subgrid-baseline-011.html @@ -0,0 +1,32 @@ + + +CSS Grid Test: Subgrid with baseline-aligned standalone axis + + + + + + + + +
+
+
X
+
X
+
+
+ diff --git a/tests/wpt/tests/css/css-nesting/has-nesting-ref.html b/tests/wpt/tests/css/css-nesting/has-nesting-ref.html new file mode 100644 index 00000000000..5ab79b68f10 --- /dev/null +++ b/tests/wpt/tests/css/css-nesting/has-nesting-ref.html @@ -0,0 +1,8 @@ + +Nested has shouldn't match + +
    +
  • Bar
  • +
diff --git a/tests/wpt/tests/css/css-nesting/has-nesting.html b/tests/wpt/tests/css/css-nesting/has-nesting.html new file mode 100644 index 00000000000..83fe720236f --- /dev/null +++ b/tests/wpt/tests/css/css-nesting/has-nesting.html @@ -0,0 +1,21 @@ + +Nested has shouldn't match + + + + + +
    +
  • Foo
  • +
  • Bar
  • +
diff --git a/tests/wpt/tests/css/css-paint-api/hidpi/canvas-reset-ref.html b/tests/wpt/tests/css/css-paint-api/hidpi/canvas-reset-ref.html new file mode 100644 index 00000000000..24cab5da54d --- /dev/null +++ b/tests/wpt/tests/css/css-paint-api/hidpi/canvas-reset-ref.html @@ -0,0 +1,26 @@ + + + + + + + diff --git a/tests/wpt/tests/css/css-paint-api/hidpi/canvas-reset.https.html b/tests/wpt/tests/css/css-paint-api/hidpi/canvas-reset.https.html new file mode 100644 index 00000000000..d8073d64525 --- /dev/null +++ b/tests/wpt/tests/css/css-paint-api/hidpi/canvas-reset.https.html @@ -0,0 +1,44 @@ + + + + + + + + +
+ + + + + + diff --git a/tests/wpt/tests/css/css-properties-values-api/var-reference-registered-properties.html b/tests/wpt/tests/css/css-properties-values-api/var-reference-registered-properties.html index 4fb1a866ea4..f8f094c9bc2 100644 --- a/tests/wpt/tests/css/css-properties-values-api/var-reference-registered-properties.html +++ b/tests/wpt/tests/css/css-properties-values-api/var-reference-registered-properties.html @@ -187,40 +187,6 @@ test_invalid_fallback('', '40px', 'red'); test_invalid_fallback(' | none', '40px', 'nolength'); test_invalid_fallback('', '40px', 'var(--novar)'); -function test_using_valid_fallback(syntax, fallback, expected) { - test(function(){ - let name = generate_property(syntax); - try { - element.style = `--x:var(${name},${fallback})`; - let computedStyle = getComputedStyle(element); - assert_equals(computedStyle.getPropertyValue('--x'), expected); - } finally { - element.style = ''; - } - }, `Fallback must adhere to registered syntax [${syntax}, ${fallback}]`); -} - -function test_using_invalid_fallback(syntax, fallback) { - test(function(){ - let name = generate_property(syntax); - try { - element.style = `--x:var(${name},${fallback})`; - let computedStyle = getComputedStyle(element); - assert_equals(computedStyle.getPropertyValue('--x'), ''); - } finally { - element.style = ''; - } - }, `Invalid fallback is not used [${syntax}, ${fallback}]`); -} - -test_using_valid_fallback('', '10px', '10px'); -test_using_valid_fallback(' | none', 'none', 'none'); -test_using_valid_fallback('', 'var(--length-1)', '20px'); - -test_using_invalid_fallback('', 'red'); -test_using_invalid_fallback(' | none', 'nolength'); -test_using_invalid_fallback('', 'var(--length-1)'); - test(function(t){ CSS.registerProperty({ name: '--registered-universal-no-initial', diff --git a/tests/wpt/tests/css/css-pseudo/target-text-009.html b/tests/wpt/tests/css/css-pseudo/target-text-009.html new file mode 100644 index 00000000000..2670d9319ee --- /dev/null +++ b/tests/wpt/tests/css/css-pseudo/target-text-009.html @@ -0,0 +1,18 @@ + + +CSS Pseudo-Elements Test: ::target-text color rendering - overlap targets + + + + +

PASS if

+

"match me and me"

+

is rendered dark grey on an orange background.

+ diff --git a/tests/wpt/tests/css/css-pseudo/target-text-010.html b/tests/wpt/tests/css/css-pseudo/target-text-010.html new file mode 100644 index 00000000000..4aae966a2d0 --- /dev/null +++ b/tests/wpt/tests/css/css-pseudo/target-text-010.html @@ -0,0 +1,24 @@ + + + +CSS Pseudo-Elements Test: ::target-text color rendering - overlap targets with hidden: until-found + + + + + +

PASS if

me and me"

+

is rendered dark grey on an orange background.

+ + diff --git a/tests/wpt/tests/css/css-pseudo/target-text-five-words-ref.html b/tests/wpt/tests/css/css-pseudo/target-text-five-words-ref.html new file mode 100644 index 00000000000..d1951b3abc9 --- /dev/null +++ b/tests/wpt/tests/css/css-pseudo/target-text-five-words-ref.html @@ -0,0 +1,5 @@ + +CSS Test Reference +

PASS if

+

"match me and me"

+

is rendered dark grey on an orange background.

diff --git a/tests/wpt/tests/css/css-ruby/rt-display-blockified.html b/tests/wpt/tests/css/css-ruby/rt-display-blockified.html new file mode 100644 index 00000000000..b2b7989fddc --- /dev/null +++ b/tests/wpt/tests/css/css-ruby/rt-display-blockified.html @@ -0,0 +1,41 @@ + + +Blockifying 'display: ruby-text' loses ruby-text functionality + + + + + + +

base1 absposbase2 float

+ + diff --git a/tests/wpt/tests/css/css-scroll-snap-2/resources/common.js b/tests/wpt/tests/css/css-scroll-snap-2/resources/common.js new file mode 100644 index 00000000000..457ae857cc6 --- /dev/null +++ b/tests/wpt/tests/css/css-scroll-snap-2/resources/common.js @@ -0,0 +1,92 @@ +function checkSnapEventSupport(event_type) { + if (event_type == "snapchanged") { + assert_true(window.onsnapchanged !== undefined, "snapchanged not supported"); + } else if (event_type == "snapchanging") { + assert_true(window.onsnapchanging !== undefined, "snapchanging not supported"); + } else { + assert_unreached(`Unknown snap event type selected: ${event_type}`); + } +} + +function assertSnapEvent(evt, expected_ids) { + assert_equals(evt.bubbles, false, "snap events don't bubble"); + assert_false(evt.cancelable, "snap events are not cancelable."); + const actual = Array.from(evt.snapTargets, el => el.id).join(","); + const expected = expected_ids.join(","); + assert_equals(actual, expected, "snap event supplied expected targets"); +} + +// This function holds logic intended to be used by tests for scroll snap +// events. +// |test_data| should contain: +// - |scroller|: the snap container being scrolled (or +// document.scrollingElement) +// - |scrolling_function|: this function should trigger the desired snap event +// when executed. +// - |expected_snap_targets|: a list of element ids which the triggered snap +// event should supply in SnapEvent.snapTargets. +// - |expected_scroll_offsets|: the scroll offsets at which the snap container +// should be after scrolling function has been +// executed. +// |event_type|: should be "snapchanged" or "snapchanging". +async function test_snap_event(test, test_data, event_type) { + checkSnapEventSupport(event_type); + await waitForScrollReset(test, test_data.scroller); + + let listener = test_data.scroller == + document.scrollingElement ? document : test_data.scroller; + + const event_promise = waitForSnapEvent(listener, event_type); + await test_data.scrolling_function(); + let evt = await event_promise; + + assertSnapEvent(evt, test_data.expected_snap_targets); + assert_approx_equals(test_data.scroller.scrollTop, + test_data.expected_scroll_offsets.y, 1, + "vertical scroll offset mismatch."); + assert_approx_equals(test_data.scroller.scrollLeft, + test_data.expected_scroll_offsets.x, 1, + "horizontal scroll offset mismatch."); +} + +async function test_snapchanged(test, test_data) { + await test_snap_event(test, test_data, "snapchanged"); +} + +function waitForEventUntil(event_target, event_type, wait_until) { + return new Promise(resolve => { + let result = null; + const listener = (evt) => { + result = evt; + }; + event_target.addEventListener(event_type, listener); + wait_until.then(() => { + event_target.removeEventListener(event_type, listener); + resolve(result); + }); + }); +} + +// Proxy a wait for a snap event. We want to avoid having a test +// timeout in the event of an expected snap event not firing in a particular +// test case as that would cause the entire file to fail. +// Snap events should fire before scrollend, so if a scroll should happen, wait +// for a scrollend event. Otherwise, just do a rAF-based wait. +function waitForSnapEvent(event_target, event_type, scroll_happens = true) { + return scroll_happens ? waitForEventUntil(event_target, event_type, + waitForScrollendEventNoTimeout(event_target)) + : waitForEventUntil(event_target, event_type, + waitForAnimationFrames(2)); +} + +function waitForSnapChangedEvent(event_target, scroll_happens = true) { + return waitForSnapEvent(event_target, "snapchanged", scroll_happens); +} + +function getScrollbarToScrollerRatio(scroller) { + // Ideally we'd subtract the length of the scrollbar thumb from + // the dividend but there isn't currently a way to get the + // scrollbar thumb length. + return scroller.clientHeight / + (scroller.scrollHeight - scroller.clientHeight); +} diff --git a/tests/wpt/tests/css/css-scroll-snap-2/resources/user-scroll-common.js b/tests/wpt/tests/css/css-scroll-snap-2/resources/user-scroll-common.js new file mode 100644 index 00000000000..647f4213a6a --- /dev/null +++ b/tests/wpt/tests/css/css-scroll-snap-2/resources/user-scroll-common.js @@ -0,0 +1,66 @@ +// Helper functions for snapchanged-on-user-* tests. + +// This performs a touch scroll on |scroller| using the coordinates provided +// in |start_pos| and |end_pos|. +// It is meant for use in snapchanged & snapchanging tests for triggering snap +// events when touch scrolling from |start_pos| to |end_pos|. +function snap_event_touch_scroll_helper(start_pos, end_pos) { + return new test_driver.Actions() + .addPointer("TestPointer", "touch") + .pointerMove(start_pos.x, start_pos.y) + .pointerDown() + .addTick() + .pause(200) + .pointerMove(end_pos.x, end_pos.y) + .addTick() + .pointerUp() + .send(); +} + +// This drags the provided |scroller|'s scrollbar vertically by |drag_amt|. +// Snap event tests should provide a |drag_amt| that would result in a +// the desired snap event being triggered. +const vertical_offset_into_scrollbar = 30; +function snap_event_scrollbar_drag_helper(scroller, scrollbar_width, drag_amt) { + let x, y, bounds; + if (scroller == document.scrollingElement) { + bounds = document.documentElement.getBoundingClientRect(); + x = window.innerWidth - Math.round(scrollbar_width / 2); + } else { + bounds = scroller.getBoundingClientRect(); + x = bounds.right - Math.round(scrollbar_width / 2); + } + y = bounds.top + vertical_offset_into_scrollbar; + return new test_driver.Actions() + .addPointer('TestPointer', 'mouse') + .pointerMove(x, y) + .pointerDown() + .pointerMove(x, y + drag_amt) + .addTick() + .pointerUp() + .send(); +} + +// This tests that snap event of type |event_type| don't fire for a user (wheel) +// scroll that snaps back to the same element. Snap events tests should provide +// a |delta| small enough that no change in |scroller|'s snap targets occurs at +// the end of the scroll. +async function test_no_snap_event(test, scroller, delta, event_type) { + const listening_element = scroller == document.scrollingElement + ? document : scroller; + checkSnapEventSupport(event_type); + await waitForScrollReset(test, scroller); + await waitForCompositorCommit(); + let snap_event_promise = waitForSnapEvent(listening_element, event_type); + // Set the scroll destination to just a little off (0, 0) top so we snap + // back to the top box. + await new test_driver.Actions().scroll(0, 0, delta, delta).send(); + let evt = await snap_event_promise; + assert_equals(evt, null, "no snap event since scroller is back to top"); + assert_equals(scroller.scrollTop, 0, "scroller snaps back to the top"); + assert_equals(scroller.scrollLeft, 0, "scroller snaps back to the left"); +} + +async function test_no_snapchanged(t, scroller, delta) { + await test_no_snap_event(t, scroller, delta, "snapchanged"); +} diff --git a/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/resources/common.js b/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/resources/common.js deleted file mode 100644 index 68dcab5cc8a..00000000000 --- a/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/resources/common.js +++ /dev/null @@ -1,58 +0,0 @@ -function checkSnapchangedSupport() { - assert_true(window.onsnapchanged !== undefined, "snapchanged not supported"); -} - -function assertSnapchangedEvent(evt, expected_ids) { - assert_equals(evt.bubbles, false, "snapchanged event doesn't bubble"); - assert_false(evt.cancelable, "snapchanged event is not cancelable."); - const actual = Array.from(evt.snapTargets, el => el.id).join(","); - const expected = expected_ids.join(","); - assert_equals(actual, expected, "snapped to expected targets"); -} - -async function test_snapchanged(test, test_data) { - checkSnapchangedSupport(); - await waitForScrollReset(test, test_data.scroller); - - let listener = test_data.scroller == - document.scrollingElement ? document : test_data.scroller; - - const snapchanged_promise = waitForSnapChangedEvent(listener); - await test_data.scrolling_function(); - let evt = await snapchanged_promise; - - assertSnapchangedEvent(evt, - test_data.expected_snap_targets); - assert_equals(test_data.scroller.scrollTop, - test_data.expected_scroll_offsets.y, - "vertical scroll offset mismatch."); - assert_equals(test_data.scroller.scrollLeft, - test_data.expected_scroll_offsets.x, - "horizontal scroll offset mismatch."); -} - -function waitForEventUntil(event_target, event_type, wait_until) { - return new Promise(resolve => { - let result = null; - const listener = (evt) => { - result = evt; - }; - event_target.addEventListener(event_type, listener); - wait_until.then(() => { - event_target.removeEventListener(event_type, listener); - resolve(result); - }); - }); -} - -// Proxy a wait for a snapchanged event. We want to avoid having a test -// timeout in the event of an expected snapchanged not firing in a particular -// test case as that would cause the entire file to fail. -// Snapchanged should fire before scrollend, so if a scroll should happen, wait -// for a scrollend event. Otherwise, just do a rAF-based wait. -function waitForSnapChangedEvent(event_target, scroll_happens = true) { - return scroll_happens ? waitForEventUntil(event_target, "snapchanged", - waitForScrollendEventNoTimeout(event_target)) - : waitForEventUntil(event_target, "snapchanged", - waitForAnimationFrames(2)); -} diff --git a/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-after-layout-change.tentative.html b/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-after-layout-change.tentative.html index 193c907da82..293400edda2 100644 --- a/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-after-layout-change.tentative.html +++ b/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-after-layout-change.tentative.html @@ -6,7 +6,7 @@ - + @@ -56,7 +56,7 @@ } async function setup(t) { - checkSnapchangedSupport(t); + checkSnapEventSupport("snapchanged"); await reset(t); await waitForCompositorCommit(); assert_equals(scroller.scrollTop, 0, "test precondition: scroller " + @@ -81,7 +81,7 @@ inner_snap_area.style.height = `${scroller.clientHeight + inner_snap_area.clientHeight - 10}px`; const evt = await snapchanged_promise; - assertSnapchangedEvent(evt, [outer_snap_area.id, inner_snap_area.id]); + assertSnapEvent(evt, [outer_snap_area.id, inner_snap_area.id]); target_snap_position = inner_snap_area.offsetTop + inner_snap_area.offsetHeight - scroller.clientHeight; assert_equals(scroller.scrollTop, target_snap_position, @@ -107,7 +107,7 @@ inner_snap_area.style.height = `${scroller.clientHeight + inner_snap_area.clientHeight + 10}px`; const evt = await snapchanged_promise; - assertSnapchangedEvent(evt, [outer_snap_area.id, inner_snap_area.id]); + assertSnapEvent(evt, [outer_snap_area.id, inner_snap_area.id]); assert_equals(scroller.scrollTop, target_snap_position, "scroller maintains offset which is now covering within inner area"); }, "snapchanged fires after snap area is snapped to upon layout change " + @@ -119,11 +119,11 @@ let snapchanged_promise = waitForSnapChangedEvent(scroller, false); scroller.style.scrollSnapType = "none"; let evt = await snapchanged_promise; - assertSnapchangedEvent(evt, []); + assertSnapEvent(evt, []); snapchanged_promise = waitForSnapChangedEvent(scroller, false); scroller.style.scrollSnapType = "y mandatory"; evt = await snapchanged_promise; - assertSnapchangedEvent(evt, [outer_snap_area.id]); + assertSnapEvent(evt, [outer_snap_area.id]); }, "snapchanged fires when container stops snapping"); promise_test(async(t) => { @@ -133,12 +133,12 @@ inner_snap_area.style.scrollSnapAlign = "none"; outer_snap_area.style.scrollSnapAlign = "none"; let evt = await snapchanged_promise; - assertSnapchangedEvent(evt, []); + assertSnapEvent(evt, []); snapchanged_promise = waitForSnapChangedEvent(scroller, false); inner_snap_area.style.scrollSnapAlign = "start"; outer_snap_area.style.scrollSnapAlign = "start"; evt = await snapchanged_promise; - assertSnapchangedEvent(evt, [outer_snap_area.id]); + assertSnapEvent(evt, [outer_snap_area.id]); }, "snapchanged fires when snap container no longer has snap areas"); diff --git a/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-ensures-dom-order.html b/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-ensures-dom-order.html index fc7abe91f79..10bc73b622c 100644 --- a/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-ensures-dom-order.html +++ b/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-ensures-dom-order.html @@ -6,7 +6,7 @@ - + +
+
+
+
+ + diff --git a/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-on-user-scroll.tentative.html b/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-on-user-scroll.tentative.html new file mode 100644 index 00000000000..4f362007225 --- /dev/null +++ b/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-on-user-scroll.tentative.html @@ -0,0 +1,170 @@ + + + + + + CSS Scroll Snap 2 Test: snapchanged events + + + + + + + + + + + + + + +
+
+
+
+
+
+ + diff --git a/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-same-targets-after-layout-changed.html b/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-same-targets-after-layout-changed.html index e41e5629dfe..4d16bd80a3a 100644 --- a/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-same-targets-after-layout-changed.html +++ b/tests/wpt/tests/css/css-scroll-snap-2/snapchanged/snapchanged-same-targets-after-layout-changed.html @@ -6,7 +6,7 @@ - + + +

None of these examples should wrap to a second line:

+
1. a
+
+
2. b
+
+
3. c
diff --git a/tests/wpt/tests/css/css-text/letter-spacing/reference/letter-spacing-end-of-line-002-ref.html b/tests/wpt/tests/css/css-text/letter-spacing/reference/letter-spacing-end-of-line-002-ref.html new file mode 100644 index 00000000000..a99e1e2fa56 --- /dev/null +++ b/tests/wpt/tests/css/css-text/letter-spacing/reference/letter-spacing-end-of-line-002-ref.html @@ -0,0 +1,27 @@ + + +CSS Text reference + + + + +

None of these examples should wrap to a second line:

+
1. a
+
+
2. b
+
+
3. c
diff --git a/tests/wpt/tests/css/css-text/text-autospace/crashtests/text-autospace-shape-cache-crash.html b/tests/wpt/tests/css/css-text/text-autospace/crashtests/text-autospace-shape-cache-crash.html new file mode 100644 index 00000000000..4c4360f5d1f --- /dev/null +++ b/tests/wpt/tests/css/css-text/text-autospace/crashtests/text-autospace-shape-cache-crash.html @@ -0,0 +1,15 @@ + + + +
X
+
X
+ diff --git a/tests/wpt/tests/css/css-ui/outline-auto-width-001.html b/tests/wpt/tests/css/css-ui/outline-auto-width-001.html index fc7dc170661..e9f561b1e24 100644 --- a/tests/wpt/tests/css/css-ui/outline-auto-width-001.html +++ b/tests/wpt/tests/css/css-ui/outline-auto-width-001.html @@ -6,21 +6,31 @@ - + + -

Test passes if there are two identical box frames below. +

Test passes if either: +

    +
  • there are three boxes below, two above the horizontal line and one below, and the two boxes above the line are identical +
  • there are two identical boxes below, one above the horizontal line and one below +
+
+
diff --git a/tests/wpt/tests/css/css-ui/outline-color-002-ref.html b/tests/wpt/tests/css/css-ui/outline-color-002-ref.html new file mode 100644 index 00000000000..f3b55549f31 --- /dev/null +++ b/tests/wpt/tests/css/css-ui/outline-color-002-ref.html @@ -0,0 +1,15 @@ + + + + CSS Reftest Reference + + + + +
green outline
+
green outline
+
purple outline
+
green outline
+ + + diff --git a/tests/wpt/tests/css/css-ui/outline-color-002.html b/tests/wpt/tests/css/css-ui/outline-color-002.html new file mode 100644 index 00000000000..f23ef69a699 --- /dev/null +++ b/tests/wpt/tests/css/css-ui/outline-color-002.html @@ -0,0 +1,15 @@ + + +CSS Basic User Interface Test: outline-color - respect accent-color + + + + + + +
green outline
+
green outline
+
purple outline
+
green outline
+ diff --git a/tests/wpt/tests/css/css-ui/outline-color-003-ref.html b/tests/wpt/tests/css/css-ui/outline-color-003-ref.html new file mode 100644 index 00000000000..78557c7d4e5 --- /dev/null +++ b/tests/wpt/tests/css/css-ui/outline-color-003-ref.html @@ -0,0 +1,14 @@ + + + + CSS Reftest Reference + + + + +
+
Green inner outline with a purple outer outline
+
+ + + diff --git a/tests/wpt/tests/css/css-ui/outline-color-003.html b/tests/wpt/tests/css/css-ui/outline-color-003.html new file mode 100644 index 00000000000..b2c9e8138d8 --- /dev/null +++ b/tests/wpt/tests/css/css-ui/outline-color-003.html @@ -0,0 +1,12 @@ + + +CSS Basic User Interface Test: outline-color - respect accent-color + + + + + +
+
Green inner outline with a purple outer outline
+
diff --git a/tests/wpt/tests/css/css-ui/outline-color-004-ref.html b/tests/wpt/tests/css/css-ui/outline-color-004-ref.html new file mode 100644 index 00000000000..5da6b388067 --- /dev/null +++ b/tests/wpt/tests/css/css-ui/outline-color-004-ref.html @@ -0,0 +1,16 @@ + + + + CSS Reftest Reference + + + + +
+
Green inner outline with a + purple outer outline
+
+ + + + diff --git a/tests/wpt/tests/css/css-ui/outline-color-004.html b/tests/wpt/tests/css/css-ui/outline-color-004.html new file mode 100644 index 00000000000..3bd1ea44d8a --- /dev/null +++ b/tests/wpt/tests/css/css-ui/outline-color-004.html @@ -0,0 +1,13 @@ + + +CSS Basic User Interface Test: outline-color - respect accent-color + + + + + +
+
Green inner outline with a + purple outer outline
+
diff --git a/tests/wpt/tests/css/css-ui/reference/outline-auto-width-001-b-ref.html b/tests/wpt/tests/css/css-ui/reference/outline-auto-width-001-b-ref.html new file mode 100644 index 00000000000..8bc904e9346 --- /dev/null +++ b/tests/wpt/tests/css/css-ui/reference/outline-auto-width-001-b-ref.html @@ -0,0 +1,28 @@ + + + +CSS-UI test reference + + + +

Test passes if either: +

    +
  • there are three boxes below, two above the horizontal line and one below, and the two boxes above the line are identical +
  • there are two identical boxes below, one above the horizontal line and one below +
+ +
+
+
+
diff --git a/tests/wpt/tests/css/css-ui/reference/outline-auto-width-001-ref.html b/tests/wpt/tests/css/css-ui/reference/outline-auto-width-001-ref.html new file mode 100644 index 00000000000..95753d97b8b --- /dev/null +++ b/tests/wpt/tests/css/css-ui/reference/outline-auto-width-001-ref.html @@ -0,0 +1,28 @@ + + + +CSS-UI test reference + + + +

Test passes if either: +

    +
  • there are three boxes below, two above the horizontal line and one below, and the two boxes above the line are identical +
  • there are two identical boxes below, one above the horizontal line and one below +
+ +
+
+
+
diff --git a/tests/wpt/tests/css/css-ui/reference/outline-auto-with-001-ref.html b/tests/wpt/tests/css/css-ui/reference/outline-auto-with-001-ref.html deleted file mode 100644 index 9ae9e60fa3e..00000000000 --- a/tests/wpt/tests/css/css-ui/reference/outline-auto-with-001-ref.html +++ /dev/null @@ -1,18 +0,0 @@ - - - -CSS-UI test reference - - - -

Test passes if there are two identical box frames below. - -

-
diff --git a/tests/wpt/tests/css/css-values/signs-abs-computed.html b/tests/wpt/tests/css/css-values/signs-abs-computed.html index 32466dcf0b4..9b8ec89e2a9 100644 --- a/tests/wpt/tests/css/css-values/signs-abs-computed.html +++ b/tests/wpt/tests/css/css-values/signs-abs-computed.html @@ -57,7 +57,16 @@ test_math_used('abs(infinity)', 'calc(infinity)', {type:'number'}); test_math_used('abs(-infinity)', 'calc(infinity)', {type:'number'}); test_math_used('abs(NaN)', 'calc(NaN)', {type:'number'}); -//Type checking sign +// Test abs/sign with negate +test_math_used('calc(20 - abs(-10))', '10', {type:'number'}); +test_math_used('calc(20 - abs(10))', '10', {type:'number'}); +test_math_used('calc(10 - abs(10 - abs(-30))', '-10', {type:'number'}); +test_math_used('calc(2 - sign(1))', '1', {type:'number'}); +test_math_used('calc(2 - sign(-1))', '3', {type:'number'}); +test_math_used('calc(2 - sign(1 - sign(-1)))', '1', {type:'number'}); +test_math_used('calc(10 - abs(20 - sign(2 - abs(-20))))', '-11', {type:'number'}); + +// Type checking sign test_math_used('sign(1px)', '1', {type:'integer'}); test_math_used('sign(1cm)', '1', {type:'integer'}); test_math_used('sign(1mm)', '1', {type:'integer'}); @@ -143,7 +152,7 @@ test_zero('sign(-0grad)', {is_negative: true}); test_zero('sign(-0rad)', {is_negative: true}); test_zero('sign(-0turn)', {is_negative: true}); -//Type checking abs +// Type checking abs test_math_used('abs(1px)', '1px'); test_math_used('abs(1cm)', '1cm'); test_math_used('abs(1mm)', '1mm'); diff --git a/tests/wpt/tests/css/css-values/sin-cos-tan-computed.html b/tests/wpt/tests/css/css-values/sin-cos-tan-computed.html index bad60175209..a19b118f754 100644 --- a/tests/wpt/tests/css/css-values/sin-cos-tan-computed.html +++ b/tests/wpt/tests/css/css-values/sin-cos-tan-computed.html @@ -13,6 +13,9 @@ test_math_used('cos(0)', '1', {type:'number'}); test_math_used('sin(0)', '0', {type:'number'}); test_math_used('tan(0)', '0', {type:'number'}); +test_math_used('tan(315deg)', '-1', {type:'number', approx:0.1}); +test_math_used('tan(360deg)', '0', {type:'number', approx:0.1}); +test_math_used('tan(405deg)', '1', {type:'number', approx:0.1}); // Test pi test_math_used('calc(sin(pi/2 - pi/2) )', '0', {type:'number', approx:0.1}); diff --git a/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-lr-baseline.optional-ref.html b/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-lr-baseline.optional-ref.html new file mode 100644 index 00000000000..c3f6107546a --- /dev/null +++ b/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-lr-baseline.optional-ref.html @@ -0,0 +1,21 @@ + +Test baseline alignment of checkboxes in vertical-lr writing mode. + + +

The checkbox should be center-aligned with the label text.

+
+ + +
diff --git a/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-lr-baseline.optional.html b/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-lr-baseline.optional.html new file mode 100644 index 00000000000..b19de139f15 --- /dev/null +++ b/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-lr-baseline.optional.html @@ -0,0 +1,21 @@ + + + + +Test baseline alignment of checkboxes in vertical-lr writing mode. + + + +

The checkbox should be center-aligned with the label text.

+
+ + +
diff --git a/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-rl-baseline.optional-ref.html b/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-rl-baseline.optional-ref.html new file mode 100644 index 00000000000..a253a71dd49 --- /dev/null +++ b/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-rl-baseline.optional-ref.html @@ -0,0 +1,21 @@ + +Test baseline alignment of checkboxes in vertical-rl writing mode. + + +

The checkbox should be center-aligned with the label text.

+
+ + +
diff --git a/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-rl-baseline.optional.html b/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-rl-baseline.optional.html new file mode 100644 index 00000000000..3efb21136cd --- /dev/null +++ b/tests/wpt/tests/css/css-writing-modes/forms/checkbox-appearance-native-vertical-rl-baseline.optional.html @@ -0,0 +1,21 @@ + + + + +Test baseline alignment of checkboxes in vertical-rl writing mode. + + + +

The checkbox should be center-aligned with the label text.

+
+ + +
diff --git a/tests/wpt/tests/css/css-writing-modes/forms/date-input-appearance-native-computed-style.html b/tests/wpt/tests/css/css-writing-modes/forms/date-input-appearance-native-computed-style.html new file mode 100644 index 00000000000..0e79766793c --- /dev/null +++ b/tests/wpt/tests/css/css-writing-modes/forms/date-input-appearance-native-computed-style.html @@ -0,0 +1,42 @@ + + + + +Date input appearance native writing mode computed style + + + + + + + + + + + diff --git a/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-lr-baseline.optional-ref.html b/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-lr-baseline.optional-ref.html new file mode 100644 index 00000000000..9b09537c937 --- /dev/null +++ b/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-lr-baseline.optional-ref.html @@ -0,0 +1,21 @@ + +Test baseline alignment of radio buttons in vertical-lr writing mode. + + +

The radio button should be center-aligned with the label text.

+
+ + +
diff --git a/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-lr-baseline.optional.html b/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-lr-baseline.optional.html new file mode 100644 index 00000000000..8d5bf75fe8f --- /dev/null +++ b/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-lr-baseline.optional.html @@ -0,0 +1,21 @@ + + + + +Test baseline alignment of radio buttons in vertical-lr writing mode. + + + +

The radio button should be center-aligned with the label text.

+
+ + +
diff --git a/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-rl-baseline.optional-ref.html b/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-rl-baseline.optional-ref.html new file mode 100644 index 00000000000..95871a518f1 --- /dev/null +++ b/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-rl-baseline.optional-ref.html @@ -0,0 +1,21 @@ + +Test baseline alignment of radio buttons in vertical-rl writing mode. + + +

The radio button should be center-aligned with the label text.

+
+ + +
diff --git a/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-rl-baseline.optional.html b/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-rl-baseline.optional.html new file mode 100644 index 00000000000..4c5a59a031a --- /dev/null +++ b/tests/wpt/tests/css/css-writing-modes/forms/radio-appearance-native-vertical-rl-baseline.optional.html @@ -0,0 +1,21 @@ + + + + +Test baseline alignment of radio buttons in vertical-rl writing mode. + + + +

The radio button should be center-aligned with the label text.

+
+ + +
diff --git a/tests/wpt/tests/css/cssom/caretPositionFromPoint-with-transformation.html b/tests/wpt/tests/css/cssom/caretPositionFromPoint-with-transformation.html index fcd02877ca9..f6ed98f3f2e 100644 --- a/tests/wpt/tests/css/cssom/caretPositionFromPoint-with-transformation.html +++ b/tests/wpt/tests/css/cssom/caretPositionFromPoint-with-transformation.html @@ -25,14 +25,18 @@ return [rect.x + rect.width / 2, rect.y + rect.height / 2]; }; - return new Promise(resolve => { + return new Promise((resolve, reject) => { frame.srcdoc = source; frame.onload = () => { - const frameDoc = frame.contentDocument; - const {offset} = frameDoc.caretPositionFromPoint( - ...elementCenter(frameDoc.querySelector("h1")) - ); - resolve(offset); + try { + const frameDoc = frame.contentDocument; + const {offset} = frameDoc.caretPositionFromPoint( + ...elementCenter(frameDoc.querySelector("h1")) + ); + resolve(offset); + } catch (error) { + reject(error); + } }; }); }; diff --git a/tests/wpt/tests/css/cssom/caretPositionFromPoint.html b/tests/wpt/tests/css/cssom/caretPositionFromPoint.html new file mode 100644 index 00000000000..a268acac425 --- /dev/null +++ b/tests/wpt/tests/css/cssom/caretPositionFromPoint.html @@ -0,0 +1,67 @@ + + +document.caretPositionFromPoint() + + + + +
aaa
+ diff --git a/tests/wpt/tests/css/printing/monolithic-overflow-026-print-ref.html b/tests/wpt/tests/css/printing/monolithic-overflow-026-print-ref.html new file mode 100644 index 00000000000..b543a582487 --- /dev/null +++ b/tests/wpt/tests/css/printing/monolithic-overflow-026-print-ref.html @@ -0,0 +1,8 @@ + + + +
+ There should be five pages. +
diff --git a/tests/wpt/tests/css/printing/monolithic-overflow-026-print.html b/tests/wpt/tests/css/printing/monolithic-overflow-026-print.html new file mode 100644 index 00000000000..966391e43bb --- /dev/null +++ b/tests/wpt/tests/css/printing/monolithic-overflow-026-print.html @@ -0,0 +1,12 @@ + + + + + +
+
+ There should be five pages. +
+
diff --git a/tests/wpt/tests/css/selectors/invalidation/user-action-pseudo-classes-in-has.html b/tests/wpt/tests/css/selectors/invalidation/user-action-pseudo-classes-in-has.html index f36de7c76fc..97702e546f3 100644 --- a/tests/wpt/tests/css/selectors/invalidation/user-action-pseudo-classes-in-has.html +++ b/tests/wpt/tests/css/selectors/invalidation/user-action-pseudo-classes-in-has.html @@ -37,81 +37,80 @@
diff --git a/tests/wpt/tests/css/selectors/parsing/parse-has-disallow-nesting-has-inside-has.html b/tests/wpt/tests/css/selectors/parsing/parse-has-disallow-nesting-has-inside-has.html index 8ea816b5d89..a633c913d16 100644 --- a/tests/wpt/tests/css/selectors/parsing/parse-has-disallow-nesting-has-inside-has.html +++ b/tests/wpt/tests/css/selectors/parsing/parse-has-disallow-nesting-has-inside-has.html @@ -8,8 +8,6 @@ + + + diff --git a/tests/wpt/tests/css/selectors/parsing/parse-has.html b/tests/wpt/tests/css/selectors/parsing/parse-has.html index 949040838cf..1c0f254ba52 100644 --- a/tests/wpt/tests/css/selectors/parsing/parse-has.html +++ b/tests/wpt/tests/css/selectors/parsing/parse-has.html @@ -37,5 +37,4 @@ test_invalid_selector(':has()'); test_invalid_selector(':has(123)'); test_invalid_selector(':has(.a, 123)'); - test_valid_forgiving_selector(':has(:is(.a, 123))'); diff --git a/tests/wpt/tests/css/selectors/parsing/parse-state.html b/tests/wpt/tests/css/selectors/parsing/parse-state.html new file mode 100644 index 00000000000..35a8364181e --- /dev/null +++ b/tests/wpt/tests/css/selectors/parsing/parse-state.html @@ -0,0 +1,24 @@ + + +CSS Selectors: custom state pseudo selectors + + + + + diff --git a/tests/wpt/tests/css/selectors/user-invalid.html b/tests/wpt/tests/css/selectors/user-invalid.html index e726791b30a..12a3b83862c 100644 --- a/tests/wpt/tests/css/selectors/user-invalid.html +++ b/tests/wpt/tests/css/selectors/user-invalid.html @@ -48,6 +48,16 @@ promise_test(async () => { assert_false(input.matches(":user-valid"), "No change happened, still does not match :user-valid"); assert_false(input.matches(":user-invalid"), "No change happened, still does not match :user-invalid"); + input.value = "not an email"; + + assert_false(input.matches(":user-valid"), "Programatically set value, :user-valid should not match"); + assert_false(input.matches(":user-invalid"), "Programatically set value, :user-invalid should not match"); + + input.value = ""; + + assert_false(input.matches(":user-valid"), "Programatically cleared value, :user-valid should not match"); + assert_false(input.matches(":user-invalid"), "Programatically cleared value, :user-invalid should not match"); + await test_driver.click(input); await test_driver.send_keys(input, "not an email"); input.blur(); diff --git a/tests/wpt/tests/css/selectors/user-valid.html b/tests/wpt/tests/css/selectors/user-valid.html index 9960fc846a0..009286f0eb5 100644 --- a/tests/wpt/tests/css/selectors/user-valid.html +++ b/tests/wpt/tests/css/selectors/user-valid.html @@ -47,6 +47,16 @@ promise_test(async () => { assert_false(input.matches(":user-valid"), "No change happened, still does not match :user-valid"); assert_false(input.matches(":user-invalid"), "No change happened, still does not match :user-invalid"); + input.value = "test@example.com"; + + assert_false(input.matches(":user-valid"), "Programatically set value, :user-valid should not match"); + assert_false(input.matches(":user-invalid"), "Programatically set value, :user-invalid should not match"); + + input.value = ""; + + assert_false(input.matches(":user-valid"), "Programatically cleared value, :user-valid should not match"); + assert_false(input.matches(":user-invalid"), "Programatically cleared value, :user-invalid should not match"); + await test_driver.click(input); await test_driver.send_keys(input, "test@example.com"); input.blur(); diff --git a/tests/wpt/tests/css/support/interpolation-testcommon.js b/tests/wpt/tests/css/support/interpolation-testcommon.js index 211018ca053..115067465fe 100644 --- a/tests/wpt/tests/css/support/interpolation-testcommon.js +++ b/tests/wpt/tests/css/support/interpolation-testcommon.js @@ -104,59 +104,6 @@ }, }; - var cssTransitionsInterpolationAllowDiscrete = { - name: 'CSS Transitions with transition-behavior:allow-discrete', - isSupported: function() {return true;}, - supportsProperty: function() {return true;}, - supportsValue: function() {return true;}, - setup: function(property, from, target) { - target.style.setProperty(property, isNeutralKeyframe(from) ? '' : from); - }, - nonInterpolationExpectations: function(from, to) { - return expectFlip(from, to, 0.5); - }, - notAnimatableExpectations: function(from, to, underlying) { - return expectFlip(from, to, -Infinity); - }, - interpolate: function(property, from, to, at, target, behavior) { - // Force a style recalc on target to set the 'from' value. - getComputedStyle(target).getPropertyValue(property); - target.style.transitionDuration = '100s'; - target.style.transitionDelay = '-50s'; - target.style.transitionTimingFunction = createEasing(at); - target.style.transitionProperty = property; - target.style.transitionBehavior = 'allow-discrete'; - target.style.setProperty(property, isNeutralKeyframe(to) ? '' : to); - }, - }; - - var cssTransitionAllInterpolationAllowDiscrete = { - name: 'CSS Transitions with transition-property:all and transition-behavor:allow-discrete', - isSupported: function() {return true;}, - // The 'all' value doesn't cover custom properties. - supportsProperty: function(property) {return property.indexOf('--') !== 0;}, - supportsValue: function() {return true;}, - setup: function(property, from, target) { - target.style.setProperty(property, isNeutralKeyframe(from) ? '' : from); - }, - nonInterpolationExpectations: function(from, to) { - return expectFlip(from, to, 0.5); - }, - notAnimatableExpectations: function(from, to, underlying) { - return expectFlip(from, to, -Infinity); - }, - interpolate: function(property, from, to, at, target, behavior) { - // Force a style recalc on target to set the 'from' value. - getComputedStyle(target).getPropertyValue(property); - target.style.transitionDuration = '100s'; - target.style.transitionDelay = '-50s'; - target.style.transitionTimingFunction = createEasing(at); - target.style.transitionProperty = 'all'; - target.style.transitionBehavior = 'allow-discrete'; - target.style.setProperty(property, isNeutralKeyframe(to) ? '' : to); - }, - }; - var webAnimationsInterpolation = { name: 'Web Animations', isSupported: function() {return 'animate' in Element.prototype;}, @@ -488,19 +435,13 @@ function test_not_animatable(options) { test_interpolation(options, expectNotAnimatable); } - function create_tests(addAllowDiscreteTests) { + function create_tests() { var interpolationMethods = [ cssTransitionsInterpolation, cssTransitionAllInterpolation, cssAnimationsInterpolation, webAnimationsInterpolation, ]; - if (addAllowDiscreteTests) { - interpolationMethods = [ - cssTransitionsInterpolationAllowDiscrete, - cssTransitionAllInterpolationAllowDiscrete, - ].concat(interpolationMethods); - } var container = createElement(document.body); var targets = createTestTargets(interpolationMethods, interpolationTests, compositionTests, container); // Separate interpolation and measurement into different phases to avoid O(n^2) of the number of targets. @@ -515,7 +456,7 @@ function test_interpolation(options, expectations) { interpolationTests.push({options, expectations}); - create_tests(expectations === expectNoInterpolation || expectations === expectNotAnimatable); + create_tests(); interpolationTests = []; } function test_composition(options, expectations) { diff --git a/tests/wpt/tests/dom/observable/tentative/observable-constructor.any.js b/tests/wpt/tests/dom/observable/tentative/observable-constructor.any.js index 42e1f615a98..f2360e2c683 100644 --- a/tests/wpt/tests/dom/observable/tentative/observable-constructor.any.js +++ b/tests/wpt/tests/dom/observable/tentative/observable-constructor.any.js @@ -101,27 +101,38 @@ test(() => { const error = new Error("error"); const results = []; let errorReported = null; + let innerSubscriber = null; + let subscriptionActivityInFinallyAfterThrow; + let subscriptionActivityInErrorHandlerAfterThrow; self.addEventListener("error", e => errorReported = e, {once: true}); const source = new Observable((subscriber) => { + innerSubscriber = subscriber; subscriber.next(1); - throw error; - // TODO(https://github.com/WICG/observable/issues/76): If we add the - // `subscriber.closed` attribute, consider a try-finally block to assert - // that `subscriber.closed` is true after throwing. Also TODO: ensure that - // that would even be the right behavior. + try { + throw error; + } finally { + subscriptionActivityInFinallyAfterThrow = subscriber.active; + } }); source.subscribe({ next: (x) => results.push(x), - error: (e) => results.push(e), + error: (e) => { + subscriptionActivityInErrorHandlerAfterThrow = innerSubscriber.active; + results.push(e); + }, complete: () => assert_unreached("complete should not be called"), }); assert_equals(errorReported, null, "The global error handler should not be " + "invoked when the subscribe callback throws an error and the " + "subscriber has given an error handler"); + assert_true(subscriptionActivityInFinallyAfterThrow, "Subscriber is " + + "considered active in finally block before error handler is invoked"); + assert_false(subscriptionActivityInErrorHandlerAfterThrow, "Subscriber is " + + "considered inactive in error handler block after thrown error"); assert_array_equals( results, [1, error], @@ -129,14 +140,64 @@ test(() => { ); }, "Observable should error if initializer throws"); -// TODO(https://github.com/WICG/observable/issues/76): If we decide the -// `subscriber.closed` attribute is needed, re-visit these two tests that were -// originally included: -// https://github.com/web-platform-tests/wpt/blob/0246526ca46ef4e5eae8b8e4a87dd905c40f5326/dom/observable/tentative/observable-ctor.any.js#L123-L137. +test(t => { + let innerSubscriber = null; + let activeAfterComplete = false; + let activeDuringComplete = false; -// TODO(domfarolino): Add a test asserting that `Subscriber#signal` != the -// actual `AbortSignal` passed into `subscribe()`. See -// https://github.com/web-platform-tests/wpt/pull/42219#discussion_r1361243283. + const source = new Observable((subscriber) => { + innerSubscriber = subscriber; + + subscriber.complete(); + activeAfterComplete = subscriber.active; + }); + + source.subscribe({complete: () => activeDuringComplete = innerSubscriber.active}); + assert_false(activeDuringComplete, "Subscription is not active during complete"); + assert_false(activeAfterComplete, "Subscription is not active after complete"); +}, "Subscription is inactive after complete()"); + +test(t => { + let innerSubscriber = null; + let activeAfterError = false; + let activeDuringError = false; + + const error = new Error("error"); + const source = new Observable((subscriber) => { + innerSubscriber = subscriber; + + subscriber.error(error); + activeAfterError = subscriber.active; + }); + + source.subscribe({error: () => activeDuringError = innerSubscriber.active}); + assert_false(activeDuringError, "Subscription is not active during error"); + assert_false(activeAfterError, "Subscription is not active after error"); +}, "Subscription is inactive after error()"); + +test(t => { + let initialActivity; + + const source = new Observable((subscriber) => { + initialActivity = subscriber.active; + }); + + const ac = new AbortController(); + ac.abort(); + source.subscribe({signal: ac.signal}); + assert_false(initialActivity); +}, "Subscription is inactive when aborted signal is passed in"); + +test(() => { + let outerSubscriber = null; + + const source = new Observable(subscriber => outerSubscriber = subscriber); + + const controller = new AbortController(); + source.subscribe({signal: controller.signal}); + + assert_not_equals(controller.signal, outerSubscriber.signal); +}, "Subscriber#signal is not the same AbortSignal as the one passed into `subscribe()`"); test(() => { const results = []; @@ -396,6 +457,112 @@ test(() => { }, "Errors pushed by initializer function after subscriber is closed by " + "error are reported"); +test(() => { + const results = []; + const target = new EventTarget(); + + const source = new Observable((subscriber) => { + target.addEventListener('custom event', e => { + subscriber.next(1); + subscriber.complete(); + subscriber.error('not a real error'); + }); + }); + + source.subscribe({ + next: (x) => results.push(x), + error: (error) => results.push(error), + complete: () => { + results.push('complete'), + // Re-entrantly tries to invoke `complete()`. However, this function must + // only ever run once. + target.dispatchEvent(new Event('custom event')); + }, + }); + + target.dispatchEvent(new Event('custom event')); + + assert_array_equals( + results, + [1, 'complete'], + "complete() can only be called once, and cannot invoke other Observer methods" + ); +}, "Subscriber#complete() cannot re-entrantly invoke itself"); + +test(() => { + const results = []; + const target = new EventTarget(); + + const source = new Observable((subscriber) => { + target.addEventListener('custom event', e => { + subscriber.next(1); + subscriber.error('not a real error'); + subscriber.complete(); + }); + }); + + source.subscribe({ + next: (x) => results.push(x), + error: (error) => { + results.push('error'), + // Re-entrantly tries to invoke `error()`. However, this function must + // only ever run once. + target.dispatchEvent(new Event('custom event')); + }, + complete: () => results.push('complete'), + }); + + target.dispatchEvent(new Event('custom event')); + + assert_array_equals( + results, + [1, 'error'], + "error() can only be called once, and cannot invoke other Observer methods" + ); +}, "Subscriber#error() cannot re-entrantly invoke itself"); + +// TODO(domfarolino): Once `Subscriber#addTeardown()` and `Subscriber#active` +// are implemented, add corresponding code for them here so we can assert the following order of everything: +// 1. The passed-in `Observer#signal` is marked as `aborted` +// 2. Abort event handlers are invoked for the that outer, passed-in signal. +// 3. `Subscriber#closed` is true +// 4. `Subscriber#signal` is marked as aborted +// 5. Teardown callbacks are executed in the right order +// 6. Abort event handlers are invoked for `Subscriber#signal`. +// This ensures we have the "dependent signal" logic wired up correctly: +// https://dom.spec.whatwg.org/#create-a-dependent-abort-signal. +test(() => { + const results = []; + let innerSubscriber = null; + + const source = new Observable((subscriber) => { + results.push('subscribe() callback'); + innerSubscriber = subscriber; + + subscriber.signal.addEventListener('abort', () => { + assert_true(subscriber.signal.aborted); + subscriber.next('inner abort handler'); + }); + }); + + const ac = new AbortController(); + source.subscribe({ + next: (x) => results.push(x), + signal: ac.signal, + }); + + ac.signal.addEventListener('abort', () => { + results.push('outer abort handler'); + assert_true(ac.signal.aborted); + assert_false(innerSubscriber.signal.aborted); + }); + + assert_array_equals(results, ['subscribe() callback']); + ac.abort(); + assert_array_equals(results, ['subscribe() callback', + 'outer abort handler', 'inner abort handler']); +}, "Unsubscription lifecycle"); + // TODO(domfarolino): If we add `subscriber.closed`, assert that its value is // `true` in this test. See https://github.com/WICG/observable/issues/76. test(t => { diff --git a/tests/wpt/tests/dpub-aam/META.yml b/tests/wpt/tests/dpub-aam/META.yml index 5552a2e82eb..98228f6717e 100644 --- a/tests/wpt/tests/dpub-aam/META.yml +++ b/tests/wpt/tests/dpub-aam/META.yml @@ -1,3 +1,4 @@ spec: https://w3c.github.io/dpub-aam/ suggested_reviewers: - spectranaut + - cookiecrook diff --git a/tests/wpt/tests/dpub-aam/manual/META.yml b/tests/wpt/tests/dpub-aam/manual/META.yml new file mode 100644 index 00000000000..5552a2e82eb --- /dev/null +++ b/tests/wpt/tests/dpub-aam/manual/META.yml @@ -0,0 +1,3 @@ +spec: https://w3c.github.io/dpub-aam/ +suggested_reviewers: + - spectranaut diff --git a/tests/wpt/tests/dpub-aam/README.md b/tests/wpt/tests/dpub-aam/manual/README.md similarity index 100% rename from tests/wpt/tests/dpub-aam/README.md rename to tests/wpt/tests/dpub-aam/manual/README.md diff --git a/tests/wpt/tests/dpub-aam/doc-abstract-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-abstract-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-abstract-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-abstract-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-acknowledgments-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-acknowledgments-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-acknowledgments-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-acknowledgments-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-afterword-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-afterword-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-afterword-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-afterword-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-appendix-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-appendix-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-appendix-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-appendix-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-backlink-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-backlink-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-backlink-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-backlink-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-biblioentry-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-biblioentry-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-biblioentry-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-biblioentry-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-bibliography-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-bibliography-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-bibliography-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-bibliography-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-biblioref-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-biblioref-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-biblioref-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-biblioref-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-chapter-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-chapter-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-chapter-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-chapter-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-colophon-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-colophon-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-colophon-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-colophon-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-conclusion-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-conclusion-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-conclusion-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-conclusion-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-cover-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-cover-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-cover-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-cover-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-credit-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-credit-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-credit-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-credit-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-credits-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-credits-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-credits-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-credits-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-dedication-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-dedication-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-dedication-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-dedication-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-endnote-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-endnote-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-endnote-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-endnote-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-endnotes-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-endnotes-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-endnotes-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-endnotes-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-epigraph-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-epigraph-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-epigraph-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-epigraph-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-epilogue-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-epilogue-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-epilogue-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-epilogue-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-errata-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-errata-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-errata-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-errata-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-example-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-example-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-example-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-example-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-footnote-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-footnote-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-footnote-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-footnote-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-foreword-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-foreword-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-foreword-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-foreword-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-glossary-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-glossary-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-glossary-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-glossary-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-glossref-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-glossref-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-glossref-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-glossref-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-index-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-index-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-index-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-index-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-introduction-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-introduction-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-introduction-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-introduction-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-noteref-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-noteref-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-noteref-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-noteref-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-notice-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-notice-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-notice-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-notice-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-pagebreak-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-pagebreak-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-pagebreak-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-pagebreak-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-pagelist-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-pagelist-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-pagelist-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-pagelist-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-part-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-part-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-part-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-part-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-preface-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-preface-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-preface-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-preface-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-prologue-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-prologue-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-prologue-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-prologue-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-pullquote-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-pullquote-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-pullquote-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-pullquote-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-qna-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-qna-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-qna-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-qna-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-subtitle-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-subtitle-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-subtitle-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-subtitle-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-tip-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-tip-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-tip-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-tip-manual.html diff --git a/tests/wpt/tests/dpub-aam/doc-toc-manual.html b/tests/wpt/tests/dpub-aam/manual/doc-toc-manual.html similarity index 100% rename from tests/wpt/tests/dpub-aam/doc-toc-manual.html rename to tests/wpt/tests/dpub-aam/manual/doc-toc-manual.html diff --git a/tests/wpt/tests/dpub-aam/role/roles.html b/tests/wpt/tests/dpub-aam/role/roles.html new file mode 100644 index 00000000000..b9840976e1f --- /dev/null +++ b/tests/wpt/tests/dpub-aam/role/roles.html @@ -0,0 +1,63 @@ + + + + Simple DPUB-AAM Role Verification Tests + + + + + + + + + +

DPUB-AAM changed expectations for role description and other details since the initial v1.0 implementations, many of which are not yet testable via WPT, but this tests the new DPUB `computedrole` mapping expectations. Additional rationale in ARIA #1887.

+ + + + \ No newline at end of file diff --git a/tests/wpt/tests/editing/crashtests/delete-at-next-to-svg-display-table-cell.html b/tests/wpt/tests/editing/crashtests/delete-at-next-to-svg-display-table-cell.html new file mode 100644 index 00000000000..edb38bb9dfa --- /dev/null +++ b/tests/wpt/tests/editing/crashtests/delete-at-next-to-svg-display-table-cell.html @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/tests/wpt/tests/event-timing/resources/event-timing-test-utils.js b/tests/wpt/tests/event-timing/resources/event-timing-test-utils.js index 66aa05a165a..ddbaafbefb6 100644 --- a/tests/wpt/tests/event-timing/resources/event-timing-test-utils.js +++ b/tests/wpt/tests/event-timing/resources/event-timing-test-utils.js @@ -3,15 +3,15 @@ // event handler if |callback| is provided. async function clickOnElementAndDelay(id, delay, callback) { const element = document.getElementById(id); - const clickHandler = () => { + const pointerdownHandler = () => { mainThreadBusy(delay); if (callback) { callback(); } - element.removeEventListener("pointerdown", clickHandler); + element.removeEventListener("pointerdown", pointerdownHandler); }; - element.addEventListener("pointerdown", clickHandler); + element.addEventListener("pointerdown", pointerdownHandler); await test_driver.click(element); } diff --git a/tests/wpt/tests/fenced-frame/default-enabled-features-attribute-change.https.html b/tests/wpt/tests/fenced-frame/default-enabled-features-attribute-change.https.html index 9878e615adb..09bcde5e311 100644 --- a/tests/wpt/tests/fenced-frame/default-enabled-features-attribute-change.https.html +++ b/tests/wpt/tests/fenced-frame/default-enabled-features-attribute-change.https.html @@ -33,7 +33,9 @@ promise_test(async(t) => { fencedframe.element.allow = "attribution-reporting 'none'"; await fencedframe.execute(async () => { - location.reload(); + window.executor.suspend(() => { + location.reload(); + }); }, []); await fencedframe.execute(async () => { diff --git a/tests/wpt/tests/fetch/api/redirect/redirect-keepalive.any.js b/tests/wpt/tests/fetch/api/redirect/redirect-keepalive.any.js index 1cdec79748f..beda8bb8e78 100644 --- a/tests/wpt/tests/fetch/api/redirect/redirect-keepalive.any.js +++ b/tests/wpt/tests/fetch/api/redirect/redirect-keepalive.any.js @@ -14,84 +14,6 @@ const { HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT } = get_host_info(); -/** - * In an iframe, and in `load` event handler, test to fetch a keepalive URL that - * involves in redirect to another URL. - * - * `unloadIframe` to unload the iframe before verifying stashed token to - * simulate the situation that unloads after fetching. Note that this test is - * different from `keepaliveRedirectInUnloadTest()` in that the the latter - * performs fetch() call directly in `unload` event handler, while this test - * does it in `load`. - */ -function keepaliveRedirectTest( - desc, - {origin1 = '', - origin2 = '', - withPreflight = false, - unloadIframe = false} = {}) { - desc = `[keepalive][iframe][load] ${desc}` + - (unloadIframe ? ' [unload at end]' : ''); - promise_test(async (test) => { - const tokenToStash = token(); - const iframe = document.createElement('iframe'); - iframe.src = getKeepAliveAndRedirectIframeUrl( - tokenToStash, origin1, origin2, withPreflight); - document.body.appendChild(iframe); - await iframeLoaded(iframe); - assert_equals(await getTokenFromMessage(), tokenToStash); - if (unloadIframe) { - iframe.remove(); - } - - assertStashedTokenAsync(desc, tokenToStash); - }, `${desc}; setting up`); -} - -/** - * Opens a different site window, and in `unload` event handler, test to fetch - * a keepalive URL that involves in redirect to another URL. - */ -function keepaliveRedirectInUnloadTest(desc, { - origin1 = '', - origin2 = '', - url2 = '', - withPreflight = false, - expectFetchSucceed = true -} = {}) { - desc = `[keepalive][new window][unload] ${desc}`; - - promise_test(async (test) => { - const targetUrl = - `${HTTP_NOTSAMESITE_ORIGIN}/fetch/api/resources/keepalive-redirect-window.html?` + - `origin1=${origin1}&` + - `origin2=${origin2}&` + - `url2=${url2}&` + (withPreflight ? `with-headers` : ``); - const w = window.open(targetUrl); - const token = await getTokenFromMessage(); - w.close(); - - assertStashedTokenAsync( - desc, token, {expectTokenExist: expectFetchSucceed}); - }, `${desc}; setting up`); -} - -for (const unloadIframe of [false, true]) { - keepaliveRedirectTest(`same-origin redirect`, {unloadIframe}); - keepaliveRedirectTest( - `same-origin redirect + preflight`, {withPreflight: true, unloadIframe}); - keepaliveRedirectTest(`cross-origin redirect`, { - origin1: HTTP_REMOTE_ORIGIN, - origin2: HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT, - unloadIframe - }); - keepaliveRedirectTest(`cross-origin redirect + preflight`, { - origin1: HTTP_REMOTE_ORIGIN, - origin2: HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT, - withPreflight: true, - unloadIframe - }); -} keepaliveRedirectInUnloadTest('same-origin redirect'); keepaliveRedirectInUnloadTest( diff --git a/tests/wpt/tests/fetch/api/redirect/redirect-keepalive.https.any.js b/tests/wpt/tests/fetch/api/redirect/redirect-keepalive.https.any.js new file mode 100644 index 00000000000..6765ecac6d7 --- /dev/null +++ b/tests/wpt/tests/fetch/api/redirect/redirect-keepalive.https.any.js @@ -0,0 +1,20 @@ +// META: global=window +// META: title=Fetch API: keepalive handling +// META: script=/resources/testharness.js +// META: script=/resources/testharnessreport.js +// META: script=/common/utils.js +// META: script=/common/get-host-info.sub.js +// META: script=../resources/keepalive-helper.js + +'use strict'; + +const { + HTTP_NOTSAMESITE_ORIGIN, + HTTPS_NOTSAMESITE_ORIGIN, +} = get_host_info(); + +keepaliveRedirectTest(`mixed content redirect`, { + origin1: HTTPS_NOTSAMESITE_ORIGIN, + origin2: HTTP_NOTSAMESITE_ORIGIN, + expectFetchSucceed: false +}); diff --git a/tests/wpt/tests/fetch/api/resources/keepalive-helper.js b/tests/wpt/tests/fetch/api/resources/keepalive-helper.js index b70e22fca0a..f6f511631e5 100644 --- a/tests/wpt/tests/fetch/api/resources/keepalive-helper.js +++ b/tests/wpt/tests/fetch/api/resources/keepalive-helper.js @@ -93,14 +93,12 @@ function assertStashedTokenAsync( })) .then(test.step_func(result => { if (expectTokenExist) { - assert_equals( - result, 'on', `token [${token}] should be on (stashed).`); + assert_equals(result, 'on', `token should be on (stashed).`); test.done(); } else { assert_not_equals( - result, 'on', `token [${token}] should not be on (stashed).`); - return Promise.reject( - `Failed to retrieve token [${token}] from server`); + result, 'on', `token should not be on (stashed).`); + return Promise.reject(`Failed to retrieve token from server`); } })) .catch(test.step_func(e => { @@ -112,3 +110,67 @@ function assertStashedTokenAsync( })); }, testName); } + +/** + * In an iframe, and in `load` event handler, test to fetch a keepalive URL that + * involves in redirect to another URL. + * + * `unloadIframe` to unload the iframe before verifying stashed token to + * simulate the situation that unloads after fetching. Note that this test is + * different from `keepaliveRedirectInUnloadTest()` in that the the latter + * performs fetch() call directly in `unload` event handler, while this test + * does it in `load`. + */ +function keepaliveRedirectTest(desc, { + origin1 = '', + origin2 = '', + withPreflight = false, + unloadIframe = false, + expectFetchSucceed = true, +} = {}) { + desc = `[keepalive][iframe][load] ${desc}` + + (unloadIframe ? ' [unload at end]' : ''); + promise_test(async (test) => { + const tokenToStash = token(); + const iframe = document.createElement('iframe'); + iframe.src = getKeepAliveAndRedirectIframeUrl( + tokenToStash, origin1, origin2, withPreflight); + document.body.appendChild(iframe); + await iframeLoaded(iframe); + assert_equals(await getTokenFromMessage(), tokenToStash); + if (unloadIframe) { + iframe.remove(); + } + + assertStashedTokenAsync( + desc, tokenToStash, {expectTokenExist: expectFetchSucceed}); + }, `${desc}; setting up`); +} + +/** + * Opens a different site window, and in `unload` event handler, test to fetch + * a keepalive URL that involves in redirect to another URL. + */ +function keepaliveRedirectInUnloadTest(desc, { + origin1 = '', + origin2 = '', + url2 = '', + withPreflight = false, + expectFetchSucceed = true +} = {}) { + desc = `[keepalive][new window][unload] ${desc}`; + + promise_test(async (test) => { + const targetUrl = + `${HTTP_NOTSAMESITE_ORIGIN}/fetch/api/resources/keepalive-redirect-window.html?` + + `origin1=${origin1}&` + + `origin2=${origin2}&` + + `url2=${url2}&` + (withPreflight ? `with-headers` : ``); + const w = window.open(targetUrl); + const token = await getTokenFromMessage(); + w.close(); + + assertStashedTokenAsync( + desc, token, {expectTokenExist: expectFetchSucceed}); + }, `${desc}; setting up`); +} diff --git a/tests/wpt/tests/fetch/private-network-access/fenced-frame-no-preflight-required.tentative.https.window.js b/tests/wpt/tests/fetch/private-network-access/fenced-frame-no-preflight-required.tentative.https.window.js index 21233f61ea6..33e94d57f1a 100644 --- a/tests/wpt/tests/fetch/private-network-access/fenced-frame-no-preflight-required.tentative.https.window.js +++ b/tests/wpt/tests/fetch/private-network-access/fenced-frame-no-preflight-required.tentative.https.window.js @@ -17,7 +17,7 @@ setup(() => { // // All fetches unaffected by Private Network Access. -promise_test_parallel( +promise_test( t => fencedFrameTest(t, { source: {server: Server.HTTPS_LOCAL}, target: {server: Server.HTTPS_LOCAL}, @@ -25,7 +25,7 @@ promise_test_parallel( }), 'local to local: no preflight required.'); -promise_test_parallel( +promise_test( t => fencedFrameTest(t, { source: {server: Server.HTTPS_LOCAL}, target: {server: Server.HTTPS_PRIVATE}, @@ -33,7 +33,7 @@ promise_test_parallel( }), 'local to private: no preflight required.'); -promise_test_parallel( +promise_test( t => fencedFrameTest(t, { source: {server: Server.HTTPS_LOCAL}, target: {server: Server.HTTPS_PUBLIC}, @@ -41,7 +41,7 @@ promise_test_parallel( }), 'local to public: no preflight required.'); -promise_test_parallel( +promise_test( t => fencedFrameTest(t, { source: {server: Server.HTTPS_PRIVATE}, target: {server: Server.HTTPS_PRIVATE}, @@ -49,7 +49,7 @@ promise_test_parallel( }), 'private to private: no preflight required.'); -promise_test_parallel( +promise_test( t => fencedFrameTest(t, { source: {server: Server.HTTPS_PRIVATE}, target: {server: Server.HTTPS_PUBLIC}, @@ -57,7 +57,7 @@ promise_test_parallel( }), 'private to public: no preflight required.'); -promise_test_parallel( +promise_test( t => fencedFrameTest(t, { source: {server: Server.HTTPS_PUBLIC}, target: {server: Server.HTTPS_PUBLIC}, @@ -65,7 +65,7 @@ promise_test_parallel( }), 'public to public: no preflight required.'); -promise_test_parallel( +promise_test( t => fencedFrameTest(t, { source: { server: Server.HTTPS_LOCAL, @@ -76,7 +76,7 @@ promise_test_parallel( }), 'treat-as-public-address to public: no preflight required.'); -promise_test_parallel( +promise_test( t => fencedFrameTest(t, { source: { server: Server.HTTPS_LOCAL, diff --git a/tests/wpt/tests/fledge/tentative/direct-from-seller-signals.https.window.js b/tests/wpt/tests/fledge/tentative/direct-from-seller-signals.https.window.js index 5281c813ea7..016c20c2b72 100644 --- a/tests/wpt/tests/fledge/tentative/direct-from-seller-signals.https.window.js +++ b/tests/wpt/tests/fledge/tentative/direct-from-seller-signals.https.window.js @@ -18,15 +18,14 @@ subsetTest(promise_test, async test => { await runReportTest( test, uuid, directFromSellerSignalsValidatorCode( - uuid, /*expectedSellerSignals=*/null, - /*expectedAuctionSignals=*/null, /*expectedPerBuyerSignals=*/null), + uuid, /*expectedSellerSignals=*/ null, + /*expectedAuctionSignals=*/ null, /*expectedPerBuyerSignals=*/ null), // expectedReportUrls [createSellerReportURL(uuid), createBidderReportURL(uuid)], // renderURLOverride null, // auctionConfigOverrides - { directFromSellerSignalsHeaderAdSlot: 'adSlot/0'} - ); + {directFromSellerSignalsHeaderAdSlot: 'adSlot/0'}); }, 'Test directFromSellerSignals with empty Ad-Auction-Signals header.'); subsetTest(promise_test, async test => { @@ -495,3 +494,11 @@ subsetTest(promise_test, async test => { { directFromSellerSignalsHeaderAdSlot: 'adSlot' } ); }, 'Test directFromSellerSignals with network error.'); + +subsetTest(promise_test, async test => { + let dfss = false; + navigator.runAdAuction({ + get directFromSellerSignalsHeaderAdSlot() { dfss = true; } + }).catch((e) => {}); + assert_true(dfss); +}, 'Test directFromSellerSignals feature detection.'); diff --git a/tests/wpt/tests/fs/FileSystemFileHandle-sync-access-handle-back-forward-cache.https.tentative.window.js b/tests/wpt/tests/fs/FileSystemFileHandle-sync-access-handle-back-forward-cache.https.tentative.window.js index 601b5952109..46a6c726abd 100644 --- a/tests/wpt/tests/fs/FileSystemFileHandle-sync-access-handle-back-forward-cache.https.tentative.window.js +++ b/tests/wpt/tests/fs/FileSystemFileHandle-sync-access-handle-back-forward-cache.https.tentative.window.js @@ -31,8 +31,7 @@ createBFCacheTest(async (t, testControls) => { mode, fileName, shouldRestoreFromBFCache) { await forward(); - assert_equals( - await createAndReleaseSAH(mode, fileName), shouldRestoreFromBFCache); + assert_true(await createAndReleaseSAH(mode, fileName)); await back(shouldRestoreFromBFCache); } diff --git a/tests/wpt/tests/fs/FileSystemFileHandle-writable-file-stream-back-forward-cache.https.tentative.window.js b/tests/wpt/tests/fs/FileSystemFileHandle-writable-file-stream-back-forward-cache.https.tentative.window.js index bc3114b4d76..7195dff654d 100644 --- a/tests/wpt/tests/fs/FileSystemFileHandle-writable-file-stream-back-forward-cache.https.tentative.window.js +++ b/tests/wpt/tests/fs/FileSystemFileHandle-writable-file-stream-back-forward-cache.https.tentative.window.js @@ -31,8 +31,7 @@ createBFCacheTest(async (t, testControls) => { mode, fileName, shouldRestoreFromBFCache) { await forward(); - assert_equals( - await createAndReleaseWFS(mode, fileName), shouldRestoreFromBFCache); + assert_true(await createAndReleaseWFS(mode, fileName)); await back(shouldRestoreFromBFCache); } diff --git a/tests/wpt/tests/html-aam/fragile/area-role.html b/tests/wpt/tests/html-aam/fragile/area-role.html index 3ed17f8b3b8..315d4a8e838 100644 --- a/tests/wpt/tests/html-aam/fragile/area-role.html +++ b/tests/wpt/tests/html-aam/fragile/area-role.html @@ -12,10 +12,10 @@ - x - x + x + x -x +x diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_back_1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_back_1.html index 8ccf2059569..0af3206643e 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_back_1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_back_1.html @@ -7,22 +7,20 @@ var t = async_test(); started = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 2) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [2, 1], "Pages opened during history navigation"); - t.done(); - } finally { - win.close(); - } + assert_array_equals(pages, [2, 1], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_back-1.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_back-1.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_entry.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_entry.html index e5929ddbe84..308371c57d1 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_entry.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_entry.html @@ -6,7 +6,6 @@ queue_next(); } else { opener.pages.push(id); - opener.start_test_wait(); } }; diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward-1.html index 5880eacf04c..1bf7d6ee3bc 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward-1.html @@ -8,7 +8,6 @@ queue_next(); } else { opener.pages.push(id); - opener.start_test_wait(); history.forward(); } }; diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward-2.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward-2.html index c7a9a106823..cf8a8d20cde 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward-2.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward-2.html @@ -11,7 +11,5 @@ history.go(-1); }, 100); } - } else { - opener.start_test_wait(); } diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward_1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward_1.html index 220495c7f60..7817649f3a4 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward_1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_forward_1.html @@ -7,22 +7,20 @@ var t = async_test(); started = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 3) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [3, 2, 3], "Pages opened during history navigation"); - t.done(); - } finally { - win.close(); - } + assert_array_equals(pages, [3, 2, 3], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_forward-1.html,history_forward-2.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_forward-1.html,history_forward-2.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html index acd9bda31dc..6a2212f34b9 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html @@ -8,7 +8,6 @@ queue_next(); } else { opener.pages.push(id); - opener.start_test_wait(); if (!opener.gone) { history.go(); opener.gone = true; diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_no_argument.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_no_argument.html index 68aeab20275..11f41614bd1 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_no_argument.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_no_argument.html @@ -8,22 +8,20 @@ started = false; gone = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 3) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation"); - t.done(); - } finally { - win.close(); - } + assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_go_no_argument-1.html,history_forward-2.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_go_no_argument-1.html,history_forward-2.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_to_uri-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_to_uri-1.html index 46c744e95d6..49249ff0002 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_to_uri-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_to_uri-1.html @@ -8,7 +8,6 @@ queue_next(); } else { opener.pages.push(id); - opener.start_test_wait(); if (!opener.gone) { // This is meant to test that passing a string is not supported. // According to the spec, the value passed to 'go' must be an int. diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_to_uri.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_to_uri.html index 43d4a6b0019..e0a891a5a28 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_to_uri.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_to_uri.html @@ -11,22 +11,20 @@ started = false; gone = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 3) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation"); - t.done(); - } finally { - win.close(); - } + assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_go_to_uri-1.html,history_forward-2.html"); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_go_to_uri-1.html,history_forward-2.html"); + t.add_cleanup(function() { win.close(); }); }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html index 5880eacf04c..1bf7d6ee3bc 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html @@ -8,7 +8,6 @@ queue_next(); } else { opener.pages.push(id); - opener.start_test_wait(); history.forward(); } }; diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_undefined.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_undefined.html index ddb0c858c2b..ddc0f588b58 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_undefined.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_undefined.html @@ -7,22 +7,20 @@ var t = async_test(); started = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 3) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation"); - t.done(); - } finally { - win.close(); - } + assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_go_undefined-1.html,history_forward-2.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_go_undefined-1.html,history_forward-2.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_zero-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_zero-1.html index d9d4f330b2e..17e520a810a 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_zero-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_zero-1.html @@ -8,7 +8,6 @@ queue_next(); } else { opener.pages.push(id); - opener.start_test_wait(); if (!opener.gone) { history.go(0); opener.gone = true; diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_zero.html b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_zero.html index 88750921b02..b071b580c30 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_zero.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/history_go_zero.html @@ -8,22 +8,20 @@ started = false; gone = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 3) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation"); - t.done(); - } finally { - win.close(); - } + assert_array_equals(pages, [3, 2, 2], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_go_zero-1.html,history_forward-2.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_go_zero-1.html,history_forward-2.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html index a11fcf2d2d2..13e89e7bc0f 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html @@ -12,7 +12,5 @@ history.go(-1); }, 100); } - } else { - opener.start_test_wait(); } diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html index 64920b4f4f5..fecf060eb79 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html @@ -11,7 +11,5 @@ history.go(1); }, 100); } - } else { - opener.start_test_wait(); } diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html index 1d10033808c..429a97d8355 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html @@ -7,22 +7,20 @@ var t = async_test(); started = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 2) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [6, 3], "Pages opened during history navigation"); - t.done(); - } finally { - // win.close(); - } + assert_array_equals(pages, [6, 3], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_2-1.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_2-1.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html index c49bfd384a2..e7836fedbe4 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html @@ -11,7 +11,5 @@ history.go(3); }, 100); } - } else { - opener.start_test_wait(); } diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html index 1d10033808c..429a97d8355 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html @@ -7,22 +7,20 @@ var t = async_test(); started = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 2) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [6, 3], "Pages opened during history navigation"); - t.done(); - } finally { - // win.close(); - } + assert_array_equals(pages, [6, 3], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_2-1.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_2-1.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html index cf7f72379aa..9211da11728 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html @@ -11,7 +11,5 @@ history.go(-2); }, 100); } - } else { - opener.start_test_wait(); } diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html index 2856bf8d737..136093a2c18 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html @@ -7,22 +7,20 @@ var t = async_test(); started = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { + if (pages.length < 2) + return; clearTimeout(timer); - timer = setTimeout(t.step_func( + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [6, 5], "Pages opened during history navigation"); - t.done(); - } finally { - // win.close(); - } + assert_array_equals(pages, [6, 5], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_4-1.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_4-1.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html index a3f2553fa01..6a28a85683b 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html @@ -11,7 +11,5 @@ history.go(-2); }, 100); } - } else { - opener.start_test_wait(); } diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html index 8725497b501..4d3d6434257 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html @@ -7,22 +7,20 @@ var t = async_test(); started = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 2) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [6, 5], "Pages opened during history navigation"); - t.done(); - } finally { - // win.close(); - } + assert_array_equals(pages, [6, 5], "Pages opened during history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_5-1.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,history_entry.html,history_entry.html,traverse_the_history_5-1.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html index d3f3f6d5d0b..b9d8a0c6942 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html @@ -11,7 +11,5 @@ history.back(); }, 100); } - } else { - opener.start_test_wait(); } diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html index b8215b29f3b..4ef0ea583da 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html @@ -7,24 +7,22 @@ var t = async_test(); started = false; pages = [] - timer = null; unload_ran = false; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 2 || !unload_ran) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - assert_array_equals(pages, [2, 1], "Pages opened during history navigation"); - assert_true(unload_ran, "Unload event handler ran"); - t.done(); - } finally { - // win.close(); - } + assert_array_equals(pages, [2, 1], "Pages opened during history navigation"); + assert_true(unload_ran, "Unload event handler ran"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=traverse_the_history_unload_1-1.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=traverse_the_history_unload_1-1.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html index 0e58cf573d4..922e1832a66 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html @@ -4,9 +4,6 @@ onunload = function() {} opener.pages.push(3); onload = function() { - document.write("4 diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html index 28e363f9168..7372e9f4aef 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html @@ -7,20 +7,16 @@ var t = async_test(); started = false; pages = [] - start_test_wait = t.step_func( + timer = setInterval( function() { - var check_result = t.step_func(function() { - if (pages.length < 5) { - setTimeout(check_result, 500); - return - } - //The pass condition here is based on the idea that the spec is wrong and browsers are right - assert_array_equals(pages, [3, 4, 2, 3, 4], "Pages opened during history navigation"); - t.done(); - }); - setTimeout(check_result, 500); - } - ); + if (pages.length < 5) + return; + setTimeout(t.step_func(function() { + //The pass condition here is based on the idea that the spec is wrong and browsers are right + assert_array_equals(pages, [3, 4, 2, 3, 4], "Pages opened during history navigation"); + t.done(); + }), 500); + }, 50); t.step(function() { win = window.open("history_entry.html?urls=history_forward-1.html,traverse_the_history_write_onload_2-1.html"); t.add_cleanup(function() {win.close()}); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html index 261955533de..70d946c8188 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html @@ -4,9 +4,6 @@ onunload = function() {} opener.pages.push(2); onload = function() { - document.write("3 diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html index ff2729c3cfd..febb4334daf 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html @@ -7,23 +7,21 @@ var t = async_test(); started = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 3) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - //The pass condition here is based on the idea that the spec is wrong and browsers are right - assert_array_equals(pages, [2, 3, 1], "Pages opened durning history navigation"); - t.done(); - } finally { - // win.close(); - } + //The pass condition here is based on the idea that the spec is wrong and browsers are right + assert_array_equals(pages, [2, 3, 1], "Pages opened durning history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=traverse_the_history_write_onload_1-1.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=traverse_the_history_write_onload_1-1.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html index f32bee5e126..27165141091 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html @@ -4,9 +4,6 @@ onunload = function() {} opener.pages.push(3); onload = function() { - document.write("4 diff --git a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html index bc29174b0d5..aa97d22c024 100644 --- a/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html +++ b/tests/wpt/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html @@ -7,23 +7,21 @@ var t = async_test(); started = false; pages = [] - timer = null; - start_test_wait = t.step_func( + timer = setInterval( function() { - clearTimeout(timer); - timer = setTimeout(t.step_func( + if (pages.length < 5) + return; + clearInterval(timer); + setTimeout(t.step_func( function() { - try { - //The pass condition here is based on the idea that the spec is wrong and browsers are right - assert_array_equals(pages, [3, 4, 2, 3, 4], "Pages opened durning history navigation"); - t.done(); - } finally { - win.close(); - } + //The pass condition here is based on the idea that the spec is wrong and browsers are right + assert_array_equals(pages, [3, 4, 2, 3, 4], "Pages opened durning history navigation"); + t.done(); } ), 500); - } - ); - t.step(function() {win = window.open("history_entry.html?urls=history_forward-1.html,traverse_the_history_write_onload_2-1.html"); -}); + }, 50); + t.step(function() { + win = window.open("history_entry.html?urls=history_forward-1.html,traverse_the_history_write_onload_2-1.html"); + t.add_cleanup(function() { win.close(); }); + }); diff --git a/tests/wpt/tests/html/dom/render-blocking/blocking-idl-attr.tentative.html b/tests/wpt/tests/html/dom/render-blocking/blocking-idl-attr.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/blocking-idl-attr.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/blocking-idl-attr.html diff --git a/tests/wpt/tests/html/dom/render-blocking/parser-blocking-script.tentative.html b/tests/wpt/tests/html/dom/render-blocking/parser-blocking-script.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/parser-blocking-script.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/parser-blocking-script.html diff --git a/tests/wpt/tests/html/dom/render-blocking/parser-inserted-async-script.tentative.html b/tests/wpt/tests/html/dom/render-blocking/parser-inserted-async-script.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/parser-inserted-async-script.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/parser-inserted-async-script.html diff --git a/tests/wpt/tests/html/dom/render-blocking/parser-inserted-defer-script.tentative.html b/tests/wpt/tests/html/dom/render-blocking/parser-inserted-defer-script.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/parser-inserted-defer-script.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/parser-inserted-defer-script.html diff --git a/tests/wpt/tests/html/dom/render-blocking/parser-inserted-module-script.tentative.html b/tests/wpt/tests/html/dom/render-blocking/parser-inserted-module-script.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/parser-inserted-module-script.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/parser-inserted-module-script.html diff --git a/tests/wpt/tests/html/dom/render-blocking/parser-inserted-style-element.tentative.html b/tests/wpt/tests/html/dom/render-blocking/parser-inserted-style-element.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/parser-inserted-style-element.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/parser-inserted-style-element.html diff --git a/tests/wpt/tests/html/dom/render-blocking/parser-inserted-stylesheet-link.tentative.html b/tests/wpt/tests/html/dom/render-blocking/parser-inserted-stylesheet-link.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/parser-inserted-stylesheet-link.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/parser-inserted-stylesheet-link.html diff --git a/tests/wpt/tests/html/dom/render-blocking/remove-attr-script-keeps-blocking.tentative.html b/tests/wpt/tests/html/dom/render-blocking/remove-attr-script-keeps-blocking.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/remove-attr-script-keeps-blocking.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/remove-attr-script-keeps-blocking.html diff --git a/tests/wpt/tests/html/dom/render-blocking/remove-attr-style-keeps-blocking.tentative.html b/tests/wpt/tests/html/dom/render-blocking/remove-attr-style-keeps-blocking.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/remove-attr-style-keeps-blocking.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/remove-attr-style-keeps-blocking.html diff --git a/tests/wpt/tests/html/dom/render-blocking/remove-attr-stylesheet-link-keeps-blocking.tentative.html b/tests/wpt/tests/html/dom/render-blocking/remove-attr-stylesheet-link-keeps-blocking.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/remove-attr-stylesheet-link-keeps-blocking.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/remove-attr-stylesheet-link-keeps-blocking.html diff --git a/tests/wpt/tests/html/dom/render-blocking/script-inserted-module-script.tentative.html b/tests/wpt/tests/html/dom/render-blocking/script-inserted-module-script.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/script-inserted-module-script.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/script-inserted-module-script.html diff --git a/tests/wpt/tests/html/dom/render-blocking/script-inserted-style-element.tentative.html b/tests/wpt/tests/html/dom/render-blocking/script-inserted-style-element.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/script-inserted-style-element.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/script-inserted-style-element.html diff --git a/tests/wpt/tests/html/dom/render-blocking/script-inserted-stylesheet-link.tentative.html b/tests/wpt/tests/html/dom/render-blocking/script-inserted-stylesheet-link.html similarity index 100% rename from tests/wpt/tests/html/dom/render-blocking/script-inserted-stylesheet-link.tentative.html rename to tests/wpt/tests/html/dom/render-blocking/script-inserted-stylesheet-link.html diff --git a/tests/wpt/tests/html/rendering/widgets/input-checkbox-switch-rtl-notref.html b/tests/wpt/tests/html/rendering/widgets/input-checkbox-switch-rtl-notref.html new file mode 100644 index 00000000000..02d57baf43d --- /dev/null +++ b/tests/wpt/tests/html/rendering/widgets/input-checkbox-switch-rtl-notref.html @@ -0,0 +1 @@ + diff --git a/tests/wpt/tests/html/rendering/widgets/input-checkbox-switch-rtl.tentative.html b/tests/wpt/tests/html/rendering/widgets/input-checkbox-switch-rtl.tentative.html new file mode 100644 index 00000000000..3e0c5d44c93 --- /dev/null +++ b/tests/wpt/tests/html/rendering/widgets/input-checkbox-switch-rtl.tentative.html @@ -0,0 +1,3 @@ + + + diff --git a/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html b/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html index e2b8846fc3d..0b2b967bfb4 100644 --- a/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html +++ b/tests/wpt/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html @@ -25,7 +25,7 @@ customElements.define('my-control', class extends HTMLElement { static get formAssociated() { return true; } }); -['mousedown', 'mouseup', 'pointerdown', 'pointerup', 'click'].forEach(eventName => { +['mousedown', 'mouseup', 'pointerdown', 'pointerup', 'click', 'dblclick'].forEach(eventName => { [true, false].forEach(clickChildElement => { for (const target of targetparent.children) { promise_test(async () => { @@ -39,7 +39,18 @@ customElements.define('my-control', class extends HTMLElement { let targetchild = target.firstElementChild; targetchild.addEventListener(eventName, () => childReceivedEvent = true); - await test_driver.click(clickChildElement ? targetchild : target); + const elementToClick = clickChildElement ? targetchild : target; + if (eventName === 'dblclick') { + await (new test_driver.Actions() + .pointerMove(1, 1, {origin: elementToClick}) + .pointerDown() + .pointerUp() + .pointerDown() + .pointerUp()) + .send(); + } else { + await test_driver.click(elementToClick); + } const parentShouldReceiveEvents = eventName.startsWith('pointer'); assert_equals(parentReceivedEvent, parentShouldReceiveEvents, diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-far.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-far.html new file mode 100644 index 00000000000..b85eb57d052 --- /dev/null +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-far.html @@ -0,0 +1,49 @@ + + + + + + + +
+
+ +
+ + diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-horizontal-far.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-horizontal-far.html new file mode 100644 index 00000000000..d406f81cc59 --- /dev/null +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-horizontal-far.html @@ -0,0 +1,52 @@ + + + + + + + +
+
+ +
+ + diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-horizontal.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-horizontal.html new file mode 100644 index 00000000000..5801a2b163b --- /dev/null +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-horizontal.html @@ -0,0 +1,52 @@ + + + + + + + +
+
+ +
+ + diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-2.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-2.html new file mode 100644 index 00000000000..c314b5ac3fa --- /dev/null +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-2.html @@ -0,0 +1,57 @@ + + + + + + + +
+
+
+ +
+
+ + diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-3.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-3.html new file mode 100644 index 00000000000..53e0823f1aa --- /dev/null +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-3.html @@ -0,0 +1,65 @@ + + + + + + + +
+
+
+
+ +
+
+
+ + diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-4.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-4.html new file mode 100644 index 00000000000..8cdf047e955 --- /dev/null +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-4.html @@ -0,0 +1,58 @@ + + + + + + + +
+
+
+
+ +
+
+ + diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-5.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-5.html new file mode 100644 index 00000000000..5c0f3aa2a5d --- /dev/null +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested-5.html @@ -0,0 +1,61 @@ + + + + + + + +
+
+
+
+ +
+
+ + diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested.html new file mode 100644 index 00000000000..76aa5e55f2a --- /dev/null +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller-nested.html @@ -0,0 +1,57 @@ + + + + + + + +
+
+
+ +
+
+ + diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller.html new file mode 100644 index 00000000000..9caeb6847c0 --- /dev/null +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-scroller.html @@ -0,0 +1,49 @@ + + + + + + + +
+
+ +
+ + diff --git a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-negative-margin.html b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-negative-margin.html index 1651d8dda7d..875160b4ea5 100644 --- a/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-negative-margin.html +++ b/tests/wpt/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-negative-margin.html @@ -24,7 +24,7 @@
-
diff --git a/tests/wpt/tests/html/semantics/forms/the-selectlist-element/selectlist-option-label-rendering-ref.html b/tests/wpt/tests/html/semantics/forms/the-selectlist-element/selectlist-option-label-rendering-ref.html new file mode 100644 index 00000000000..1ab1d547228 --- /dev/null +++ b/tests/wpt/tests/html/semantics/forms/the-selectlist-element/selectlist-option-label-rendering-ref.html @@ -0,0 +1,4 @@ + + + + diff --git a/tests/wpt/tests/html/semantics/forms/the-selectlist-element/selectlist-option-label-rendering.tentative.html b/tests/wpt/tests/html/semantics/forms/the-selectlist-element/selectlist-option-label-rendering.tentative.html new file mode 100644 index 00000000000..c719ee0e070 --- /dev/null +++ b/tests/wpt/tests/html/semantics/forms/the-selectlist-element/selectlist-option-label-rendering.tentative.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/wpt/tests/html/semantics/invokers/invoketarget-fullscreen-behavior.tentative.html b/tests/wpt/tests/html/semantics/invokers/invoketarget-fullscreen-behavior.tentative.html index 09f896942ba..b72020283e1 100644 --- a/tests/wpt/tests/html/semantics/invokers/invoketarget-fullscreen-behavior.tentative.html +++ b/tests/wpt/tests/html/semantics/invokers/invoketarget-fullscreen-behavior.tentative.html @@ -39,6 +39,17 @@ assert_true(invokee.matches(":fullscreen")); }, "invoking div with toggleFullscreen action makes div fullscreen"); + promise_test(async function (t) { + t.add_cleanup(async () => { + invokerbutton.removeAttribute("invokeaction"); + if (document.fullscreenElement) await document.exitFullscreen(); + }); + assert_false(invokee.matches(":fullscreen")); + invokerbutton.setAttribute("invokeaction", "toggleFullscreen"); + invokerbutton.click(); + assert_false(invokee.matches(":fullscreen")); + }, "invoking div with toggleFullscreen action (without user activation) is a no-op"); + promise_test(async function (t) { t.add_cleanup(async () => { invokerbutton.removeAttribute("invokeaction"); diff --git a/tests/wpt/tests/html/semantics/invokers/invoketarget-on-audio-behavior.tentative.html b/tests/wpt/tests/html/semantics/invokers/invoketarget-on-audio-behavior.tentative.html new file mode 100644 index 00000000000..02f3ff6d069 --- /dev/null +++ b/tests/wpt/tests/html/semantics/invokers/invoketarget-on-audio-behavior.tentative.html @@ -0,0 +1,285 @@ + + + + + + + + + + + + + + + diff --git a/tests/wpt/tests/html/semantics/invokers/invoketarget-on-details-behavior.tentative.html b/tests/wpt/tests/html/semantics/invokers/invoketarget-on-details-behavior.tentative.html index 06215f829d9..c6735e26112 100644 --- a/tests/wpt/tests/html/semantics/invokers/invoketarget-on-details-behavior.tentative.html +++ b/tests/wpt/tests/html/semantics/invokers/invoketarget-on-details-behavior.tentative.html @@ -10,7 +10,7 @@
- Details Contents + Details Contents
@@ -27,7 +27,7 @@ promise_test(async function (t) { assert_false(invokee.matches("[open]")); invokee.addEventListener("invoke", (e) => e.preventDefault(), { - once: true, + once: true, }); await clickOn(invokerbutton); t.add_cleanup(() => invokee.removeAttribute('open')); @@ -39,19 +39,44 @@ assert_true(invokee.matches("[open]")); await clickOn(invokerbutton); assert_false(invokee.matches("[open]")); - }, "invoking open details with auto action opens"); + }, "invoking open details with auto action closes"); promise_test(async function (t) { invokee.setAttribute('open', ''); t.add_cleanup(() => invokee.removeAttribute('open')); invokee.addEventListener("invoke", (e) => e.preventDefault(), { - once: true, + once: true, }); assert_true(invokee.matches("[open]")); await clickOn(invokerbutton); assert_true(invokee.matches("[open]")); }, "invoking open details with auto action and preventDefault does not close"); + promise_test(async function (t) { + t.add_cleanup(() => invokee.removeAttribute('open')); + invokee.addEventListener("invoke", (e) => { + invokee.setAttribute('open', ''); + }, { + once: true, + }); + assert_false(invokee.matches("[open]")); + await clickOn(invokerbutton); + assert_false(invokee.matches("[open]")); + }, "invoking details with auto action where event listener opens leads to a closed details"); + + promise_test(async function (t) { + invokee.setAttribute('open', ''); + t.add_cleanup(() => invokee.removeAttribute('open')); + invokee.addEventListener("invoke", (e) => { + invokee.removeAttribute('open'); + }, { + once: true, + }); + assert_true(invokee.matches("[open]")); + await clickOn(invokerbutton); + assert_true(invokee.matches("[open]")); + }, "invoking open details with auto action where event listener closes leads to an open details"); + // toggle promise_test(async function (t) { @@ -77,7 +102,7 @@ invokerbutton.setAttribute("invokeaction", "toggle"); t.add_cleanup(() => invokerbutton.removeAttribute("invokeaction")); invokee.addEventListener("invoke", (e) => e.preventDefault(), { - once: true, + once: true, }); await clickOn(invokerbutton); t.add_cleanup(() => invokee.removeAttribute('open')); @@ -99,7 +124,7 @@ invokerbutton.setAttribute("invokeaction", "toggle"); t.add_cleanup(() => invokerbutton.removeAttribute("invokeaction")); invokee.addEventListener("invoke", (e) => e.preventDefault(), { - once: true, + once: true, }); assert_true(invokee.matches("[open]")); await clickOn(invokerbutton); @@ -141,7 +166,7 @@ t.add_cleanup(() => invokerbutton.removeAttribute("invokeaction")); assert_false(invokee.matches("[open]")); invokee.addEventListener("invoke", (e) => e.preventDefault(), { - once: true, + once: true, }); await clickOn(invokerbutton); t.add_cleanup(() => invokee.removeAttribute('open')); @@ -185,7 +210,7 @@ t.add_cleanup(() => invokee.removeAttribute('open')); assert_true(invokee.matches("[open]")); invokee.addEventListener("invoke", (e) => e.preventDefault(), { - once: true, + once: true, }); await clickOn(invokerbutton); assert_true(invokee.matches("[open]")); diff --git a/tests/wpt/tests/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html b/tests/wpt/tests/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html new file mode 100644 index 00000000000..03312e3fc52 --- /dev/null +++ b/tests/wpt/tests/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + diff --git a/tests/wpt/tests/html/semantics/popovers/popover-anchor-change-display.html b/tests/wpt/tests/html/semantics/popovers/popover-anchor-change-display.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-anchor-change-display.html rename to tests/wpt/tests/html/semantics/popovers/popover-anchor-change-display.tentative.html diff --git a/tests/wpt/tests/html/semantics/popovers/popover-anchor-display-none.html b/tests/wpt/tests/html/semantics/popovers/popover-anchor-display-none.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-anchor-display-none.html rename to tests/wpt/tests/html/semantics/popovers/popover-anchor-display-none.tentative.html diff --git a/tests/wpt/tests/html/semantics/popovers/popover-anchor-display.html b/tests/wpt/tests/html/semantics/popovers/popover-anchor-display.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-anchor-display.html rename to tests/wpt/tests/html/semantics/popovers/popover-anchor-display.tentative.html diff --git a/tests/wpt/tests/html/semantics/popovers/popover-anchor-idl-property.html b/tests/wpt/tests/html/semantics/popovers/popover-anchor-idl-property.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-anchor-idl-property.html rename to tests/wpt/tests/html/semantics/popovers/popover-anchor-idl-property.tentative.html diff --git a/tests/wpt/tests/html/semantics/popovers/popover-anchor-multicol-display.html b/tests/wpt/tests/html/semantics/popovers/popover-anchor-multicol-display.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-anchor-multicol-display.html rename to tests/wpt/tests/html/semantics/popovers/popover-anchor-multicol-display.tentative.html diff --git a/tests/wpt/tests/html/semantics/popovers/popover-anchor-nested-display.html b/tests/wpt/tests/html/semantics/popovers/popover-anchor-nested-display.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-anchor-nested-display.html rename to tests/wpt/tests/html/semantics/popovers/popover-anchor-nested-display.tentative.html diff --git a/tests/wpt/tests/html/semantics/popovers/popover-anchor-nesting.html b/tests/wpt/tests/html/semantics/popovers/popover-anchor-nesting.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-anchor-nesting.html rename to tests/wpt/tests/html/semantics/popovers/popover-anchor-nesting.tentative.html diff --git a/tests/wpt/tests/html/semantics/popovers/popover-anchor-scroll-display.html b/tests/wpt/tests/html/semantics/popovers/popover-anchor-scroll-display.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-anchor-scroll-display.html rename to tests/wpt/tests/html/semantics/popovers/popover-anchor-scroll-display.tentative.html diff --git a/tests/wpt/tests/html/semantics/popovers/popover-anchor-transition.tentative.html b/tests/wpt/tests/html/semantics/popovers/popover-anchor-transition.tentative.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-anchor-transition.tentative.html rename to tests/wpt/tests/html/semantics/popovers/popover-anchor-transition.tentative.tentative.html diff --git a/tests/wpt/tests/html/semantics/popovers/popover-focus-2.html b/tests/wpt/tests/html/semantics/popovers/popover-focus-2.html index b5ad7a586ee..892e5fd68f7 100644 --- a/tests/wpt/tests/html/semantics/popovers/popover-focus-2.html +++ b/tests/wpt/tests/html/semantics/popovers/popover-focus-2.html @@ -12,12 +12,16 @@
+
+
+
+
@@ -55,17 +59,31 @@ promise_test(async t => { assert_equals(document.activeElement,button2,'Hidden popover should be skipped'); await sendShiftTab(); assert_equals(document.activeElement,button1,'Hidden popover should be skipped backwards'); + popover_no_invoker.showPopover(); await sendTab(); await sendTab(); - assert_equals(document.activeElement,invoker1); + assert_equals(document.activeElement,popover_no_invoker,"Focusable popover that is opened without an invoker should get focused"); + await sendTab(); + assert_equals(document.activeElement,invoker0); + await sendEnter(); // Activate the invoker0 + assert_true(popover0.matches(':popover-open'), 'popover0 should be invoked by invoker0'); + assert_equals(document.activeElement,invoker0,'Focus should not move when popover is shown'); + await sendTab(); await sendEnter(); // Activate the invoker assert_true(popover1.matches(':popover-open'), 'popover1 should be invoked by invoker1'); assert_equals(document.activeElement,invoker1,'Focus should not move when popover is shown'); await sendTab(); + // Make invoker1 non-focusable. + invoker1.disabled = true; assert_equals(document.activeElement,inside_popover1,'Focus should move from invoker into the open popover'); await sendTab(); assert_equals(document.activeElement,invoker2,'Focus should move within popover'); - await verifyFocusOrder([button1, button2, invoker1, inside_popover1, invoker2, inside_popover2, button3, button4],'set 1'); + await sendShiftTab(); + await sendShiftTab(); + assert_equals(document.activeElement, button1 ,'Focus should not move back to invoker as it is non-focusable'); + // Reset invoker1 to focusable. + invoker1.disabled = false; + await verifyFocusOrder([button1, button2, invoker0, invoker1, inside_popover1, invoker2, inside_popover2, button3, button4],'set 1'); invoker2.focus(); await sendEnter(); // Activate the nested invoker assert_true(popover2.matches(':popover-open'), 'popover2 should be invoked by nested invoker'); @@ -88,7 +106,7 @@ promise_test(async t => { await sendTab(); assert_equals(document.activeElement,button4,'Focus should skip popovers'); button1.focus(); - await verifyFocusOrder([button1, button2, invoker1, inside_popover1, invoker2, inside_popover3, invoker3, inside_popover2, button3, button4],'set 2'); + await verifyFocusOrder([button1, button2, invoker0, invoker1, inside_popover1, invoker2, inside_popover3, invoker3, inside_popover2, button3, button4],'set 2'); }, "Popover focus navigation"); diff --git a/tests/wpt/tests/html/semantics/popovers/popover-light-dismiss-with-anchor.tentative.html b/tests/wpt/tests/html/semantics/popovers/popover-light-dismiss-with-anchor.tentative.tentative.html similarity index 100% rename from tests/wpt/tests/html/semantics/popovers/popover-light-dismiss-with-anchor.tentative.html rename to tests/wpt/tests/html/semantics/popovers/popover-light-dismiss-with-anchor.tentative.tentative.html diff --git a/tests/wpt/tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.js b/tests/wpt/tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.js index 54008b54405..2addb0fcb91 100644 --- a/tests/wpt/tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.js +++ b/tests/wpt/tests/html/semantics/scripting-1/the-script-element/import-attributes/dynamic-import-with-attributes-argument.any.js @@ -13,6 +13,6 @@ promise_test(async test => { promise_test(test => { return promise_rejects_js(test, TypeError, - import("./export-hello.js", { assert: { type: "notARealType"} } ), + import("./export-hello.js", { with: { type: "notARealType"} } ), "Dynamic import with an unsupported type attribute should fail"); }, "Dynamic import with an unsupported type attribute should fail"); diff --git a/tests/wpt/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator_user_agent.https.html b/tests/wpt/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator_user_agent.https.html index 32c0cb17ee8..10b3dd22497 100644 --- a/tests/wpt/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator_user_agent.https.html +++ b/tests/wpt/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator_user_agent.https.html @@ -26,7 +26,9 @@ assert_equals(typeof highEntropyData["architecture"], "string", "Architecture should be a string"); assert_equals(typeof highEntropyData["model"], "string", "Model should be a string"); assert_equals(typeof highEntropyData["uaFullVersion"], "string", "UAFullVersion should be a string"); - assert_equals(typeof highEntropyData["formFactor"], "string", "FormFactor should be a string"); + for (formFactor of highEntropyData['formFactor']) { + assert_equals(typeof formFactor, "string", "Each FormFactor should be a string"); + } for (brandVersionPair of highEntropyData['fullVersionList']) { assert_equals(typeof brandVersionPair.brand, "string", "brand should be a string"); assert_regexp_match(brandVersionPair.brand, brandRegex, "brand should not contain unexpected characters"); @@ -39,7 +41,7 @@ assert_false("model" in highEntropyData2, "Model should be an empty string"); assert_false("uaFullVersion" in highEntropyData2, "UAFullVersion should be an empty string"); assert_false("formFactor" in highEntropyData2, "FormFactor should be an empty string"); - assert_false("fullVersionList" in highEntropyData2, "fullVersionList should be an empty string"); + assert_false("fullVersionList" in highEntropyData2, "fullVersionList should not be present"); let finalPromise = uaData.getHighEntropyValues([]).then(() => { assert_true(didMicrotaskRun, "getHighEntropyValues queued on a task"); }); diff --git a/tests/wpt/tests/interfaces/FedCM.idl b/tests/wpt/tests/interfaces/FedCM.idl index 5ef1ca8bc11..9b18d951f83 100644 --- a/tests/wpt/tests/interfaces/FedCM.idl +++ b/tests/wpt/tests/interfaces/FedCM.idl @@ -3,6 +3,21 @@ // (https://github.com/w3c/webref) // Source: Federated Credential Management API (https://fedidcg.github.io/FedCM/) +enum LoginStatus { + "logged-in", + "logged-out", +}; + +[Exposed=Window, SecureContext] + +interface NavigatorLogin { + Promise setStatus(LoginStatus status); +}; + +partial interface Navigator { + [SecureContext] readonly attribute NavigatorLogin login; +}; + [Exposed=Window, SecureContext] interface IdentityCredential : Credential { readonly attribute USVString? token; @@ -51,6 +66,7 @@ dictionary IdentityProviderAPIConfig { required USVString accounts_endpoint; required USVString client_metadata_endpoint; required USVString id_assertion_endpoint; + required USVString login_url; IdentityProviderBranding branding; }; @@ -84,5 +100,6 @@ dictionary IdentityUserInfo { }; [Exposed=Window, SecureContext] interface IdentityProvider { + static undefined close(); static Promise> getUserInfo(IdentityProviderConfig config); }; diff --git a/tests/wpt/tests/interfaces/accelerometer.idl b/tests/wpt/tests/interfaces/accelerometer.idl index fc8fc07ff77..a082224dc88 100644 --- a/tests/wpt/tests/interfaces/accelerometer.idl +++ b/tests/wpt/tests/interfaces/accelerometer.idl @@ -26,15 +26,3 @@ interface LinearAccelerationSensor : Accelerometer { interface GravitySensor : Accelerometer { constructor(optional AccelerometerSensorOptions options = {}); }; - -dictionary AccelerometerReadingValues { - required double? x; - required double? y; - required double? z; -}; - -dictionary LinearAccelerationReadingValues : AccelerometerReadingValues { -}; - -dictionary GravityReadingValues : AccelerometerReadingValues { -}; diff --git a/tests/wpt/tests/interfaces/ambient-light.idl b/tests/wpt/tests/interfaces/ambient-light.idl index 6d9c8e03eaa..011cd934fce 100644 --- a/tests/wpt/tests/interfaces/ambient-light.idl +++ b/tests/wpt/tests/interfaces/ambient-light.idl @@ -8,7 +8,3 @@ interface AmbientLightSensor : Sensor { constructor(optional SensorOptions sensorOptions = {}); readonly attribute double? illuminance; }; - -dictionary AmbientLightReadingValues { - required double? illuminance; -}; diff --git a/tests/wpt/tests/interfaces/css-font-loading.idl b/tests/wpt/tests/interfaces/css-font-loading.idl index 6f2e16dd641..100f1f7fed5 100644 --- a/tests/wpt/tests/interfaces/css-font-loading.idl +++ b/tests/wpt/tests/interfaces/css-font-loading.idl @@ -10,7 +10,6 @@ dictionary FontFaceDescriptors { CSSOMString weight = "normal"; CSSOMString stretch = "normal"; CSSOMString unicodeRange = "U+0-10FFFF"; - CSSOMString variant = "normal"; CSSOMString featureSettings = "normal"; CSSOMString variationSettings = "normal"; CSSOMString display = "auto"; @@ -30,7 +29,6 @@ interface FontFace { attribute CSSOMString weight; attribute CSSOMString stretch; attribute CSSOMString unicodeRange; - attribute CSSOMString variant; attribute CSSOMString featureSettings; attribute CSSOMString variationSettings; attribute CSSOMString display; diff --git a/tests/wpt/tests/interfaces/css-view-transitions-2.idl b/tests/wpt/tests/interfaces/css-view-transitions-2.idl index 6d23f406b01..fe1f0e30e7d 100644 --- a/tests/wpt/tests/interfaces/css-view-transitions-2.idl +++ b/tests/wpt/tests/interfaces/css-view-transitions-2.idl @@ -7,3 +7,24 @@ interface PageRevealEvent : Event { readonly attribute ViewTransition? viewTransition; }; + +dictionary StartViewTransitionOptions { + UpdateCallback? update = null; + sequence? type = null; +}; + +partial interface Document { + + ViewTransition startViewTransition(optional (UpdateCallback or StartViewTransitionOptions) callbackOptions = {}); +}; + +partial interface CSSRule { + const unsigned short VIEW_TRANSITION_RULE = 15; +}; + +enum ViewTransitionNavigation { "auto", "none" }; +[Exposed=Window] +interface CSSViewTransitionRule : CSSRule { + attribute ViewTransitionNavigation navigation; + attribute DOMTokenList type; +}; diff --git a/tests/wpt/tests/interfaces/css-view-transitions.idl b/tests/wpt/tests/interfaces/css-view-transitions.idl index 745eb1d9691..ce39b7dcfce 100644 --- a/tests/wpt/tests/interfaces/css-view-transitions.idl +++ b/tests/wpt/tests/interfaces/css-view-transitions.idl @@ -3,10 +3,6 @@ // (https://github.com/w3c/webref) // Source: CSS View Transitions Module Level 1 (https://drafts.csswg.org/css-view-transitions-1/) -partial interface Document { - ViewTransition startViewTransition(optional UpdateCallback? updateCallback = null); -}; - callback UpdateCallback = Promise (); [Exposed=Window] diff --git a/tests/wpt/tests/interfaces/dom.idl b/tests/wpt/tests/interfaces/dom.idl index c2def872fa2..929fa8d03b3 100644 --- a/tests/wpt/tests/interfaces/dom.idl +++ b/tests/wpt/tests/interfaces/dom.idl @@ -396,6 +396,7 @@ dictionary ShadowRootInit { required ShadowRootMode mode; boolean delegatesFocus = false; SlotAssignmentMode slotAssignment = "named"; + boolean clonable = false; }; [Exposed=Window, diff --git a/tests/wpt/tests/interfaces/edit-context.idl b/tests/wpt/tests/interfaces/edit-context.idl index 011130480e9..eb3174e25f5 100644 --- a/tests/wpt/tests/interfaces/edit-context.idl +++ b/tests/wpt/tests/interfaces/edit-context.idl @@ -24,16 +24,11 @@ interface EditContext : EventTarget { undefined updateSelectionBounds(DOMRect selectionBounds); undefined updateCharacterBounds(unsigned long rangeStart, sequence characterBounds); - sequence attachedElements(); + sequence attachedElements(); readonly attribute DOMString text; readonly attribute unsigned long selectionStart; readonly attribute unsigned long selectionEnd; - readonly attribute unsigned long compositionRangeStart; - readonly attribute unsigned long compositionRangeEnd; - readonly attribute boolean isComposing; - readonly attribute DOMRect controlBounds; - readonly attribute DOMRect selectionBounds; readonly attribute unsigned long characterBoundsRangeStart; sequence characterBounds(); @@ -62,8 +57,6 @@ interface TextUpdateEvent : Event { readonly attribute DOMString text; readonly attribute unsigned long selectionStart; readonly attribute unsigned long selectionEnd; - readonly attribute unsigned long compositionStart; - readonly attribute unsigned long compositionEnd; }; enum UnderlineStyle { "none", "solid", "double", "dotted", "dashed", "wavy" }; diff --git a/tests/wpt/tests/interfaces/fetch.idl b/tests/wpt/tests/interfaces/fetch.idl index 81a5e69aee5..5038aeba6cd 100644 --- a/tests/wpt/tests/interfaces/fetch.idl +++ b/tests/wpt/tests/interfaces/fetch.idl @@ -76,7 +76,7 @@ dictionary RequestInit { any window; // can only be set to null }; -enum RequestDestination { "", "audio", "audioworklet", "document", "embed", "font", "frame", "iframe", "image", "manifest", "object", "paintworklet", "report", "script", "sharedworker", "style", "track", "video", "worker", "xslt" }; +enum RequestDestination { "", "audio", "audioworklet", "document", "embed", "font", "frame", "iframe", "image", "json", "manifest", "object", "paintworklet", "report", "script", "sharedworker", "style", "track", "video", "worker", "xslt" }; enum RequestMode { "navigate", "same-origin", "no-cors", "cors" }; enum RequestCredentials { "omit", "same-origin", "include" }; enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" }; diff --git a/tests/wpt/tests/interfaces/generic-sensor.idl b/tests/wpt/tests/interfaces/generic-sensor.idl index 157072f6341..a997bb62c2a 100644 --- a/tests/wpt/tests/interfaces/generic-sensor.idl +++ b/tests/wpt/tests/interfaces/generic-sensor.idl @@ -28,33 +28,3 @@ interface SensorErrorEvent : Event { dictionary SensorErrorEventInit : EventInit { required DOMException error; }; - -dictionary MockSensorConfiguration { - required MockSensorType mockSensorType; - boolean connected = true; - double? maxSamplingFrequency; - double? minSamplingFrequency; -}; - -dictionary MockSensor { - double maxSamplingFrequency; - double minSamplingFrequency; - double requestedSamplingFrequency; -}; - -enum MockSensorType { - "ambient-light", - "accelerometer", - "linear-acceleration", - "gravity", - "gyroscope", - "magnetometer", - "uncalibrated-magnetometer", - "absolute-orientation", - "relative-orientation", - "geolocation", - "proximity", -}; - -dictionary MockSensorReadingValues { -}; diff --git a/tests/wpt/tests/interfaces/geolocation-sensor.idl b/tests/wpt/tests/interfaces/geolocation-sensor.idl index e1d676205ff..89117af3753 100644 --- a/tests/wpt/tests/interfaces/geolocation-sensor.idl +++ b/tests/wpt/tests/interfaces/geolocation-sensor.idl @@ -35,13 +35,3 @@ dictionary GeolocationSensorReading { double? heading; double? speed; }; - -dictionary GeolocationReadingValues { - required double? latitude; - required double? longitude; - required double? altitude; - required double? accuracy; - required double? altitudeAccuracy; - required double? heading; - required double? speed; -}; diff --git a/tests/wpt/tests/interfaces/gyroscope.idl b/tests/wpt/tests/interfaces/gyroscope.idl index 00fb0efcace..fd80669bfc2 100644 --- a/tests/wpt/tests/interfaces/gyroscope.idl +++ b/tests/wpt/tests/interfaces/gyroscope.idl @@ -16,9 +16,3 @@ enum GyroscopeLocalCoordinateSystem { "device", "screen" }; dictionary GyroscopeSensorOptions : SensorOptions { GyroscopeLocalCoordinateSystem referenceFrame = "device"; }; - -dictionary GyroscopeReadingValues { - required double? x; - required double? y; - required double? z; -}; diff --git a/tests/wpt/tests/interfaces/html.idl b/tests/wpt/tests/interfaces/html.idl index c7f744ccbe6..bfda8a96084 100644 --- a/tests/wpt/tests/interfaces/html.idl +++ b/tests/wpt/tests/interfaces/html.idl @@ -48,6 +48,8 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement; [LegacyOverrideBuiltIns] partial interface Document { + static Document parseHTMLUnsafe(DOMString html); + // resource metadata management [PutForwards=href, LegacyUnforgeable] readonly attribute Location? location; attribute USVString domain; @@ -1196,6 +1198,7 @@ dictionary FormDataEventInit : EventInit { interface HTMLDetailsElement : HTMLElement { [HTMLConstructor] constructor(); + [CEReactions] attribute DOMString name; [CEReactions] attribute boolean open; }; @@ -1236,6 +1239,8 @@ interface HTMLTemplateElement : HTMLElement { [HTMLConstructor] constructor(); readonly attribute DocumentFragment content; + [CEReactions] attribute DOMString shadowRootMode; + [CEReactions] attribute boolean shadowRootDelegatesFocus; }; [Exposed=Window] @@ -1686,6 +1691,22 @@ interface mixin ElementContentEditable { [CEReactions] attribute DOMString inputMode; }; +[Exposed=Window] +interface CloseWatcher : EventTarget { + constructor(optional CloseWatcherOptions options = {}); + + undefined requestClose(); + undefined close(); + undefined destroy(); + + attribute EventHandler oncancel; + attribute EventHandler onclose; +}; + +dictionary CloseWatcherOptions { + AbortSignal signal; +}; + [Exposed=Window] interface DataTransfer { constructor(); @@ -2225,6 +2246,14 @@ enum DOMParserSupportedType { "image/svg+xml" }; +partial interface Element { + undefined setHTMLUnsafe(DOMString html); +}; + +partial interface ShadowRoot { + undefined setHTMLUnsafe(DOMString html); +}; + [Exposed=Window] interface Navigator { // objects implementing this interface also implement the interfaces given below diff --git a/tests/wpt/tests/interfaces/image-capture.idl b/tests/wpt/tests/interfaces/image-capture.idl index f98912cb6a1..21e03d4db82 100644 --- a/tests/wpt/tests/interfaces/image-capture.idl +++ b/tests/wpt/tests/interfaces/image-capture.idl @@ -89,7 +89,7 @@ partial dictionary MediaTrackCapabilities { MediaSettingsRange tilt; MediaSettingsRange zoom; - boolean torch; + sequence torch; }; partial dictionary MediaTrackConstraintSet { diff --git a/tests/wpt/tests/interfaces/magnetometer.idl b/tests/wpt/tests/interfaces/magnetometer.idl index 45ba9edcfe5..ded7e3cba82 100644 --- a/tests/wpt/tests/interfaces/magnetometer.idl +++ b/tests/wpt/tests/interfaces/magnetometer.idl @@ -29,18 +29,3 @@ interface UncalibratedMagnetometer : Sensor { readonly attribute double? yBias; readonly attribute double? zBias; }; - -dictionary MagnetometerReadingValues { - required double? x; - required double? y; - required double? z; -}; - -dictionary UncalibratedMagnetometerReadingValues { - required double? x; - required double? y; - required double? z; - required double? xBias; - required double? yBias; - required double? zBias; -}; diff --git a/tests/wpt/tests/interfaces/managed-configuration.idl b/tests/wpt/tests/interfaces/managed-configuration.idl new file mode 100644 index 00000000000..c04bf787cdc --- /dev/null +++ b/tests/wpt/tests/interfaces/managed-configuration.idl @@ -0,0 +1,20 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: Managed Configuration API (https://wicg.github.io/WebApiDevice/managed_config/) + +[ + SecureContext +] partial interface Navigator { + [SecureContext, SameObject] + readonly attribute NavigatorManagedData managed; +}; + +[ + SecureContext, + Exposed=Window +] interface NavigatorManagedData : EventTarget { + // Managed Configuration API. + Promise> getManagedConfiguration(sequence keys); + attribute EventHandler onmanagedconfigurationchange; +}; diff --git a/tests/wpt/tests/interfaces/media-source.idl b/tests/wpt/tests/interfaces/media-source.idl index 11059437f62..adaac2ca9b2 100644 --- a/tests/wpt/tests/interfaces/media-source.idl +++ b/tests/wpt/tests/interfaces/media-source.idl @@ -4,14 +4,14 @@ // Source: Media Source Extensions™ (https://w3c.github.io/media-source/) enum ReadyState { - "closed", - "open", - "ended" + "closed", + "open", + "ended", }; enum EndOfStreamError { - "network", - "decode" + "network", + "decode", }; [Exposed=(Window,DedicatedWorker)] @@ -41,8 +41,8 @@ interface MediaSource : EventTarget { interface MediaSourceHandle {}; enum AppendMode { - "segments", - "sequence" + "segments", + "sequence", }; [Exposed=(Window,DedicatedWorker)] diff --git a/tests/wpt/tests/interfaces/mediasession.idl b/tests/wpt/tests/interfaces/mediasession.idl index 83c1eb59dff..2cca3674a5e 100644 --- a/tests/wpt/tests/interfaces/mediasession.idl +++ b/tests/wpt/tests/interfaces/mediasession.idl @@ -28,7 +28,8 @@ enum MediaSessionAction { "togglecamera", "hangup", "previousslide", - "nextslide" + "nextslide", + "enterpictureinpicture" }; callback MediaSessionActionHandler = undefined(MediaSessionActionDetails details); diff --git a/tests/wpt/tests/interfaces/orientation-sensor.idl b/tests/wpt/tests/interfaces/orientation-sensor.idl index 5172c87cd4e..6b258642c3b 100644 --- a/tests/wpt/tests/interfaces/orientation-sensor.idl +++ b/tests/wpt/tests/interfaces/orientation-sensor.idl @@ -26,10 +26,3 @@ interface AbsoluteOrientationSensor : OrientationSensor { interface RelativeOrientationSensor : OrientationSensor { constructor(optional OrientationSensorOptions sensorOptions = {}); }; - -dictionary AbsoluteOrientationReadingValues { - required FrozenArray? quaternion; -}; - -dictionary RelativeOrientationReadingValues : AbsoluteOrientationReadingValues { -}; diff --git a/tests/wpt/tests/interfaces/performance-timeline.idl b/tests/wpt/tests/interfaces/performance-timeline.idl index cdd8fafd8c6..6ef84b6cbb8 100644 --- a/tests/wpt/tests/interfaces/performance-timeline.idl +++ b/tests/wpt/tests/interfaces/performance-timeline.idl @@ -12,10 +12,12 @@ typedef sequence PerformanceEntryList; [Exposed=(Window,Worker)] interface PerformanceEntry { + readonly attribute unsigned long long id; readonly attribute DOMString name; readonly attribute DOMString entryType; readonly attribute DOMHighResTimeStamp startTime; readonly attribute DOMHighResTimeStamp duration; + readonly attribute unsigned long long navigationId; [Default] object toJSON(); }; diff --git a/tests/wpt/tests/interfaces/proximity.idl b/tests/wpt/tests/interfaces/proximity.idl index 3cbfbd5ad13..67513adb141 100644 --- a/tests/wpt/tests/interfaces/proximity.idl +++ b/tests/wpt/tests/interfaces/proximity.idl @@ -10,9 +10,3 @@ interface ProximitySensor : Sensor { readonly attribute double? max; readonly attribute boolean? near; }; - -dictionary ProximityReadingValues { - required double? distance; - required double? max; - required boolean? near; -}; diff --git a/tests/wpt/tests/interfaces/storage-buckets.idl b/tests/wpt/tests/interfaces/storage-buckets.idl index f3d500a5711..1a83988d00d 100644 --- a/tests/wpt/tests/interfaces/storage-buckets.idl +++ b/tests/wpt/tests/interfaces/storage-buckets.idl @@ -18,14 +18,8 @@ interface StorageBucketManager { Promise delete(DOMString name); }; -enum StorageBucketDurability { - "strict", - "relaxed" -}; - dictionary StorageBucketOptions { - boolean? persisted = null; - StorageBucketDurability? durability = null; + boolean persisted = false; unsigned long long? quota = null; DOMHighResTimeStamp? expires = null; }; @@ -40,8 +34,6 @@ interface StorageBucket { Promise estimate(); - Promise durability(); - Promise setExpires(DOMHighResTimeStamp expires); Promise expires(); diff --git a/tests/wpt/tests/interfaces/streams.idl b/tests/wpt/tests/interfaces/streams.idl index 838bf39c6d6..6f0f3a6fa76 100644 --- a/tests/wpt/tests/interfaces/streams.idl +++ b/tests/wpt/tests/interfaces/streams.idl @@ -174,6 +174,7 @@ dictionary Transformer { TransformerStartCallback start; TransformerTransformCallback transform; TransformerFlushCallback flush; + TransformerCancelCallback cancel; any readableType; any writableType; }; @@ -181,6 +182,7 @@ dictionary Transformer { callback TransformerStartCallback = any (TransformStreamDefaultController controller); callback TransformerFlushCallback = Promise (TransformStreamDefaultController controller); callback TransformerTransformCallback = Promise (any chunk, TransformStreamDefaultController controller); +callback TransformerCancelCallback = Promise (any reason); [Exposed=*] interface TransformStreamDefaultController { diff --git a/tests/wpt/tests/interfaces/turtledove.idl b/tests/wpt/tests/interfaces/turtledove.idl index c7f49f70a92..4700a98038c 100644 --- a/tests/wpt/tests/interfaces/turtledove.idl +++ b/tests/wpt/tests/interfaces/turtledove.idl @@ -39,6 +39,7 @@ dictionary GenerateBidInterestGroup { dictionary AuctionAdInterestGroup : GenerateBidInterestGroup { double priority = 0.0; record prioritySignalsOverrides; + DOMString additionalBidKey; }; [SecureContext] @@ -51,6 +52,12 @@ dictionary AuctionAdInterestGroupKey { required USVString name; }; +[SecureContext] +partial interface Navigator { + Promise clearOriginJoinedAdInterestGroups( + USVString owner, optional sequence interestGroupsToKeep = []); +}; + [SecureContext] partial interface Navigator { Promise<(USVString or FencedFrameConfig)?> runAdAuction(AuctionAdConfig config); @@ -63,21 +70,29 @@ dictionary AuctionAdConfig { sequence interestGroupBuyers; Promise auctionSignals; Promise sellerSignals; - Promise directFromSellerSignals; + Promise directFromSellerSignalsHeaderAdSlot; unsigned long long sellerTimeout; unsigned short sellerExperimentGroupId; USVString sellerCurrency; Promise> perBuyerSignals; Promise> perBuyerTimeouts; + Promise> perBuyerCumulativeTimeouts; record perBuyerGroupLimits; record perBuyerExperimentGroupIds; record> perBuyerPrioritySignals; Promise> perBuyerCurrencies; sequence componentAuctions = []; + Promise additionalBids; + DOMString auctionNonce; AbortSignal? signal; Promise resolveToConfig; }; +[SecureContext] +partial interface Navigator { + Promise createAuctionNonce(); +}; + [Exposed=InterestGroupScriptRunnerGlobalScope] interface InterestGroupScriptRunnerGlobalScope { }; @@ -131,6 +146,10 @@ partial interface Navigator { undefined updateAdInterestGroups(); }; +partial dictionary RequestInit { + boolean adAuctionHeaders; +}; + dictionary PreviousWin { required long long timeDelta; required DOMString adJSON; @@ -191,6 +210,19 @@ dictionary ReportWinBrowserSignals : ReportingBrowserSignals { DOMString buyerReportingId; unsigned short modelingSignals; unsigned long dataVersion; + KAnonStatus kAnonStatus; +}; + +enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", "notCalculated" }; + +dictionary DirectFromSellerSignalsForBuyer { + any auctionSignals = null; + any perBuyerSignals = null; +}; + +dictionary DirectFromSellerSignalsForSeller { + any auctionSignals = null; + any sellerSignals = null; }; dictionary ScoreAdOutput { diff --git a/tests/wpt/tests/interfaces/urlpattern.idl b/tests/wpt/tests/interfaces/urlpattern.idl index e342eb50abd..788486bb627 100644 --- a/tests/wpt/tests/interfaces/urlpattern.idl +++ b/tests/wpt/tests/interfaces/urlpattern.idl @@ -1,7 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT // Content was automatically extracted by Reffy into webref // (https://github.com/w3c/webref) -// Source: URLPattern API (https://wicg.github.io/urlpattern/) +// Source: URL Pattern Standard (https://urlpattern.spec.whatwg.org/) typedef (USVString or URLPatternInit) URLPatternInput; diff --git a/tests/wpt/tests/interfaces/web-bluetooth-scanning.idl b/tests/wpt/tests/interfaces/web-bluetooth-scanning.idl new file mode 100644 index 00000000000..88016e3e28e --- /dev/null +++ b/tests/wpt/tests/interfaces/web-bluetooth-scanning.idl @@ -0,0 +1,67 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: Web Bluetooth Scanning (https://webbluetoothcg.github.io/web-bluetooth/scanning.html) + +dictionary BluetoothLEScanOptions { + sequence filters; + boolean keepRepeatedDevices = false; + boolean acceptAllAdvertisements = false; +}; + +partial interface Bluetooth { + [SecureContext] + Promise requestLEScan(optional BluetoothLEScanOptions options = {}); +}; + +[Exposed=Window, SecureContext] +interface BluetoothDataFilter { + constructor(optional BluetoothDataFilterInit init = {}); + readonly attribute ArrayBuffer dataPrefix; + readonly attribute ArrayBuffer mask; +}; + +[Exposed=Window, SecureContext] +interface BluetoothManufacturerDataFilter { + constructor(optional object init); + readonly maplike; +}; + +[Exposed=Window, SecureContext] +interface BluetoothServiceDataFilter { + constructor(optional object init); + readonly maplike; +}; + +[Exposed=Window, SecureContext] +interface BluetoothLEScanFilter { + constructor(optional BluetoothLEScanFilterInit init = {}); + readonly attribute DOMString? name; + readonly attribute DOMString? namePrefix; + readonly attribute FrozenArray services; + readonly attribute BluetoothManufacturerDataFilter manufacturerData; + readonly attribute BluetoothServiceDataFilter serviceData; +}; + +[Exposed=Window, SecureContext] +interface BluetoothLEScan { + readonly attribute FrozenArray filters; + readonly attribute boolean keepRepeatedDevices; + readonly attribute boolean acceptAllAdvertisements; + + readonly attribute boolean active; + + undefined stop(); +}; + +dictionary BluetoothLEScanPermissionDescriptor : PermissionDescriptor { + // These match BluetoothLEScanOptions. + sequence filters; + boolean keepRepeatedDevices = false; + boolean acceptAllAdvertisements = false; +}; + +[Exposed=Window, SecureContext] +interface BluetoothLEScanPermissionResult : PermissionStatus { + attribute FrozenArray scans; +}; diff --git a/tests/wpt/tests/interfaces/webauthn.idl b/tests/wpt/tests/interfaces/webauthn.idl index 888040f53d7..f210c6c9a17 100644 --- a/tests/wpt/tests/interfaces/webauthn.idl +++ b/tests/wpt/tests/interfaces/webauthn.idl @@ -7,14 +7,16 @@ interface PublicKeyCredential : Credential { [SameObject] readonly attribute ArrayBuffer rawId; [SameObject] readonly attribute AuthenticatorResponse response; - [SameObject] readonly attribute DOMString? authenticatorAttachment; + readonly attribute DOMString? authenticatorAttachment; AuthenticationExtensionsClientOutputs getClientExtensionResults(); static Promise isConditionalMediationAvailable(); PublicKeyCredentialJSON toJSON(); }; typedef DOMString Base64URLString; -typedef (RegistrationResponseJSON or AuthenticationResponseJSON) PublicKeyCredentialJSON; +// The structure of this object will be either +// RegistrationResponseJSON or AuthenticationResponseJSON +typedef object PublicKeyCredentialJSON; dictionary RegistrationResponseJSON { required Base64URLString id; @@ -296,6 +298,7 @@ partial dictionary AuthenticationExtensionsClientInputs { dictionary CredentialPropertiesOutput { boolean rk; + USVString authenticatorDisplayName; }; partial dictionary AuthenticationExtensionsClientOutputs { diff --git a/tests/wpt/tests/interfaces/webcodecs.idl b/tests/wpt/tests/interfaces/webcodecs.idl index 08bf0e26e03..48d89d0b477 100644 --- a/tests/wpt/tests/interfaces/webcodecs.idl +++ b/tests/wpt/tests/interfaces/webcodecs.idl @@ -177,6 +177,7 @@ dictionary VideoEncoderConfig { DOMString scalabilityMode; VideoEncoderBitrateMode bitrateMode = "variable"; LatencyMode latencyMode = "quality"; + DOMString contentHint; }; enum HardwareAcceleration { @@ -229,6 +230,7 @@ dictionary EncodedAudioChunkInit { [EnforceRange] required long long timestamp; // microseconds [EnforceRange] unsigned long long duration; // microseconds required BufferSource data; + sequence transfer = []; }; enum EncodedAudioChunkType { @@ -252,6 +254,7 @@ dictionary EncodedVideoChunkInit { [EnforceRange] required long long timestamp; // microseconds [EnforceRange] unsigned long long duration; // microseconds required AllowSharedBufferSource data; + sequence transfer = []; }; enum EncodedVideoChunkType { diff --git a/tests/wpt/tests/interfaces/webgpu.idl b/tests/wpt/tests/interfaces/webgpu.idl index 9ef2b0134c6..98fb84c8979 100644 --- a/tests/wpt/tests/interfaces/webgpu.idl +++ b/tests/wpt/tests/interfaces/webgpu.idl @@ -95,7 +95,7 @@ interface GPUAdapter { readonly attribute boolean isFallbackAdapter; Promise requestDevice(optional GPUDeviceDescriptor descriptor = {}); - Promise requestAdapterInfo(optional sequence unmaskHints = []); + Promise requestAdapterInfo(); }; dictionary GPUDeviceDescriptor @@ -520,6 +520,8 @@ dictionary GPUTextureBindingLayout { enum GPUStorageTextureAccess { "write-only", + "read-only", + "read-write", }; dictionary GPUStorageTextureBindingLayout { @@ -575,10 +577,11 @@ dictionary GPUShaderModuleDescriptor : GPUObjectDescriptorBase { required USVString code; object sourceMap; - record hints; + sequence compilationHints = []; }; dictionary GPUShaderModuleCompilationHint { + required USVString entryPoint; (GPUPipelineLayout or GPUAutoLayoutMode) layout; }; @@ -760,8 +763,8 @@ enum GPUBlendOperation { dictionary GPUDepthStencilState { required GPUTextureFormat format; - required boolean depthWriteEnabled; - required GPUCompareFunction depthCompare; + boolean depthWriteEnabled; + GPUCompareFunction depthCompare; GPUStencilFaceState stencilFront = {}; GPUStencilFaceState stencilBack = {}; @@ -828,6 +831,7 @@ enum GPUVertexFormat { "sint32x2", "sint32x3", "sint32x4", + "unorm10-10-10-2", }; enum GPUVertexStepMode { @@ -1035,6 +1039,7 @@ dictionary GPURenderPassDescriptor dictionary GPURenderPassColorAttachment { required GPUTextureView view; + GPUIntegerCoordinate depthSlice; GPUTextureView resolveTarget; GPUColor clearValue; diff --git a/tests/wpt/tests/interfaces/webmidi.idl b/tests/wpt/tests/interfaces/webmidi.idl index 1acf1ac1d4c..9bab8a5f961 100644 --- a/tests/wpt/tests/interfaces/webmidi.idl +++ b/tests/wpt/tests/interfaces/webmidi.idl @@ -73,7 +73,7 @@ enum MIDIPortConnectionState { [SecureContext, Exposed=Window] interface MIDIMessageEvent : Event { constructor(DOMString type, optional MIDIMessageEventInit eventInitDict = {}); - readonly attribute Uint8Array data; + readonly attribute Uint8Array? data; }; dictionary MIDIMessageEventInit: EventInit { @@ -83,7 +83,7 @@ dictionary MIDIMessageEventInit: EventInit { [SecureContext, Exposed=Window] interface MIDIConnectionEvent : Event { constructor(DOMString type, optional MIDIConnectionEventInit eventInitDict = {}); - readonly attribute MIDIPort port; + readonly attribute MIDIPort? port; }; dictionary MIDIConnectionEventInit: EventInit { diff --git a/tests/wpt/tests/interfaces/webnn.idl b/tests/wpt/tests/interfaces/webnn.idl index fa0908f0e9f..2a9d0e639fb 100644 --- a/tests/wpt/tests/interfaces/webnn.idl +++ b/tests/wpt/tests/interfaces/webnn.idl @@ -44,7 +44,7 @@ enum MLInputOperandLayout { "nhwc" }; -enum MLOperandType { +enum MLOperandDataType { "float32", "float16", "int32", @@ -54,8 +54,8 @@ enum MLOperandType { }; dictionary MLOperandDescriptor { - // The operand type. - required MLOperandType type; + // The operand data type. + required MLOperandDataType dataType; // The dimensions field is only required for tensor operands. sequence dimensions; @@ -134,7 +134,7 @@ interface MLGraphBuilder { MLOperand constant(MLOperandDescriptor descriptor, MLBufferView bufferView); // Create a single-value operand from the specified number of the specified type. - MLOperand constant(double value, optional MLOperandType type = "float32"); + MLOperand constant(double value, optional MLOperandDataType dataType = "float32"); // Compile the graph up to the specified output operands asynchronously. Promise build(MLNamedOperands outputs); diff --git a/tests/wpt/tests/interfaces/webrtc-encoded-transform.idl b/tests/wpt/tests/interfaces/webrtc-encoded-transform.idl index 1a456577d38..3b169b066dc 100644 --- a/tests/wpt/tests/interfaces/webrtc-encoded-transform.idl +++ b/tests/wpt/tests/interfaces/webrtc-encoded-transform.idl @@ -74,6 +74,8 @@ dictionary RTCEncodedVideoFrameMetadata { octet payloadType; sequence contributingSources; long long timestamp; // microseconds + unsigned long rtpTimestamp; + DOMString mimeType; }; // New interfaces to define encoded video and audio frames. Will eventually @@ -81,7 +83,6 @@ dictionary RTCEncodedVideoFrameMetadata { [Exposed=(Window,DedicatedWorker), Serializable] interface RTCEncodedVideoFrame { readonly attribute RTCEncodedVideoFrameType type; - readonly attribute unsigned long timestamp; attribute ArrayBuffer data; RTCEncodedVideoFrameMetadata getMetadata(); }; @@ -91,11 +92,12 @@ dictionary RTCEncodedAudioFrameMetadata { octet payloadType; sequence contributingSources; short sequenceNumber; + unsigned long rtpTimestamp; + DOMString mimeType; }; [Exposed=(Window,DedicatedWorker), Serializable] interface RTCEncodedAudioFrame { - readonly attribute unsigned long timestamp; attribute ArrayBuffer data; RTCEncodedAudioFrameMetadata getMetadata(); }; diff --git a/tests/wpt/tests/interfaces/webtransport.idl b/tests/wpt/tests/interfaces/webtransport.idl index 284ab350829..b9deae28708 100644 --- a/tests/wpt/tests/interfaces/webtransport.idl +++ b/tests/wpt/tests/interfaces/webtransport.idl @@ -9,8 +9,8 @@ interface WebTransportDatagramDuplexStream { readonly attribute WritableStream writable; readonly attribute unsigned long maxDatagramSize; - attribute unrestricted double incomingMaxAge; - attribute unrestricted double outgoingMaxAge; + attribute unrestricted double? incomingMaxAge; + attribute unrestricted double? outgoingMaxAge; attribute unrestricted double incomingHighWaterMark; attribute unrestricted double outgoingHighWaterMark; }; @@ -38,6 +38,7 @@ interface WebTransport { optional WebTransportSendStreamOptions options = {}); /* a ReadableStream of WebTransportReceiveStream objects */ readonly attribute ReadableStream incomingUnidirectionalStreams; + WebTransportSendGroup createSendGroup(); }; enum WebTransportReliabilityMode { @@ -70,11 +71,11 @@ dictionary WebTransportCloseInfo { }; dictionary WebTransportSendStreamOptions { - long long? sendOrder = null; + WebTransportSendGroup? sendGroup = null; + long long sendOrder = 0; }; dictionary WebTransportConnectionStats { - DOMHighResTimeStamp timestamp; unsigned long long bytesSent; unsigned long long packetsSent; unsigned long long bytesLost; @@ -89,7 +90,6 @@ dictionary WebTransportConnectionStats { }; dictionary WebTransportDatagramStats { - DOMHighResTimeStamp timestamp; unsigned long long expiredOutgoing; unsigned long long droppedIncoming; unsigned long long lostOutgoing; @@ -97,24 +97,28 @@ dictionary WebTransportDatagramStats { [Exposed=(Window,Worker), SecureContext, Transferable] interface WebTransportSendStream : WritableStream { - attribute long long? sendOrder; + attribute WebTransportSendGroup? sendGroup; + attribute long long sendOrder; Promise getStats(); }; dictionary WebTransportSendStreamStats { - DOMHighResTimeStamp timestamp; unsigned long long bytesWritten; unsigned long long bytesSent; unsigned long long bytesAcknowledged; }; +[Exposed=(Window,Worker), SecureContext] +interface WebTransportSendGroup { + Promise getStats(); +}; + [Exposed=(Window,Worker), SecureContext, Transferable] interface WebTransportReceiveStream : ReadableStream { Promise getStats(); }; dictionary WebTransportReceiveStreamStats { - DOMHighResTimeStamp timestamp; unsigned long long bytesReceived; unsigned long long bytesRead; }; diff --git a/tests/wpt/tests/interfaces/webusb.idl b/tests/wpt/tests/interfaces/webusb.idl index c9b2c2f55f1..3b362d2351d 100644 --- a/tests/wpt/tests/interfaces/webusb.idl +++ b/tests/wpt/tests/interfaces/webusb.idl @@ -230,6 +230,13 @@ interface USBEndpoint { readonly attribute unsigned long packetSize; }; +// USBBlocklistEntry is never exposed. +dictionary USBBlocklistEntry { + required unsigned short idVendor; + required unsigned short idProduct; + required unsigned short bcdDevice; +}; + dictionary USBPermissionDescriptor : PermissionDescriptor { sequence filters; sequence exclusionFilters; diff --git a/tests/wpt/tests/interfaces/webxr-plane-detection.idl b/tests/wpt/tests/interfaces/webxr-plane-detection.idl new file mode 100644 index 00000000000..037e9e251c7 --- /dev/null +++ b/tests/wpt/tests/interfaces/webxr-plane-detection.idl @@ -0,0 +1,32 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: WebXR Plane Detection Module (https://immersive-web.github.io/real-world-geometry/plane-detection.html) + +enum XRPlaneOrientation { + "horizontal", + "vertical" +}; + +[Exposed=Window] +interface XRPlane { + [SameObject] readonly attribute XRSpace planeSpace; + + readonly attribute FrozenArray polygon; + readonly attribute XRPlaneOrientation? orientation; + readonly attribute DOMHighResTimeStamp lastChangedTime; + readonly attribute DOMString? semanticLabel; +}; + +[Exposed=Window] +interface XRPlaneSet { + readonly setlike; +}; + +partial interface XRFrame { + readonly attribute XRPlaneSet detectedPlanes; +}; + +partial interface XRSession { + Promise initiateRoomCapture(); +}; diff --git a/tests/wpt/tests/interfaces/webxr.idl b/tests/wpt/tests/interfaces/webxr.idl index de2b04691b3..3b7f8a55b7c 100644 --- a/tests/wpt/tests/interfaces/webxr.idl +++ b/tests/wpt/tests/interfaces/webxr.idl @@ -167,7 +167,8 @@ enum XRHandedness { enum XRTargetRayMode { "gaze", "tracked-pointer", - "screen" + "screen", + "transient-pointer" }; [SecureContext, Exposed=Window] diff --git a/tests/wpt/tests/intersection-observer/svg-clipped-rect-target.html b/tests/wpt/tests/intersection-observer/svg-clipped-rect-target.html new file mode 100644 index 00000000000..93ab4d9380b --- /dev/null +++ b/tests/wpt/tests/intersection-observer/svg-clipped-rect-target.html @@ -0,0 +1,71 @@ + +IntersectionObserver observing a clipped SVG <rect> element + + + + + +
+ + + + + + + + +
+ diff --git a/tests/wpt/tests/intersection-observer/svg-container-element.html b/tests/wpt/tests/intersection-observer/svg-container-element.html new file mode 100644 index 00000000000..e2b6ab5cb07 --- /dev/null +++ b/tests/wpt/tests/intersection-observer/svg-container-element.html @@ -0,0 +1,53 @@ + +IntersectionObserver observing an SVG container element changing position + + + + + + + + + + + + diff --git a/tests/wpt/tests/intersection-observer/svg-group-target.html b/tests/wpt/tests/intersection-observer/svg-group-target.html new file mode 100644 index 00000000000..9ebf2f4025f --- /dev/null +++ b/tests/wpt/tests/intersection-observer/svg-group-target.html @@ -0,0 +1,72 @@ + +IntersectionObserver observing an SVG <g> element + + + + + + + + + + + diff --git a/tests/wpt/tests/intersection-observer/svg-image.html b/tests/wpt/tests/intersection-observer/svg-image.html new file mode 100644 index 00000000000..d5c25428206 --- /dev/null +++ b/tests/wpt/tests/intersection-observer/svg-image.html @@ -0,0 +1,51 @@ + +IntersectionObserver observing an SVG image element changing position + + + + + + + + + + diff --git a/tests/wpt/tests/intersection-observer/svg-rect-target.html b/tests/wpt/tests/intersection-observer/svg-rect-target.html new file mode 100644 index 00000000000..e6e639577f3 --- /dev/null +++ b/tests/wpt/tests/intersection-observer/svg-rect-target.html @@ -0,0 +1,67 @@ + +IntersectionObserver observing an SVG <rect> element + + + + + +
+ + + +
+ diff --git a/tests/wpt/tests/intersection-observer/svg-stroke-change.html b/tests/wpt/tests/intersection-observer/svg-stroke-change.html new file mode 100644 index 00000000000..3f01a2a23d1 --- /dev/null +++ b/tests/wpt/tests/intersection-observer/svg-stroke-change.html @@ -0,0 +1,51 @@ + +IntersectionObserver observing an SVG element while its stroke is changed + + + + + + + + + + diff --git a/tests/wpt/tests/intersection-observer/svg-target-changes-position.html b/tests/wpt/tests/intersection-observer/svg-target-changes-position.html new file mode 100644 index 00000000000..b15d7ca0d64 --- /dev/null +++ b/tests/wpt/tests/intersection-observer/svg-target-changes-position.html @@ -0,0 +1,52 @@ + +IntersectionObserver observing an SVG element changing position + + + + + + + + + + + diff --git a/tests/wpt/tests/intersection-observer/svg-transformed-rect-target.html b/tests/wpt/tests/intersection-observer/svg-transformed-rect-target.html new file mode 100644 index 00000000000..c284d650767 --- /dev/null +++ b/tests/wpt/tests/intersection-observer/svg-transformed-rect-target.html @@ -0,0 +1,59 @@ + +IntersectionObserver observing an SVG <rect> element with changing 'transform' + + + + + + + + diff --git a/tests/wpt/tests/intersection-observer/svg-viewbox.html b/tests/wpt/tests/intersection-observer/svg-viewbox.html new file mode 100644 index 00000000000..718b97624ae --- /dev/null +++ b/tests/wpt/tests/intersection-observer/svg-viewbox.html @@ -0,0 +1,49 @@ + +IntersectionObserver observing an SVG <rect> element with changing 'transform' + + + + + + + + diff --git a/tests/wpt/tests/layout-instability/recent-input.html b/tests/wpt/tests/layout-instability/recent-input.html index 2779d4ffe0c..1aa9dfe9fed 100644 --- a/tests/wpt/tests/layout-instability/recent-input.html +++ b/tests/wpt/tests/layout-instability/recent-input.html @@ -25,36 +25,42 @@ promise_test(async t => { assert_implements(window.LayoutShift, 'Layout Instability is not supported.'); // Wait for the initial render to complete. await waitForAnimationFrames(2); - const startTime = performance.now(); - return new Promise(resolve => { + + const observerPromise = new Promise(resolve => { const observer = new PerformanceObserver( - t.step_func(entryList => { - const endTime = performance.now(); - assert_equals(entryList.getEntries().length, 1); - const entry = entryList.getEntries()[0]; - assert_equals(entry.entryType, "layout-shift"); - assert_equals(entry.name, ""); - assert_greater_than_equal(entry.startTime, startTime); - assert_less_than_equal(entry.startTime, endTime); - assert_equals(entry.duration, 0.0); - // The layout shift value should be: - // 300 * (100 + 60) * (60 / maxDimension) / viewport size. - assert_equals(entry.value, computeExpectedScore(300 * (100 + 60), 60)); - // We should see that there was a click input entry. - assert_equals(entry.hadRecentInput, true); - assert_greater_than_equal(timeAfterClick, entry.lastInputTime); - resolve(); - }) - ); - observer.observe({entryTypes: ['layout-shift']}); - // User input event - clickAndBlockMain('button').then(() => { - timeAfterClick = performance.now(); - // Modify the position of the div. - document.getElementById('myDiv').style = "top: 60px"; - }); + entryList => { + resolve(entryList); + } + ).observe({ entryTypes: ['layout-shift'] }); }); + + // User input event + await clickAndBlockMain('button'); + + // Modify the position of the div to trigger layout shift. + document.getElementById('myDiv').style = "top: 60px"; + + const layoutShiftEntryList = await observerPromise; + const endTime = performance.now(); + + assert_equals(layoutShiftEntryList.getEntries().length, 1); + const entry = layoutShiftEntryList.getEntries()[0]; + assert_equals(entry.entryType, "layout-shift"); + assert_equals(entry.name, ""); + assert_greater_than(entry.startTime, startTime, + "The layout shift entry startTime should be greater than the test startTime."); + assert_less_than(entry.startTime, endTime, + "The layout shift entry startTime should be less than the test endTime."); + assert_equals(entry.duration, 0.0); + // The layout shift value should be: + // 300 * (100 + 60) * (60 / maxDimension) / viewport size. + assert_equals(entry.value, computeExpectedScore(300 * (100 + 60), 60)); + // We should see that there was a click input entry. + assert_equals(entry.hadRecentInput, true); + assert_less_than(entry.lastInputTime, entry.startTime, + "The lastInputTime should be less than the layout shift startTime."); + }, 'Layout shift right after user input is observable via PerformanceObserver.'); diff --git a/tests/wpt/tests/lint.ignore b/tests/wpt/tests/lint.ignore index 5a16051bbd4..9755dc5fbeb 100644 --- a/tests/wpt/tests/lint.ignore +++ b/tests/wpt/tests/lint.ignore @@ -213,6 +213,35 @@ SET TIMEOUT: navigation-timing/* SET TIMEOUT: old-tests/submission/Microsoft/history/history_000.htm SET TIMEOUT: paint-timing/resources/subframe-painting.html SET TIMEOUT: performance-timeline/resources/navigation-id-detached-frame-page.html +SET TIMEOUT: png/apng/acTL-plays-one.html +SET TIMEOUT: png/apng/acTL-plays-two.html +SET TIMEOUT: png/apng/fdAT-split-basic.html +SET TIMEOUT: png/apng/fdAT-split-zero-length.html +SET TIMEOUT: png/apng/fcTL-acTL-ordering.html +SET TIMEOUT: png/apng/fcTL-blend-over-repeatedly.html +SET TIMEOUT: png/apng/fcTL-blend-over-solid.html +SET TIMEOUT: png/apng/fcTL-blend-source-nearly-transparent.html +SET TIMEOUT: png/apng/fcTL-blend-source-solid.html +SET TIMEOUT: png/apng/fcTL-blend-source-transparent.html +SET TIMEOUT: png/apng/fcTL-dispose-background-final.html +SET TIMEOUT: png/apng/fcTL-dispose-background.html +SET TIMEOUT: png/apng/fcTL-dispose-before-region-background.html +SET TIMEOUT: png/apng/fcTL-dispose-in-region-background.html +SET TIMEOUT: png/apng/fcTL-dispose-in-region-none.html +SET TIMEOUT: png/apng/fcTL-dispose-in-region-previous.html +SET TIMEOUT: png/apng/fcTL-dispose-none.html +SET TIMEOUT: png/apng/fcTL-dispose-previous-final.html +SET TIMEOUT: png/apng/fcTL-dispose-previous-first.html +SET TIMEOUT: png/apng/fcTL-dispose-previous.html +SET TIMEOUT: png/apng/fdAT-16bit.html +SET TIMEOUT: png/apng/fdAT-1bit-PLTE-tRNS.html +SET TIMEOUT: png/apng/fdAT-1bit-PLTE.html +SET TIMEOUT: png/apng/fdAT-2bit-PLTE-tRNS.html +SET TIMEOUT: png/apng/fdAT-8bit-gray-alpha.html +SET TIMEOUT: png/apng/fdAT-8bit-gray.html +SET TIMEOUT: png/apng/first-frame-IDAT.html +SET TIMEOUT: png/apng/first-frame-not-IDAT.html +SET TIMEOUT: png/apng/tester-check.html SET TIMEOUT: portals/resources/portals-adopt-predecessor-portal.html SET TIMEOUT: preload/single-download-preload.html SET TIMEOUT: preload/resources/slow-exec.js @@ -244,8 +273,8 @@ SET TIMEOUT: service-workers/service-worker/resources/resource-timing-worker.js SET TIMEOUT: shadow-dom/Document-prototype-currentScript.html SET TIMEOUT: shadow-dom/scroll-to-the-fragment-in-shadow-tree.html SET TIMEOUT: shadow-dom/slotchange-event.html -SET TIMEOUT: trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.html -SET TIMEOUT: trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.html +SET TIMEOUT: trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.html +SET TIMEOUT: trusted-types/DOMWindowTimers-setTimeout-setInterval.html SET TIMEOUT: pending-beacon/resources/pending_beacon-helper.js SET TIMEOUT: user-timing/* SET TIMEOUT: web-animations/crashtests/reparent-animating-element-002.html @@ -722,4 +751,4 @@ HTML INVALID SYNTAX: domparsing/DOMParser-parseFromString-xml-parsererror.html HTML INVALID SYNTAX: domparsing/XMLSerializer-serializeToString.html HTML INVALID SYNTAX: html/canvas/element/manual/unclosed-canvas-4.htm HTML INVALID SYNTAX: quirks/percentage-height-calculation.html -HTML INVALID SYNTAX: trusted-types/TrustedTypePolicyFactory-getAttributeType-namespace.tentative.html +HTML INVALID SYNTAX: trusted-types/TrustedTypePolicyFactory-getAttributeType-namespace.html diff --git a/tests/wpt/tests/long-animation-frame/tentative/loaf-event-blocking-duration.html b/tests/wpt/tests/long-animation-frame/tentative/loaf-event-blocking-duration.html new file mode 100644 index 00000000000..daa5f64c39e --- /dev/null +++ b/tests/wpt/tests/long-animation-frame/tentative/loaf-event-blocking-duration.html @@ -0,0 +1,30 @@ + + +Long Animation Frame Timing: blocking duration with events + + + + + + + + + +

Long Animation Frame: blocking duration with events

+
+ + + diff --git a/tests/wpt/tests/png/apng/acTL-plays-one.html b/tests/wpt/tests/png/apng/acTL-plays-one.html new file mode 100644 index 00000000000..d34c204782e --- /dev/null +++ b/tests/wpt/tests/png/apng/acTL-plays-one.html @@ -0,0 +1,34 @@ + + + +PNG Third Edition: animated PNG, plays + + + + + + + + + +

Test passes if this flashes yellow for one second, then stays blue forever

+
+ diff --git a/tests/wpt/tests/png/apng/acTL-plays-two.html b/tests/wpt/tests/png/apng/acTL-plays-two.html new file mode 100644 index 00000000000..147b57957e8 --- /dev/null +++ b/tests/wpt/tests/png/apng/acTL-plays-two.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, plays + + + + + + + + + +

Test passes if this flashes yellow for one second, then + blue for one second, then yellow for one second, then blue forever.

+
+ diff --git a/tests/wpt/tests/png/apng/apng-blue-rect-checkerboard-ref.html b/tests/wpt/tests/png/apng/apng-blue-rect-checkerboard-ref.html new file mode 100644 index 00000000000..0c997d350a1 --- /dev/null +++ b/tests/wpt/tests/png/apng/apng-blue-rect-checkerboard-ref.html @@ -0,0 +1,24 @@ + + + +PNG Third Edition: animated PNG, dispose ops and regions + + + +

Test passes if you see solid blue rectangle containing a smaller region with a grey checkerboard, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/apng-blue-rectangle-ref.html b/tests/wpt/tests/png/apng/apng-blue-rectangle-ref.html new file mode 100644 index 00000000000..51bae3e107e --- /dev/null +++ b/tests/wpt/tests/png/apng/apng-blue-rectangle-ref.html @@ -0,0 +1,23 @@ + + +PNG Third Edition: animated PNG, plays + + + +

Test passes if this flashes yellow for one second, then + blue for one second, then yellow for one second, then blue forever.

+
+ diff --git a/tests/wpt/tests/png/apng/apng-checkerboard-ref.html b/tests/wpt/tests/png/apng/apng-checkerboard-ref.html new file mode 100644 index 00000000000..b7e8dd9c039 --- /dev/null +++ b/tests/wpt/tests/png/apng/apng-checkerboard-ref.html @@ -0,0 +1,24 @@ + + + +PNG Third Edition: animated PNG, dispose ops + + + +

Test passes if you see a grey checkerboard, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/apng-darkblue-rectangle-ref.html b/tests/wpt/tests/png/apng/apng-darkblue-rectangle-ref.html new file mode 100644 index 00000000000..dc781397a8b --- /dev/null +++ b/tests/wpt/tests/png/apng/apng-darkblue-rectangle-ref.html @@ -0,0 +1,22 @@ + + +PNG Third Edition: animated PNG, bit depth + + + +

Test passes if you see a dark blue rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/apng-graywhite-rectangle-ref.html b/tests/wpt/tests/png/apng/apng-graywhite-rectangle-ref.html new file mode 100644 index 00000000000..49dfaa37b49 --- /dev/null +++ b/tests/wpt/tests/png/apng/apng-graywhite-rectangle-ref.html @@ -0,0 +1,8 @@ + + +PNG Third Edition: animated PNG, bit depth. 8bit grayscale + + +

Test passes if you see a gray rectangle, with a white rectangle in the middle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/apng-lime-rectangle-ref.html b/tests/wpt/tests/png/apng/apng-lime-rectangle-ref.html new file mode 100644 index 00000000000..6cc29d40d42 --- /dev/null +++ b/tests/wpt/tests/png/apng/apng-lime-rectangle-ref.html @@ -0,0 +1,8 @@ + + +PNG Third Edition: animated PNG + + +

Test passes if you see a lime green rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/apng-solidgray-rectangle-ref.html b/tests/wpt/tests/png/apng/apng-solidgray-rectangle-ref.html new file mode 100644 index 00000000000..edc42302871 --- /dev/null +++ b/tests/wpt/tests/png/apng/apng-solidgray-rectangle-ref.html @@ -0,0 +1,8 @@ + + +PNG Third Edition: animated PNG, bit depth. blended 8bit grayscale with alpha + + +

Test passes if you see a solid gray rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/apng-solidlime-rectangle-ref.html b/tests/wpt/tests/png/apng/apng-solidlime-rectangle-ref.html new file mode 100644 index 00000000000..26326caebec --- /dev/null +++ b/tests/wpt/tests/png/apng/apng-solidlime-rectangle-ref.html @@ -0,0 +1,8 @@ + + +PNG Third Edition: animated PNG, bit depth. 1-bit palette + + +

Test passes if you see a solid lime green rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/fcTL-acTL-ordering.html b/tests/wpt/tests/png/apng/fcTL-acTL-ordering.html new file mode 100644 index 00000000000..9d9856d9857 --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-acTL-ordering.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, blend ops + + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-blend-over-repeatedly.html b/tests/wpt/tests/png/apng/fcTL-blend-over-repeatedly.html new file mode 100644 index 00000000000..cb42a037a91 --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-blend-over-repeatedly.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, blend ops + + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-blend-over-solid.html b/tests/wpt/tests/png/apng/fcTL-blend-over-solid.html new file mode 100644 index 00000000000..45d79173765 --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-blend-over-solid.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, blend ops + + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-blend-source-nearly-transparent.html b/tests/wpt/tests/png/apng/fcTL-blend-source-nearly-transparent.html new file mode 100644 index 00000000000..98205ca69ba --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-blend-source-nearly-transparent.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, blend ops + + + + + + + + + +

Test passes if you see a grey checkerboard, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-blend-source-solid.html b/tests/wpt/tests/png/apng/fcTL-blend-source-solid.html new file mode 100644 index 00000000000..c00c478d404 --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-blend-source-solid.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, blend ops + + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-blend-source-transparent.html b/tests/wpt/tests/png/apng/fcTL-blend-source-transparent.html new file mode 100644 index 00000000000..1eab83d80db --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-blend-source-transparent.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, blend ops + + + + + + + + + +

Test passes if you see a grey checkerboard, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-background-final.html b/tests/wpt/tests/png/apng/fcTL-dispose-background-final.html new file mode 100644 index 00000000000..d56010eb3db --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-background-final.html @@ -0,0 +1,34 @@ + + + +PNG Third Edition: animated PNG, dispose ops + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-background.html b/tests/wpt/tests/png/apng/fcTL-dispose-background.html new file mode 100644 index 00000000000..a68ed42b98e --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-background.html @@ -0,0 +1,34 @@ + + + +PNG Third Edition: animated PNG, dispose ops + + + + + + + + +

Test passes if you see a grey checkerboard, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-before-region-background.html b/tests/wpt/tests/png/apng/fcTL-dispose-before-region-background.html new file mode 100644 index 00000000000..09570513cfa --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-before-region-background.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, dispose ops and regions + + + + + + + + + +

Test passes if you see a grey checkerboard, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-in-region-background.html b/tests/wpt/tests/png/apng/fcTL-dispose-in-region-background.html new file mode 100644 index 00000000000..5f61da232d4 --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-in-region-background.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, dispose ops and regions + + + + + + + + + +

Test passes if you see solid blue rectangle containing a smaller region with a grey checkerboard, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-in-region-none.html b/tests/wpt/tests/png/apng/fcTL-dispose-in-region-none.html new file mode 100644 index 00000000000..d0bd937e873 --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-in-region-none.html @@ -0,0 +1,36 @@ + + + +PNG Third Edition: animated PNG, dispose ops and regions + + + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-in-region-previous.html b/tests/wpt/tests/png/apng/fcTL-dispose-in-region-previous.html new file mode 100644 index 00000000000..0d15b3c6645 --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-in-region-previous.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, dispose ops + + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-none.html b/tests/wpt/tests/png/apng/fcTL-dispose-none.html new file mode 100644 index 00000000000..f41f17a7c2e --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-none.html @@ -0,0 +1,24 @@ + + + +PNG Third Edition: animated PNG, dispose ops + + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-previous-final.html b/tests/wpt/tests/png/apng/fcTL-dispose-previous-final.html new file mode 100644 index 00000000000..1862fcfad4c --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-previous-final.html @@ -0,0 +1,36 @@ + + + +PNG Third Edition: animated PNG, dispose ops + + + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-previous-first.html b/tests/wpt/tests/png/apng/fcTL-dispose-previous-first.html new file mode 100644 index 00000000000..c3a3ca9ddff --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-previous-first.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, dispose ops + + + + + + + + + +

Test passes if you see a grey checkerboard, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fcTL-dispose-previous.html b/tests/wpt/tests/png/apng/fcTL-dispose-previous.html new file mode 100644 index 00000000000..cf9c408d8e1 --- /dev/null +++ b/tests/wpt/tests/png/apng/fcTL-dispose-previous.html @@ -0,0 +1,35 @@ + + + +PNG Third Edition: animated PNG, dispose ops + + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/fdAT-16bit.html b/tests/wpt/tests/png/apng/fdAT-16bit.html new file mode 100644 index 00000000000..cc595286424 --- /dev/null +++ b/tests/wpt/tests/png/apng/fdAT-16bit.html @@ -0,0 +1,34 @@ + + + +PNG Third Edition: animated PNG, bit depth + + + + + + + + + +

Test passes if you see a dark blue rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/fdAT-1bit-PLTE-tRNS.html b/tests/wpt/tests/png/apng/fdAT-1bit-PLTE-tRNS.html new file mode 100644 index 00000000000..da10d16f6af --- /dev/null +++ b/tests/wpt/tests/png/apng/fdAT-1bit-PLTE-tRNS.html @@ -0,0 +1,34 @@ + + + +PNG Third Edition: animated PNG, bit depth. 1-bit palette and transparency + + + + + + + + + +

Test passes if you see a dark blue rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/fdAT-1bit-PLTE.html b/tests/wpt/tests/png/apng/fdAT-1bit-PLTE.html new file mode 100644 index 00000000000..6b15b198fbe --- /dev/null +++ b/tests/wpt/tests/png/apng/fdAT-1bit-PLTE.html @@ -0,0 +1,34 @@ + + + +PNG Third Edition: animated PNG, bit depth. 1-bit palette + + + + + + + + + +

Test passes if you see a solid lime green rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/fdAT-2bit-PLTE-tRNS.html b/tests/wpt/tests/png/apng/fdAT-2bit-PLTE-tRNS.html new file mode 100644 index 00000000000..5ab6f8e0d6f --- /dev/null +++ b/tests/wpt/tests/png/apng/fdAT-2bit-PLTE-tRNS.html @@ -0,0 +1,34 @@ + + + +PNG Third Edition: animated PNG, bit depth. 2-bit palette and transparency + + + + + + + + + +

Test passes if you see a solid lime green rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/fdAT-8bit-gray-alpha.html b/tests/wpt/tests/png/apng/fdAT-8bit-gray-alpha.html new file mode 100644 index 00000000000..1719ebd1b5c --- /dev/null +++ b/tests/wpt/tests/png/apng/fdAT-8bit-gray-alpha.html @@ -0,0 +1,34 @@ + + + +PNG Third Edition: animated PNG, bit depth. blended 8bit grayscale with alpha + + + + + + + + + +

Test passes if you see a solid gray rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/fdAT-8bit-gray.html b/tests/wpt/tests/png/apng/fdAT-8bit-gray.html new file mode 100644 index 00000000000..969a8867a86 --- /dev/null +++ b/tests/wpt/tests/png/apng/fdAT-8bit-gray.html @@ -0,0 +1,34 @@ + + + +PNG Third Edition: animated PNG, bit depth. 8bit grayscale + + + + + + + + + +

Test passes if you see a gray rectangle, with a white rectangle in the middle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/fdAT-split-basic.html b/tests/wpt/tests/png/apng/fdAT-split-basic.html new file mode 100644 index 00000000000..1c718f0ce42 --- /dev/null +++ b/tests/wpt/tests/png/apng/fdAT-split-basic.html @@ -0,0 +1,20 @@ + + + +PNG Third Edition: animated PNG, split fdAT + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/fdAT-split-zero-length.html b/tests/wpt/tests/png/apng/fdAT-split-zero-length.html new file mode 100644 index 00000000000..68ddec482c5 --- /dev/null +++ b/tests/wpt/tests/png/apng/fdAT-split-zero-length.html @@ -0,0 +1,20 @@ + + + +PNG Third Edition: animated PNG, split fdAT with zero-length chunk + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/first-frame-IDAT.html b/tests/wpt/tests/png/apng/first-frame-IDAT.html new file mode 100644 index 00000000000..8231f66da71 --- /dev/null +++ b/tests/wpt/tests/png/apng/first-frame-IDAT.html @@ -0,0 +1,20 @@ + + + +PNG Third Edition: animated PNG + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/first-frame-not-IDAT.html b/tests/wpt/tests/png/apng/first-frame-not-IDAT.html new file mode 100644 index 00000000000..8abe46d3399 --- /dev/null +++ b/tests/wpt/tests/png/apng/first-frame-not-IDAT.html @@ -0,0 +1,20 @@ + + + +PNG Third Edition: animated PNG + + + + + + + + +

Test passes if you see a lime green rectangle, and no red.

+
+ diff --git a/tests/wpt/tests/png/apng/manual/acTL-plays-one-manual.html b/tests/wpt/tests/png/apng/manual/acTL-plays-one-manual.html new file mode 100644 index 00000000000..66c01e8bc3f --- /dev/null +++ b/tests/wpt/tests/png/apng/manual/acTL-plays-one-manual.html @@ -0,0 +1,25 @@ + + +PNG Third Edition: animated PNG, plays + + + + + + +

Test passes if this flashes yellow for one second, then stays blue forever

+
+ diff --git a/tests/wpt/tests/png/apng/manual/acTL-plays-two-manual.html b/tests/wpt/tests/png/apng/manual/acTL-plays-two-manual.html new file mode 100644 index 00000000000..c7d36da3b3a --- /dev/null +++ b/tests/wpt/tests/png/apng/manual/acTL-plays-two-manual.html @@ -0,0 +1,26 @@ + + +PNG Third Edition: animated PNG, plays + + + + + + +

Test passes if this flashes yellow for one second, then + blue for one second, then yellow for one second, then blue forever.

+
+ diff --git a/tests/wpt/tests/png/apng/manual/acTL-plays-zero-manual.html b/tests/wpt/tests/png/apng/manual/acTL-plays-zero-manual.html new file mode 100644 index 00000000000..e0e0c956866 --- /dev/null +++ b/tests/wpt/tests/png/apng/manual/acTL-plays-zero-manual.html @@ -0,0 +1,25 @@ + + +PNG Third Edition: animated PNG, plays + + + + + + +

Test passes if this flashes yellow for one second, then blue for one second, then repeats forever.

+
+ diff --git a/tests/wpt/tests/png/apng/manual/fcTL-delay-16bit-manual.html b/tests/wpt/tests/png/apng/manual/fcTL-delay-16bit-manual.html new file mode 100644 index 00000000000..8aaefe729e1 --- /dev/null +++ b/tests/wpt/tests/png/apng/manual/fcTL-delay-16bit-manual.html @@ -0,0 +1,25 @@ + + +PNG Third Edition: animated PNG, delays + + + + + + +

Test passes if this flashes blue for half a second, then yellow for one second, then repeats forever.

+
+ diff --git a/tests/wpt/tests/png/apng/manual/fcTL-delay-basic-manual.html b/tests/wpt/tests/png/apng/manual/fcTL-delay-basic-manual.html new file mode 100644 index 00000000000..96ca2eb6e73 --- /dev/null +++ b/tests/wpt/tests/png/apng/manual/fcTL-delay-basic-manual.html @@ -0,0 +1,25 @@ + + +PNG Third Edition: animated PNG, delays + + + + + + +

Test passes if this flashes blue for half a second, then yellow for one second, then repeats forever.

+
+ diff --git a/tests/wpt/tests/png/apng/manual/fcTL-delay-rounding-manual.html b/tests/wpt/tests/png/apng/manual/fcTL-delay-rounding-manual.html new file mode 100644 index 00000000000..e5e925079bb --- /dev/null +++ b/tests/wpt/tests/png/apng/manual/fcTL-delay-rounding-manual.html @@ -0,0 +1,25 @@ + + +PNG Third Edition: animated PNG, delays + + + + + + +

Test passes if this flashes blue for half a second, then yellow for one second, then repeats forever.

+
+ diff --git a/tests/wpt/tests/png/apng/manual/fcTL-delay-zero-denom-manual.html b/tests/wpt/tests/png/apng/manual/fcTL-delay-zero-denom-manual.html new file mode 100644 index 00000000000..eeef22d3da3 --- /dev/null +++ b/tests/wpt/tests/png/apng/manual/fcTL-delay-zero-denom-manual.html @@ -0,0 +1,25 @@ + + +PNG Third Edition: animated PNG, delays + + + + + + +

Test passes if this flashes blue for half a second, then yellow for one second, then repeats forever.

+
+ diff --git a/tests/wpt/tests/png/apng/manual/fcTL-delay-zero-num-manual.html b/tests/wpt/tests/png/apng/manual/fcTL-delay-zero-num-manual.html new file mode 100644 index 00000000000..561d01e4db4 --- /dev/null +++ b/tests/wpt/tests/png/apng/manual/fcTL-delay-zero-num-manual.html @@ -0,0 +1,26 @@ + + +PNG Third Edition: animated PNG, delays + + + + + + +

There may be some brief cyan and magenta flashes; ignore these.

+

Test passes if this flashes blue for half a second, then yellow for one second, then repeats forever.

+
+ diff --git a/tests/wpt/tests/png/apng/nearly-transparent-ref.html b/tests/wpt/tests/png/apng/nearly-transparent-ref.html new file mode 100644 index 00000000000..ff1b137114b --- /dev/null +++ b/tests/wpt/tests/png/apng/nearly-transparent-ref.html @@ -0,0 +1,24 @@ + + + +PNG Third Edition: animated PNG, blend ops + + + +

Test passes if you see a grey checkerboard, and no red.

+
+ + \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/resources/README.md b/tests/wpt/tests/png/apng/resources/README.md new file mode 100644 index 00000000000..ecd61795b14 --- /dev/null +++ b/tests/wpt/tests/png/apng/resources/README.md @@ -0,0 +1,14 @@ +# Regenerating APNG Test Images + +## Test images + +Most of the APNG tests are a port to WPT of an [earlier testsuite by Philip Taylor](https://philip.html5.org/tests/apng/tests.html). The test images were autogenerated, and this directory contains what is needed to regenerate them: + +- ['source.html'](./source.html) which contains a human-readable description of each test file +- ['generate.pl'](./generate.pl) which uses [Cairo](https://www.cairographics.org/) to create the test images + +If this script is used to create additional images, not part of the original test suite, be aware that the generated files are automatically named as sequentially-numbered `nnn.png` so add any new ones _at the end_ to avoid changing the name of existing files. + +## Reference images + +The reference images were created by decompiling the APNG with [apngasm](https://github.com/apngasm/apngasm) into a series of static PNG representing the displayed state of each frame. The last one therefore represents the end state of the animation. Again this tool produces numbered files like `nn.png` so these were renamed in a more meaningful way (such as `darkblue.png`) to create the reference images. diff --git a/tests/wpt/tests/png/apng/resources/generate.pl b/tests/wpt/tests/png/apng/resources/generate.pl new file mode 100644 index 00000000000..631356fb7ea --- /dev/null +++ b/tests/wpt/tests/png/apng/resources/generate.pl @@ -0,0 +1,390 @@ +=pod +Copyright (c) 2007 Philip Taylor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +=cut + +use strict; +use warnings; + +use Compress::Zlib(); +use Cairo; +use PDL qw(float byte); + +sub chunk { + my ($name, $data) = @_; + (pack 'N', length $data) . $name . $data . (pack 'N', Compress::Zlib::crc32($name . $data)); +} + +sub IHDR { + my ($img) = @_; + return chunk 'IHDR', pack 'NNCCCCC', + $img->{width}, $img->{height}, + $img->{bit_depth}, $img->{color_type}, + $img->{compression_method}, $img->{filter_method}, $img->{interlace_method}; +} + +sub gAMA { + my ($img) = @_; + return chunk 'gAMA', pack 'N', $img->{gamma}; +} + +sub sRGB { + my ($img) = @_; + return chunk 'sRGB', pack 'C', $img->{rendering_intent}; +} + +sub PLTE { + my ($img) = @_; + return chunk 'PLTE', pack 'C*', @{$img->{colours}}; +} + +sub tRNS { + my ($img) = @_; + return chunk 'tRNS', pack 'C*', @{$img->{values}}; +} + +sub IDAT { + my ($img) = @_; + return chunk 'IDAT', xdat_data($img); +} + +sub IDAT_split { + my ($img, $blocksize) = @_; + my $c = xdat_data($img); + my @out; + while (length $c) { + push @out, chunk 'IDAT', substr $c, 0, $blocksize, ''; + } + return @out; +} + +sub IEND { + my ($img) = @_; + return chunk 'IEND', ''; +} + +sub acTL { + my ($img) = @_; + return chunk 'acTL', pack 'NN', $img->{num_frames}, $img->{num_plays}; +} + +sub fcTL { + my ($img) = @_; + return chunk 'fcTL', pack 'NNNNNnnCC', + $img->{sequence_number}, + $img->{width}, $img->{height}, + $img->{x_offset}, $img->{y_offset}, + $img->{delay_num}, $img->{delay_den}, + $img->{dispose_op}, $img->{blend_op}; +} + +sub fdAT { + my ($img) = @_; + return chunk 'fdAT', (pack 'N', $img->{sequence_number}) . xdat_data($img); +} + +sub xdat_data { + my ($img) = @_; + return compress(filter($img->{image_data}, $img->{width}, $img->{height}, $img->{depth})); +} + +use constant DISPOSE_NONE => 0; +use constant DISPOSE_BACKGROUND => 1; +use constant DISPOSE_PREVIOUS => 2; +use constant BLEND_SOURCE => 0; +use constant BLEND_OVER => 1; + +sub filter { + my ($imagedata, $width, $height, $depth) = @_; + my $out = ''; + for my $scanline (0..$height-1) { + $out .= pack 'C', 0; + $out .= substr($imagedata, $scanline*$width*$depth/8, $width*$depth/8); + } + return $out; +} + +sub compress { + my ($filtered) = @_; + return Compress::Zlib::compress($filtered); +} + + +sub fix_bitmap { + my ($d) = @_; + # Flip BGRA->RGBA, and undo premultiplication + + my $pdl = float unpack 'C*', $d; + my $pdl2 = byte $pdl; + my $a = 255 / $pdl->mslice([3, -1, 4]); + $pdl2->mslice([0, -1, 4]) .= $pdl->mslice([2, -1, 4])*$a; + $pdl2->mslice([1, -1, 4]) .= $pdl->mslice([1, -1, 4])*$a; + $pdl2->mslice([2, -1, 4]) .= $pdl->mslice([0, -1, 4])*$a; + return ${(byte $pdl2)->get_dataref}; +=pod + my @d = unpack 'C*', $d; + my $a; + for (map $_*4, 0..$#d/4) { + if ($a = $d[$_+3]) { + $a = 255 / $a; + @d[$_, $_+1, $_+2] = ($d[$_+2]*$a, $d[$_+1]*$a, $d[$_]*$a); + } # else alpha=0 hence r=g=b=0, so nothing to do + } + return pack 'C*', @d; +=cut +} + +sub create_surface { + my ($w, $h, $type, @data) = @_; + my $surface = Cairo::ImageSurface->create('argb32', $w, $h); + my $cr = Cairo::Context->create($surface); + + if ($type eq 'red') { + ($type, @data) = ('solid', 1, 0, 0, 1); + } elsif ($type eq 'green') { + ($type, @data) = ('solid', 0, 1, 0, 1); + } elsif ($type eq 'blue') { + ($type, @data) = ('solid', 0, 0, 1, 1); + } elsif ($type eq 'cyan') { + ($type, @data) = ('solid', 0, 1, 1, 1); + } elsif ($type eq 'magenta') { + ($type, @data) = ('solid', 1, 0, 1, 1); + } elsif ($type eq 'yellow') { + ($type, @data) = ('solid', 1, 1, 0, 1); + } elsif ($type eq 'transparent') { + ($type, @data) = ('solid', 0, 0, 0, 0); + } + + if ($type eq 'solid') { + $cr->rectangle(0, 0, $w, $h); + $cr->set_source_rgba(@data); + $cr->fill; + } elsif ($type eq 'doublerect') { + $cr->rectangle(0, 0, $w, $h); + $cr->set_source_rgba(@data[0..3]); + $cr->fill; + $cr->rectangle(int($w/4), int($h/4), int($w/2), int($h/2)); + $cr->set_source_rgba(@data[4..7]); + $cr->fill; + } else { + die "Invalid create_surface type '$type'"; + } + return { width => $w, height => $h, depth => 32, data => fix_bitmap($surface->get_data) }; +} + +sub create_raw_surface { + my ($w, $h, $d, $data) = @_; + return { width => $w, height => $h, depth => $d, data => $data }; +} + +sub find_errors { + my (@img) = @_; + my @chunks; + { + my @img2 = @img; + push @chunks, [ splice @img2, 0, 2 ] while @img2; + } + + my $chunknames = join '', map "<$_->[0]>", @chunks; + + my @errors; + + my $has_actl = ($chunknames =~ //); + + if ($has_actl) { + # acTL must be before IDAT + if ($chunknames =~ /.*/) { + push @errors, "acTL after IDAT"; + } + + # Must have only one acTL (TODO: in spec?) + if ($chunknames =~ /.*/) { + push @errors, "More than one acTL"; + } + + my $num_frames = {@img}->{acTL}[0]; + + # num_frames > 0 + if ($num_frames <= 0) { + push @errors, "num_frames <= 0"; + } + + # num_frames = count(fcTL) + my $num_fctls = grep $_->[0] eq 'fcTL', @chunks; + if ($num_frames != $num_fctls) { + push @errors, "num_frames ($num_frames) != number of fcTLs ($num_fctls)"; + } + } + + # Check sequence numbers (start from 0, no duplicates or gaps) + my @seqnos; + for (grep { $_->[0] =~ /^(fcTL|fdAT|fdAT_split)$/ } @chunks) { + push @seqnos, $_->[1][0]; + } + if (@seqnos and (join ',', @seqnos) ne (join ',', 0..$#seqnos)) { + push @errors, "Incorrect sequence numbers"; + } + + return @errors; +} + +sub create_image { + my ($filename, @img) = @_; + my @chunks; + while (@img) { + my ($chunk, $data) = splice @img, 0, 2; + if ($chunk eq 'IHDR') { + push @chunks, IHDR { + width => $data->[0], + height => $data->[1], + bit_depth => defined $data->[2] ? $data->[2] : 8, + color_type => defined $data->[3] ? $data->[3] : 6, + compression_method => 0, + filter_method => 0, + interlace_method => 0, + }; + } elsif ($chunk eq 'IEND') { + push @chunks, IEND { } + } elsif ($chunk eq 'gAMA') { + push @chunks, gAMA { + gamma => int(100_000*$data->[0]), + }; + } elsif ($chunk eq 'sRGB') { + push @chunks, sRGB { + rendering_intent => $data->[0], + }; + } elsif ($chunk eq 'PLTE') { + push @chunks, PLTE { + colours => $data, + }; + } elsif ($chunk eq 'tRNS') { + push @chunks, tRNS { + values => $data, + }; + } elsif ($chunk eq 'acTL') { + push @chunks, acTL { + num_frames => $data->[0], + num_plays => $data->[1], + }; + } elsif ($chunk eq 'fcTL') { + push @chunks, fcTL { + sequence_number => $data->[0], + width => $data->[1], + height => $data->[2], + x_offset => $data->[3], + y_offset => $data->[4], + delay_num => $data->[5], + delay_den => $data->[6], + dispose_op => $data->[7], + blend_op => $data->[8], + }; + } elsif ($chunk eq 'IDAT') { + push @chunks, IDAT { + depth => $data->[0]{depth}, + width => $data->[0]{width}, + height => $data->[0]{height}, + image_data => $data->[0]{data}, + } + } elsif ($chunk eq 'IDAT_split') { + my $c = xdat_data { + depth => $data->[2]{depth}, + width => $data->[2]{width}, + height => $data->[2]{height}, + image_data => $data->[2]{data}, + }; + if ($data->[1] == -1) { + $c = substr $c, $data->[0]; + } else { + $c = substr $c, $data->[0], $data->[1] - $data->[0]; + } + push @chunks, chunk 'IDAT', $c; + } elsif ($chunk eq 'fdAT') { + push @chunks, fdAT { + sequence_number => $data->[0], + depth => $data->[1]{depth}, + width => $data->[1]{width}, + height => $data->[1]{height}, + image_data => $data->[1]{data}, + } + } elsif ($chunk eq 'fdAT_split') { + my $c = xdat_data { + depth => $data->[3]{depth}, + width => $data->[3]{width}, + height => $data->[3]{height}, + image_data => $data->[3]{data}, + }; + if ($data->[2] == -1) { + $c = substr $c, $data->[1]; + } else { + $c = substr $c, $data->[1], $data->[2] - $data->[1]; + } + push @chunks, chunk 'fdAT', (pack 'N', $data->[0]) . $c; + } else { + die "Invalid create_image chunk '$chunk'"; + } + } + open my $fh, '>', "images/$filename.png" or die $!; + binmode $fh; + print $fh "\211PNG\r\n\032\n", @chunks; +} + +use constant W => 128; +use constant H => 64; + +sub escape_html { + my ($t) = @_; + $t =~ s/&/&/g; + $t =~ s/} + #. qq{Did not load image.} # IE doesn't like this + . qq{Did not load image\n} + . qq{

(source)\n} + #. qq{

Expected errors: $errors\n} + ; +} +# TODO: regexping HTML is nasty - should use a better input data format instead +sub handle_html_case { + my ($title) = @_; + my $id = lc $title; + $id =~ s/[^a-z0-9]+/-/g; + $id =~ s/^-*(.*?)-*$/$1/g; + return qq{

\n

# $title\n}; +} + +open my $in, 'source.html' or die $!; +my $html = do { local $/; <$in> }; +$html =~ s/(.*?)<\/png>/handle_html_png($1)/seg; +$html =~ s/

\n

(.*?)\n/handle_html_case($1)/eg; +open my $out, '>', 'images/tests.html' or die $!; +print $out $html; \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/resources/source.html b/tests/wpt/tests/png/apng/resources/source.html new file mode 100644 index 00000000000..cca7063cff4 --- /dev/null +++ b/tests/wpt/tests/png/apng/resources/source.html @@ -0,0 +1,1014 @@ + +APNG tests + + +

This page is somewhat incomplete and quite possibly incorrect – use with caution. + +

APNG tests

+ +

For all these tests, wait at least a second after all the images have downloaded, before checking that the rendered output is correct. + +

Test output conventions: +A solid green 128×64 rectangle means success. +Any red means failure. +Anything else means you need to read the instructions. +"Transparent" is indicated by a light yellow background. + +

Sections of the relevant specifications are sometimes quoted when they clarify the expected behaviour. + +

Please don't link directly to the images in this page, since they may get renamed and will break any such links. + +

You can download the script and the source data for this page. + + +

Valid images

+ + +

Basic cases

+ +
+

Trivial static image. +

This should be solid green. + +IHDR => [W, H], +IDAT => [create_surface(W, H, 'green')], +IEND => [], + +

+ +
+

Trivial animated image - one frame; using default image. +

This should be solid green. + +IHDR => [W, H], +acTL => [1, 0], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +IDAT => [create_surface(W, H, 'green')], +IEND => [], + +

+ +
+

Trivial animated image - one frame; ignoring default image. +

This should be solid green. + +IHDR => [W, H], +acTL => [1, 0], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'green')], +IEND => [], + +

+ + +

IDAT, fdAT splitting

+

There may be multiple IDAT chunks; if so, they shall appear consecutively with no other intervening chunks. The compressed datastream is then the concatenation of the contents of the data fields of all the IDAT chunks.

+

The compressed datastream is then the concatenation of the contents of the data fields of all the `fdAT` chunks within a frame.

+ +
+

Basic split IDAT. +

This should be solid green. + +IHDR => [W, H], +IDAT_split => [0,32, create_surface(W, H, 'green')], +IDAT_split => [32,-1, create_surface(W, H, 'green')], +IEND => [], + +

+ +
+

Split IDAT with zero-length chunk. +

This should be solid green. + +IHDR => [W, H], +IDAT_split => [0,32, create_surface(W, H, 'green')], +IDAT_split => [32,32, create_surface(W, H, 'green')], +IDAT_split => [32,-1, create_surface(W, H, 'green')], +IEND => [], + +

+ +
+

Basic split fdAT. +

This should be solid green. + +IHDR => [W, H], +acTL => [1, 0], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT_split => [1, 0,32, create_surface(W, H, 'green')], +fdAT_split => [2, 32,-1, create_surface(W, H, 'green')], +IEND => [], + +

+ +
+

Split fdAT with zero-length chunk. +

This should be solid green. + + +IHDR => [W, H], +acTL => [1, 0], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT_split => [1, 0,32, create_surface(W, H, 'green')], +fdAT_split => [2, 32,32, create_surface(W, H, 'green')], +fdAT_split => [3, 32,-1, create_surface(W, H, 'green')], +IEND => [], + +

+ + +

Dispose ops

+ +
+

APNG_DISPOSE_OP_NONE - basic. +

This should be solid green. + +IHDR => [W, H], +acTL => [3, 1], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +IDAT => [create_surface(W, H, 'red')], +fcTL => [1, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'green')], +fcTL => [3, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [4, create_surface(W, H, 'transparent')], +IEND => [], + +

+ +
+

APNG_DISPOSE_OP_BACKGROUND - basic. +

This should be transparent. + +IHDR => [W, H], +acTL => [3, 1], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +IDAT => [create_surface(W, H, 'red')], +fcTL => [1, W, H, 0, 0, 10, 100, DISPOSE_BACKGROUND, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'red')], +fcTL => [3, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [4, create_surface(W, H, 'transparent')], +IEND => [], + +

+ +
+

APNG_DISPOSE_OP_BACKGROUND - final frame. +

This should be solid green. + +IHDR => [W, H], +acTL => [2, 1], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +IDAT => [create_surface(W, H, 'red')], +fcTL => [1, W, H, 0, 0, 10, 100, DISPOSE_BACKGROUND, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'green')], +IEND => [], + +

+ +
+

APNG_DISPOSE_OP_PREVIOUS - basic. +

This should be solid green. + +IHDR => [W, H], +acTL => [3, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'green')], +fcTL => [2, W, H, 0, 0, 10, 100, DISPOSE_PREVIOUS, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'red')], +fcTL => [4, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [5, create_surface(W, H, 'transparent')], +IEND => [], + +

+ +
+

APNG_DISPOSE_OP_PREVIOUS - final frame. +

This should be solid green. + +IHDR => [W, H], +acTL => [2, 1], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +IDAT => [create_surface(W, H, 'red')], +fcTL => [1, W, H, 0, 0, 10, 100, DISPOSE_PREVIOUS, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'green')], +IEND => [], + +

+ +
+

APNG_DISPOSE_OP_PREVIOUS - first frame. +

This should be transparent. + +IHDR => [W, H], +acTL => [2, 1], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_PREVIOUS, BLEND_OVER], +IDAT => [create_surface(W, H, 'red')], +fcTL => [1, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'transparent')], +IEND => [], + +

+ + +

Dispose ops and regions

+ +
+

APNG_DISPOSE_OP_NONE in region. +

This should be solid green. + +IHDR => [W, H], +acTL => [3, 1], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +IDAT => [create_surface(W, H, 'doublerect', 0,1,0,1, 1,0,0,1)], +fcTL => [1, W/2, H/2, W/4, H/4, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [2, create_surface(W/2, H/2, 'green')], +fcTL => [3, 1, 1, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [4, create_surface(1, 1, 'transparent')], +IEND => [], + +

+ +
+

APNG_DISPOSE_OP_BACKGROUND before region. +

This should be transparent. + +IHDR => [W, H], +acTL => [2, 1], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_BACKGROUND, BLEND_OVER], +IDAT => [create_surface(W, H, 'red')], +fcTL => [1, 1, 1, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [2, create_surface(1, 1, 'transparent')], +IEND => [], + +

+ +
+

APNG_DISPOSE_OP_BACKGROUND in region. +

This should be a solid blue rectangle containing a smaller transparent rectangle. + + +IHDR => [W, H], +acTL => [3, 1], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +IDAT => [create_surface(W, H, 'doublerect', 0,0,1,1, 1,0,0,1)], +fcTL => [1, W/2, H/2, W/4, H/4, 10, 100, DISPOSE_BACKGROUND, BLEND_OVER], +fdAT => [2, create_surface(W/2, H/2, 'red')], +fcTL => [3, 1, 1, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [4, create_surface(1, 1, 'transparent')], +IEND => [], + +

+ +
+

APNG_DISPOSE_OP_PREVIOUS in region. +

This should be solid green. + +IHDR => [W, H], +acTL => [3, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'green')], +fcTL => [2, W/2, H/2, W/4, H/4, 10, 100, DISPOSE_PREVIOUS, BLEND_OVER], +fdAT => [3, create_surface(W/2, H/2, 'red')], +fcTL => [4, 1, 1, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [5, create_surface(1, 1, 'transparent')], +IEND => [], + +

+ + +

Blend ops

+ +
+

APNG_BLEND_OP_SOURCE on solid colour. +

This should be solid green. + +IHDR => [W, H], +acTL => [2, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_SOURCE], +fdAT => [3, create_surface(W, H, 'green')], +IEND => [], + +

+ +
+

APNG_BLEND_OP_SOURCE on transparent colour. +

This should be transparent. + +IHDR => [W, H], +acTL => [2, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_SOURCE], +fdAT => [3, create_surface(W, H, 'transparent')], +IEND => [], + +

+ +
+

APNG_BLEND_OP_SOURCE on nearly-transparent colour. +

This should be very nearly transparent. + +IHDR => [W, H], +acTL => [2, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_SOURCE], +fdAT => [3, create_surface(W, H, 'solid', 0, 1, 0, 0.01)], +IEND => [], + +

+ +
+

APNG_BLEND_OP_OVER on solid and transparent colours. +

This should be solid green. + +IHDR => [W, H], +acTL => [2, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'green')], +fcTL => [2, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'transparent')], +IEND => [], + +

+ +
+

APNG_BLEND_OP_OVER repeatedly with nearly-transparent colours. +

This should be solid green. + +IHDR => [W, H], +acTL => [128, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'solid', 0, 1, 0, 1)], +(map { + (fcTL => [2+$_*2, W/2, H, 0, 0, 1, 100, DISPOSE_NONE, BLEND_OVER], + fdAT => [3+$_*2, create_surface(W/2, H, 'solid', 0, 1, 0, 0.01)]) +} 0..126), +IEND => [], + +

+ + +

Blending and gamma

+ +
+

APNG_BLEND_OP_OVER +

This should be solid slightly-dark green. + +IHDR => [W, H], +gAMA => [1], +acTL => [16, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'solid', 0, 1, 0, 1)], +(map { + (fcTL => [2+$_*2, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], + fdAT => [3+$_*2, create_surface(W, H, 'solid', 0, 0.9, 0, 0.5)]) +} 0..14), +IEND => [], + +

+ +
+

APNG_BLEND_OP_OVER +

This should be solid nearly-black. + +IHDR => [W, H], +gAMA => [1/2200], +acTL => [16, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +(map { + (fcTL => [2+$_*2, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], + fdAT => [3+$_*2, create_surface(W, H, 'solid', 0.9, 0, 0, 0.5)]) +} 0..14), +IEND => [], + +

+ + +

Chunk ordering

+ +
+

fcTL before acTL. +

This should be solid green. + +IHDR => [W, H], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +acTL => [2, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [1, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'green')], +IEND => [], + +

+ + +

Delays

+ +
+

Basic delays. +

This should flash blue for half a second, then yellow for one second, then repeat. + +IHDR => [W, H], +acTL => [4, 0], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 50, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'blue')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'yellow')], +fcTL => [4, W, H, 0, 0, 10000, 20000, DISPOSE_NONE, BLEND_OVER], +fdAT => [5, create_surface(W, H, 'blue')], +fcTL => [6, W, H, 0, 0, 1, 1, DISPOSE_NONE, BLEND_OVER], +fdAT => [7, create_surface(W, H, 'yellow')], +IEND => [], + +

+ +
+

Rounding of division. +

This should flash blue for half a second, then yellow for one second, then repeat. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 1, 2, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'blue')], +fcTL => [2, W, H, 0, 0, 1, 1, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'yellow')], +IEND => [], + +

+ +
+

16-bit numerator/denominator. +

This should flash blue for half a second, then yellow for one second, then repeat. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 32767, 65534, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'blue')], +fcTL => [2, W, H, 0, 0, 65535, 65535, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'yellow')], +IEND => [], + +

+ +
+

Zero denominator. +

If the denominator is 0, it is to be treated as if it were 100

+

This should flash blue for half a second, then yellow for one second, then repeat. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 50, 0, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'blue')], +fcTL => [2, W, H, 0, 0, 1000, 1000, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'yellow')], +IEND => [], + +

+ +
+

Zero numerator. +

If the the value of the numerator is 0 the decoder should render the next frame as quickly as possible, though viewers may impose a reasonable lower bound.

+

This should flash cyan for a short period of time (perhaps zero), then magenta for the same short period of time, then blue for half a second, then yellow for one second, then repeat. + +IHDR => [W, H], +acTL => [4, 0], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 0, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'cyan')], +fcTL => [2, W, H, 0, 0, 0, 0, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'magenta')], +fcTL => [4, W, H, 0, 0, 500, 1000, DISPOSE_NONE, BLEND_OVER], +fdAT => [5, create_surface(W, H, 'blue')], +fcTL => [6, W, H, 0, 0, 1000, 1000, DISPOSE_NONE, BLEND_OVER], +fdAT => [7, create_surface(W, H, 'yellow')], +IEND => [], + +

+ + +

num_plays

+ +
+

num_plays = 0 +

This should flash yellow for one second, then blue for one second, then repeat forever. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'yellow')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'blue')], +IEND => [], + +

+ +
+

num_plays = 1 +

When first loaded, this should flash yellow for one second, then stay blue forever. + +IHDR => [W, H], +acTL => [2, 1], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'yellow')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'blue')], +IEND => [], + +

+ +
+

num_plays = 2 +

When first loaded, this should flash yellow for one second, then blue for one second, then yellow for one second, then blue forever. + +IHDR => [W, H], +acTL => [2, 2], +IDAT => [create_surface(W, H, 'red')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'yellow')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'blue')], +IEND => [], + +

+ + +

Other depths and colour types

+ +
+

16-bit colour. +

This should be dark blue. + +IHDR => [W, H, 16, 6], +acTL => [2, 1], +IDAT => [create_raw_surface(W, H, 64, "\xFF\x00\x00\x00\x00\x00\xFF\xFF" x (W*H))], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_raw_surface(W, H, 64, "\x00\x00\x00\x00\x00\x00\xFF\xFF" x (W*H))], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_raw_surface(W, H, 64, "\x00\x00\x00\x00\xFF\xFF\x80\x00" x (W*H))], +IEND => [], + +

+ +
+

8-bit greyscale. +

This should be a solid grey rectangle containing a solid white rectangle. + +IHDR => [W, H, 8, 0], +acTL => [2, 1], +IDAT => [create_raw_surface(W, H, 8, "\x00\xFF" x (W*H/2))], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_raw_surface(W, H, 8, "\x80" x (W*H))], +fcTL => [2, W/2, H/2, W/4, H/4, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_raw_surface(W/2, H/2, 8, "\xFF" x (W*H/4))], +IEND => [], + +

+ +
+

8-bit greyscale and alpha, with blending. +

This should be solid grey. + +IHDR => [W, H, 8, 4], +acTL => [2, 1], +IDAT => [create_raw_surface(W, H, 16, "\x00\xFF\xFF\xFF" x (W*H/2))], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_raw_surface(W, H, 16, "\x00\xFF" x (W*H))], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_raw_surface(W, H, 16, "\xFF\x80" x (W*H))], +IEND => [], + +

+ +
+

2-color palette. +

This should be solid green. + +IHDR => [W, H, 1, 3], +PLTE => [255,0,0, 0,255,0], +acTL => [2, 1], +IDAT => [create_raw_surface(W, H, 1, "\x00" x (W*H/8))], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_raw_surface(W, H, 1, "\x00" x (W*H/8))], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_raw_surface(W, H, 1, "\xFF" x (W*H/8))], +IEND => [], + +

+ +
+

2-bit palette and alpha. +

This should be solid green. + +IHDR => [W, H, 2, 3], +PLTE => [255,0,0, 255,0,0, 0,255,0], +tRNS => [255, 0, 255], +acTL => [2, 1], +IDAT => [create_raw_surface(W, H, 2, "\x00" x (W*H/4))], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_raw_surface(W, H, 2, "\xAA" x (W*H/4))], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_raw_surface(W, H, 2, "\x55" x (W*H/4))], +IEND => [], + +

+ +
+

1-bit palette and alpha, with blending. +

This should be solid dark blue. + +IHDR => [W, H, 1, 3], +PLTE => [0,0,0, 0,0,255], +tRNS => [255, 128], +acTL => [2, 1], +IDAT => [create_raw_surface(W, H, 1, "\x00" x (W*H/8))], +fcTL => [0, W, H, 0, 0, 10, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_raw_surface(W, H, 1, "\x00" x (W*H/8))], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_raw_surface(W, H, 1, "\xFF" x (W*H/8))], +IEND => [], + +

+ + +

Invalid images

+ +
+

It is strongly recommended that when any error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the default image. A decoder which detects an error before the animation has started should display the default image. An error message may be displayed to the user if appropriate. +

+

(If some decoders accept broken images, it seems quite possible that people will create and distribute broken images, and then the error-handling would have to be reverse-engineered by other implementations; hence all these tests to ensure errors get detected properly.) +

For the following images, the default image (solid green) or an error should be displayed. + + +

Incorrect chunks

+ +
+

Missing acTL. + +IHDR => [W, H], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

Repeated acTL. + +IHDR => [W, H], +acTL => [1, 0], +acTL => [1, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

acTL after IDAT. + +IHDR => [W, H], +IDAT => [create_surface(W, H, 'green')], +acTL => [1, 0], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

Missing fcTL. +

Disabled for now, since it crashes Opera 9.5 alpha 1589 (bug 287173). + +

+ +
+

Repeated fcTL. + +IHDR => [W, H], +acTL => [1, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

Missing fdAT. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fcTL => [1, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'red')], +IEND => [], + +

+ + +

num_frames

+ +
+

num_frames = 0; no default image. +

0 is not a valid value.

+ +IHDR => [W, H], +acTL => [0, 0], +IEND => [], + +
+ +
+

num_frames = 0; ignoring default image. +

0 is not a valid value.

+ +IHDR => [W, H], +acTL => [0, 0], +IDAT => [create_surface(W, H, 'green')], +IEND => [], + +
+ +
+

num_frames too low. +

This must equal the number of `fcTL` chunks. ... If this value does not equal the actual number of frames it should be treated as an error.

+ +IHDR => [W, H], +acTL => [1, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'red')], +IEND => [], + +
+ +
+

num_frames too high by 1. +

This must equal the number of `fcTL` chunks. ... If this value does not equal the actual number of frames it should be treated as an error.

+ +IHDR => [W, H], +acTL => [3, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'red')], +IEND => [], + +
+ +
+

num_frames too high by 2. +

This must equal the number of `fcTL` chunks. ... If this value does not equal the actual number of frames it should be treated as an error.

+ +IHDR => [W, H], +acTL => [4, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'red')], +IEND => [], + +
+ +
+

num_frames outside valid range. +

an "unsigned int" shall be a 32-bit unsigned integer in network byte order limited to the range 0 to (2^31)-1

+ +IHDR => [W, H], +acTL => [0x80000001, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +IEND => [], + +
+ + +

Sequence numbers

+ +
+

Not starting from 0. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [1, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'red')], +fcTL => [3, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [4, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

Gap in sequence. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [4, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

Duplicated sequence number. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

Duplicated chunk. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [3, create_surface(W, H, 'red')], +fdAT => [3, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

Reordered fdAT chunks. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT_split => [4, 32,-1, create_surface(W, H, 'red')], +fdAT_split => [3, 0,32, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

Reordered sequence numbers. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +fcTL => [2, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT_split => [4, 0,32, create_surface(W, H, 'red')], +fdAT_split => [3, 32,-1, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

Separated fdAT and fcTL sequences. + +IHDR => [W, H], +acTL => [2, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [0, create_surface(W, H, 'red')], +fcTL => [1, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H, 'red')], +IEND => [], + +

+ + +

Invalid image-data sizes

+ +
+

Default image's fcTL size not matching IHDR. + +IHDR => [W, H], +acTL => [2, 0], +fcTL => [0, W, H/2, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +IDAT => [create_surface(W, H/2, 'red')], +fcTL => [1, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [2, create_surface(W, H, 'red')], +IEND => [], + +

+ +
+

fdAT too small. + +IHDR => [W, H], +acTL => [1, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H/2, 'red')], +IEND => [], + +

+ +
+

fdAT too large. + +IHDR => [W, H], +acTL => [1, 0], +IDAT => [create_surface(W, H, 'green')], +fcTL => [0, W, H, 0, 0, 100, 100, DISPOSE_NONE, BLEND_OVER], +fdAT => [1, create_surface(W, H*2, 'red')], +IEND => [], + +

+ + + +

References

+ \ No newline at end of file diff --git a/tests/wpt/tests/png/apng/support/001.png b/tests/wpt/tests/png/apng/support/001.png new file mode 100644 index 00000000000..0cd5bea856b Binary files /dev/null and b/tests/wpt/tests/png/apng/support/001.png differ diff --git a/tests/wpt/tests/png/apng/support/002.png b/tests/wpt/tests/png/apng/support/002.png new file mode 100644 index 00000000000..db7581fbdfc Binary files /dev/null and b/tests/wpt/tests/png/apng/support/002.png differ diff --git a/tests/wpt/tests/png/apng/support/005.png b/tests/wpt/tests/png/apng/support/005.png new file mode 100644 index 00000000000..2dc58b929a4 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/005.png differ diff --git a/tests/wpt/tests/png/apng/support/006.png b/tests/wpt/tests/png/apng/support/006.png new file mode 100644 index 00000000000..14a76d9d618 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/006.png differ diff --git a/tests/wpt/tests/png/apng/support/007.png b/tests/wpt/tests/png/apng/support/007.png new file mode 100644 index 00000000000..3094c1d23d6 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/007.png differ diff --git a/tests/wpt/tests/png/apng/support/008.png b/tests/wpt/tests/png/apng/support/008.png new file mode 100644 index 00000000000..b63ebc0b35d Binary files /dev/null and b/tests/wpt/tests/png/apng/support/008.png differ diff --git a/tests/wpt/tests/png/apng/support/009.png b/tests/wpt/tests/png/apng/support/009.png new file mode 100644 index 00000000000..77694ff1d15 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/009.png differ diff --git a/tests/wpt/tests/png/apng/support/010.png b/tests/wpt/tests/png/apng/support/010.png new file mode 100644 index 00000000000..1c15f132fe7 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/010.png differ diff --git a/tests/wpt/tests/png/apng/support/011.png b/tests/wpt/tests/png/apng/support/011.png new file mode 100644 index 00000000000..858f6f0382b Binary files /dev/null and b/tests/wpt/tests/png/apng/support/011.png differ diff --git a/tests/wpt/tests/png/apng/support/012.png b/tests/wpt/tests/png/apng/support/012.png new file mode 100644 index 00000000000..3f9b3cfae76 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/012.png differ diff --git a/tests/wpt/tests/png/apng/support/013.png b/tests/wpt/tests/png/apng/support/013.png new file mode 100644 index 00000000000..4e1dbf77e45 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/013.png differ diff --git a/tests/wpt/tests/png/apng/support/014.png b/tests/wpt/tests/png/apng/support/014.png new file mode 100644 index 00000000000..427b829a025 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/014.png differ diff --git a/tests/wpt/tests/png/apng/support/015.png b/tests/wpt/tests/png/apng/support/015.png new file mode 100644 index 00000000000..05948d44aed Binary files /dev/null and b/tests/wpt/tests/png/apng/support/015.png differ diff --git a/tests/wpt/tests/png/apng/support/016.png b/tests/wpt/tests/png/apng/support/016.png new file mode 100644 index 00000000000..f326afa5c27 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/016.png differ diff --git a/tests/wpt/tests/png/apng/support/017.png b/tests/wpt/tests/png/apng/support/017.png new file mode 100644 index 00000000000..d90c54967b6 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/017.png differ diff --git a/tests/wpt/tests/png/apng/support/018.png b/tests/wpt/tests/png/apng/support/018.png new file mode 100644 index 00000000000..0f290fd7fdb Binary files /dev/null and b/tests/wpt/tests/png/apng/support/018.png differ diff --git a/tests/wpt/tests/png/apng/support/020.png b/tests/wpt/tests/png/apng/support/020.png new file mode 100644 index 00000000000..3fe0f4ca789 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/020.png differ diff --git a/tests/wpt/tests/png/apng/support/021.png b/tests/wpt/tests/png/apng/support/021.png new file mode 100644 index 00000000000..3ee5fe3bf27 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/021.png differ diff --git a/tests/wpt/tests/png/apng/support/024.png b/tests/wpt/tests/png/apng/support/024.png new file mode 100644 index 00000000000..d0418ddd75f Binary files /dev/null and b/tests/wpt/tests/png/apng/support/024.png differ diff --git a/tests/wpt/tests/png/apng/support/025.png b/tests/wpt/tests/png/apng/support/025.png new file mode 100644 index 00000000000..64cceaae83a Binary files /dev/null and b/tests/wpt/tests/png/apng/support/025.png differ diff --git a/tests/wpt/tests/png/apng/support/026.png b/tests/wpt/tests/png/apng/support/026.png new file mode 100644 index 00000000000..3f082665c99 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/026.png differ diff --git a/tests/wpt/tests/png/apng/support/027.png b/tests/wpt/tests/png/apng/support/027.png new file mode 100644 index 00000000000..99d53b71812 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/027.png differ diff --git a/tests/wpt/tests/png/apng/support/028.png b/tests/wpt/tests/png/apng/support/028.png new file mode 100644 index 00000000000..bad60c767fb Binary files /dev/null and b/tests/wpt/tests/png/apng/support/028.png differ diff --git a/tests/wpt/tests/png/apng/support/029.png b/tests/wpt/tests/png/apng/support/029.png new file mode 100644 index 00000000000..a029a959b5d Binary files /dev/null and b/tests/wpt/tests/png/apng/support/029.png differ diff --git a/tests/wpt/tests/png/apng/support/030.png b/tests/wpt/tests/png/apng/support/030.png new file mode 100644 index 00000000000..4d76802e4cc Binary files /dev/null and b/tests/wpt/tests/png/apng/support/030.png differ diff --git a/tests/wpt/tests/png/apng/support/031.png b/tests/wpt/tests/png/apng/support/031.png new file mode 100644 index 00000000000..fb25394305f Binary files /dev/null and b/tests/wpt/tests/png/apng/support/031.png differ diff --git a/tests/wpt/tests/png/apng/support/032.png b/tests/wpt/tests/png/apng/support/032.png new file mode 100644 index 00000000000..b8e06d17368 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/032.png differ diff --git a/tests/wpt/tests/png/apng/support/033.png b/tests/wpt/tests/png/apng/support/033.png new file mode 100644 index 00000000000..1210e373797 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/033.png differ diff --git a/tests/wpt/tests/png/apng/support/034.png b/tests/wpt/tests/png/apng/support/034.png new file mode 100644 index 00000000000..29ed7d1ea12 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/034.png differ diff --git a/tests/wpt/tests/png/apng/support/035.png b/tests/wpt/tests/png/apng/support/035.png new file mode 100644 index 00000000000..f9307f63504 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/035.png differ diff --git a/tests/wpt/tests/png/apng/support/036.png b/tests/wpt/tests/png/apng/support/036.png new file mode 100644 index 00000000000..11ccfb6cba0 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/036.png differ diff --git a/tests/wpt/tests/png/apng/support/037.png b/tests/wpt/tests/png/apng/support/037.png new file mode 100644 index 00000000000..f3c4c9f9e6d Binary files /dev/null and b/tests/wpt/tests/png/apng/support/037.png differ diff --git a/tests/wpt/tests/png/apng/support/038.png b/tests/wpt/tests/png/apng/support/038.png new file mode 100644 index 00000000000..e95425ac194 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/038.png differ diff --git a/tests/wpt/tests/png/apng/support/blue-with-hole.png b/tests/wpt/tests/png/apng/support/blue-with-hole.png new file mode 100644 index 00000000000..175c5ddfd82 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/blue-with-hole.png differ diff --git a/tests/wpt/tests/png/apng/support/blue.png b/tests/wpt/tests/png/apng/support/blue.png new file mode 100644 index 00000000000..fe2a8a9bd57 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/blue.png differ diff --git a/tests/wpt/tests/png/apng/support/darkblue.png b/tests/wpt/tests/png/apng/support/darkblue.png new file mode 100644 index 00000000000..dabaae2e202 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/darkblue.png differ diff --git a/tests/wpt/tests/png/apng/support/gray-white.png b/tests/wpt/tests/png/apng/support/gray-white.png new file mode 100644 index 00000000000..7f3cb44d053 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/gray-white.png differ diff --git a/tests/wpt/tests/png/apng/support/lime.png b/tests/wpt/tests/png/apng/support/lime.png new file mode 100644 index 00000000000..9bd36328110 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/lime.png differ diff --git a/tests/wpt/tests/png/apng/support/nearly.png b/tests/wpt/tests/png/apng/support/nearly.png new file mode 100644 index 00000000000..b8e43f93f4b Binary files /dev/null and b/tests/wpt/tests/png/apng/support/nearly.png differ diff --git a/tests/wpt/tests/png/apng/support/solid-gray.png b/tests/wpt/tests/png/apng/support/solid-gray.png new file mode 100644 index 00000000000..8d29b4db629 Binary files /dev/null and b/tests/wpt/tests/png/apng/support/solid-gray.png differ diff --git a/tests/wpt/tests/resources/check-layout-th.js b/tests/wpt/tests/resources/check-layout-th.js index f14ca3246b8..54ddb35f311 100644 --- a/tests/wpt/tests/resources/check-layout-th.js +++ b/tests/wpt/tests/resources/check-layout-th.js @@ -218,6 +218,7 @@ window.checkLayout = function(selectorList, callDone = true) nodes = Array.prototype.slice.call(nodes); var checkedLayout = false; Array.prototype.forEach.call(nodes, function(node) { + const title = node.title == '' ? '' : `: ${node.title}`; test(function(t) { var container = node.parentNode.className == 'container' ? node.parentNode : node; var prefix = @@ -240,7 +241,7 @@ window.checkLayout = function(selectorList, callDone = true) } checkedLayout |= !passed; } - }, selectorList + ' ' + String(++testNumber)); + }, `${selectorList} ${++testNumber}${title}`); }); if (!checkedLayout) { console.error("No valid data-* attributes found in selector list : " + selectorList); diff --git a/tests/wpt/tests/screen-orientation/active-lock.html b/tests/wpt/tests/screen-orientation/active-lock.html index 6dcbe4a8ffa..72d2d7fc1d4 100644 --- a/tests/wpt/tests/screen-orientation/active-lock.html +++ b/tests/wpt/tests/screen-orientation/active-lock.html @@ -5,8 +5,10 @@ -

-fragment + +

+ fragment + diff --git a/tests/wpt/tests/screen-orientation/fullscreen-interactions.html b/tests/wpt/tests/screen-orientation/fullscreen-interactions.html index cffacc1f4f7..b1ac1c7000f 100644 --- a/tests/wpt/tests/screen-orientation/fullscreen-interactions.html +++ b/tests/wpt/tests/screen-orientation/fullscreen-interactions.html @@ -5,29 +5,41 @@ + diff --git a/tests/wpt/tests/screen-orientation/hidden_document.html b/tests/wpt/tests/screen-orientation/hidden_document.html index 6c39d6e6e5b..6ff78ea866a 100644 --- a/tests/wpt/tests/screen-orientation/hidden_document.html +++ b/tests/wpt/tests/screen-orientation/hidden_document.html @@ -14,21 +14,58 @@ promise_test(async (t) => { const { minimize, restore } = window_state_context(t); - t.add_cleanup(makeCleanup()); + t.add_cleanup(restore); await minimize(); assert_equals(document.visibilityState, "hidden", "Document must be hidden"); - const opposite = getOppositeOrientation(); - await promise_rejects_dom(t, "SecurityError", screen.orientation.lock(opposite) ); + await promise_rejects_dom(t, "SecurityError", screen.orientation.lock(getOppositeOrientation())); }, "hidden documents must reject went trying to call lock or unlock"); promise_test(async (t) => { const { minimize, restore } = window_state_context(t); + t.add_cleanup(restore); await minimize(); assert_equals(document.visibilityState, "hidden", "Document must be hidden"); assert_throws_dom("SecurityError", () => screen.orientation.unlock()); }, "hidden documents must reject went trying to call unlock"); + + promise_test(async (t) => { + const { minimize, restore } = window_state_context(t); + t.add_cleanup(makeCleanup()); + + await test_driver.bless("request full screen"); + await document.documentElement.requestFullscreen(); + await screen.orientation.lock(getOppositeOrientation()); + + await minimize(); + + assert_equals(document.visibilityState, "hidden", "Document must be hidden"); + assert_throws_dom("SecurityError", () => screen.orientation.unlock()); + }, "hidden documents must not unlock the screen orientation"); + + promise_test(async (t) => { + const { minimize, restore } = window_state_context(t); + t.add_cleanup(makeCleanup()); + await test_driver.bless("request full screen"); + await document.documentElement.requestFullscreen(); + await screen.orientation.lock(getOppositeOrientation()); + + await minimize(); + + assert_equals(document.visibilityState, "hidden"); + await promise_rejects_dom(t, "SecurityError", screen.orientation.lock(getOppositeOrientation())); + + // Maximize, now everything should work as expected. + await restore(); + + assert_equals(document.visibilityState, "visible"); + + await test_driver.bless("request full screen"); + await document.documentElement.requestFullscreen(); + await screen.orientation.lock(getOppositeOrientation()); + screen.orientation.unlock(); + }, "Once maximized, a minimized window can lock or unlock the screen orientation again"); diff --git a/tests/wpt/tests/screen-orientation/lock-unlock-check.html b/tests/wpt/tests/screen-orientation/lock-unlock-check.html index b415f7b2a80..6e373ecb1ca 100644 --- a/tests/wpt/tests/screen-orientation/lock-unlock-check.html +++ b/tests/wpt/tests/screen-orientation/lock-unlock-check.html @@ -9,28 +9,45 @@ import { attachIframe, getOppositeOrientation, + makeCleanup, } from "./resources/orientation-utils.js"; promise_test(async (t) => { + t.add_cleanup(makeCleanup()); await test_driver.bless("request full screen"); await document.documentElement.requestFullscreen(); - screen.orientation.addEventListener( - "change", - async () => { - await screen.orientation.lock(getOppositeOrientation()); - }, - { once: true } - ); - await screen.orientation.lock(getOppositeOrientation()); + + const eventPromise = new Promise((res, rej) => { + screen.orientation.addEventListener( + "change", + () => { + screen.orientation + .lock(getOppositeOrientation()) + .then(res) + .catch(rej); + }, + { once: true } + ); + }); + const lockPromise = screen.orientation.lock(getOppositeOrientation()); + await Promise.all([eventPromise, lockPromise]); }, "Re-locking the screen orientation after a change event fires must not abort"); promise_test(async (t) => { + t.add_cleanup(makeCleanup()); await test_driver.bless("request full screen"); await document.documentElement.requestFullscreen(); - screen.orientation.onchange = async () => { - screen.orientation.onchange = null; - screen.orientation.unlock(); - }; - await screen.orientation.lock(getOppositeOrientation()); + const eventPromise = new Promise((res) => { + screen.orientation.addEventListener( + "change", + () => { + screen.orientation.unlock(); + res(); + }, + { once: true } + ); + }); + const lockPromise = screen.orientation.lock(getOppositeOrientation()); + await Promise.all([eventPromise, lockPromise]); }, "Unlocking the screen orientation after a change event must not abort"); diff --git a/tests/wpt/tests/screen-orientation/nested-documents.html b/tests/wpt/tests/screen-orientation/nested-documents.html index efaed9cec81..ec3c0b48097 100644 --- a/tests/wpt/tests/screen-orientation/nested-documents.html +++ b/tests/wpt/tests/screen-orientation/nested-documents.html @@ -18,7 +18,7 @@ // Go full screen await test_driver.bless("request full screen"); - await iframe.contentDocument.documentElement.requestFullscreen(); + await document.body.requestFullscreen(); // Lock the orientation from the iframe const opposite = getOppositeOrientation(); @@ -37,7 +37,7 @@ promise_test(async (t) => { t.add_cleanup(makeCleanup()); - // Create 3 nested iframes + // Create 2 nested iframes const src = "/screen-orientation/resources/empty.html"; const outerIframe = await attachIframe({ src: `${src}#1` }); const innerIframe = await attachIframe({ @@ -48,8 +48,10 @@ const iframes = [outerIframe, innerIframe]; // Go full screen - await test_driver.bless("request full screen"); - await innerIframe.contentDocument.documentElement.requestFullscreen(); + await test_driver.bless( + "request full screen" + ); + await document.documentElement.requestFullscreen(); const opposite = getOppositeOrientation(); // Each iframe tries to lock the orientation @@ -64,20 +66,16 @@ const topPromise = window.screen.orientation.lock(opposite); // Check that all promises are rejected with AbortError - const abortedPromises = []; for (let i = 0; i < requestToLock.length; i++) { const { promise, context } = requestToLock[i]; - const p = promise_rejects_dom( + await promise_rejects_dom( t, "AbortError", context.DOMException, promise, `Expected request to lock orientation from iframe ${i} to abort` ); - abortedPromises.push(p); } - await Promise.all(abortedPromises); - // Finally, top-level promise resolves await topPromise; }, "The orientation lock from one document affects lock requests from other documents"); diff --git a/tests/wpt/tests/screen-orientation/onchange-event-subframe.html b/tests/wpt/tests/screen-orientation/onchange-event-subframe.html index 1b4b8cd428a..6eb986b4380 100644 --- a/tests/wpt/tests/screen-orientation/onchange-event-subframe.html +++ b/tests/wpt/tests/screen-orientation/onchange-event-subframe.html @@ -44,7 +44,14 @@ promise_test(async (t) => { t.add_cleanup(makeCleanup()); const iframe = await attachIframe(); - const opposite = getOppositeOrientation(); + let opposite = getOppositeOrientation(); + + // Fail fast in case the API is not supported + await test_driver.bless("request fullscreen", null, iframe.contentWindow); + await iframe.contentDocument.documentElement.requestFullscreen(); + await iframe.contentWindow.screen.orientation.lock(opposite); + iframe.contentWindow.screen.orientation.unlock(); + opposite = getOppositeOrientation(); const topEventPromise = new EventWatcher( t, @@ -58,8 +65,8 @@ ).wait_for("change"); // Lock from the iframe - await test_driver.bless("request fullscreen"); - await document.documentElement.requestFullscreen(); + await test_driver.bless("request fullscreen", null, iframe.contentWindow); + await iframe.contentDocument.documentElement.requestFullscreen(); const lockPromise = iframe.contentWindow.screen.orientation.lock(opposite); const winningEvent = await Promise.race([ diff --git a/tests/wpt/tests/screen-orientation/resources/nav_iframe.html b/tests/wpt/tests/screen-orientation/resources/nav_iframe.html new file mode 100644 index 00000000000..bb26cf7c109 --- /dev/null +++ b/tests/wpt/tests/screen-orientation/resources/nav_iframe.html @@ -0,0 +1,18 @@ + + + + A Document + + +

Section 1

+

This is the content of section 1.

+ +

Section 2

+

This is the content of section 2.

+ +

+ Go to Section 1 | + Go to Section 2 +

+ + diff --git a/tests/wpt/tests/screen-orientation/unlock.html b/tests/wpt/tests/screen-orientation/unlock.html index d5f32eb7bea..13442f98f29 100644 --- a/tests/wpt/tests/screen-orientation/unlock.html +++ b/tests/wpt/tests/screen-orientation/unlock.html @@ -39,9 +39,9 @@ promise_test(async (t) => { t.add_cleanup(makeCleanup()); + const iframe = await attachIframe(); await test_driver.bless("request full screen"); await document.documentElement.requestFullscreen(); - const iframe = await attachIframe(); const promise = iframe.contentWindow.screen.orientation.lock( getOppositeOrientation() ); diff --git a/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/router-rules.js b/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/router-rules.js new file mode 100644 index 00000000000..7b6a7144dbb --- /dev/null +++ b/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/router-rules.js @@ -0,0 +1,45 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +const routerRules = { + 'condition-url-pattern-source-network': [ + { + condition: { + urlPattern: new URLPattern({ + pathname: '/**/direct.txt' + }) + }, + source: 'network' + }, + + ], + 'condition-request-source-network': [ + { + condition: { + requestMode: 'no-cors' + }, + source: 'network' + } + ], + 'condition-or-source-network': [ + { + condition: { + or: [ + { + or: [ + { + urlPattern: '/**/or-test/direct1.*??*' + } + ], + }, + { + urlPattern: '/**/or-test/direct2.*??*' + } + ] + }, + source: 'network' + } + ], +}; + +export {routerRules}; diff --git a/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js b/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js index 0cde9200c75..1e02dbb56de 100644 --- a/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js +++ b/tests/wpt/tests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js @@ -1,33 +1,13 @@ 'use strict'; +import {routerRules} from './router-rules.js'; + var requests = []; -self.addEventListener('install', e => { - e.registerRouter([ - {condition: {requestMode: 'no-cors'}, source: 'network'}, { - condition: {urlPattern: '/**/*.txt??*'}, - // Note: "??*" is for allowing arbitrary query strings. - // Upon my experiment, the URLPattern needs two '?'s for specifying - // a coming string as a query. - source: 'network' - }, - { - condition: - {urlPattern: '/**/simple-test-for-condition-main-resource.html'}, - source: 'network' - }, - { - condition: { - or: [ - { - or: [{urlPattern: '/**/or-test/direct1.*??*'}], - }, - {urlPattern: '/**/or-test/direct2.*??*'} - ] - }, - source: 'network' - } - ]); +self.addEventListener('install', async e => { + const params = new URLSearchParams(location.search); + const key = params.get('key'); + await e.addRoutes(routerRules[key]); self.skipWaiting(); }); diff --git a/tests/wpt/tests/service-workers/service-worker/tentative/static-router/static-router-main-resource.https.html b/tests/wpt/tests/service-workers/service-worker/tentative/static-router/static-router-main-resource.https.html index 5a55783af57..dda75f20f4b 100644 --- a/tests/wpt/tests/service-workers/service-worker/tentative/static-router/static-router-main-resource.https.html +++ b/tests/wpt/tests/service-workers/service-worker/tentative/static-router/static-router-main-resource.https.html @@ -1,6 +1,8 @@ -Static Router: simply skip fetch handler for main resource if pattern matches + + Static Router: simply skip fetch handler for main resource if pattern matches + @@ -8,17 +10,19 @@ + + + diff --git a/tests/wpt/tests/soft-navigation-heuristics/first-interaction-not-softnav.tentative.html b/tests/wpt/tests/soft-navigation-heuristics/first-interaction-not-softnav.tentative.html new file mode 100644 index 00000000000..e0262021836 --- /dev/null +++ b/tests/wpt/tests/soft-navigation-heuristics/first-interaction-not-softnav.tentative.html @@ -0,0 +1,36 @@ + + + + + + + + + + + +
+

Click me!

+

Then click me!

+
+ + + diff --git a/tests/wpt/tests/soft-navigation-heuristics/keydown.tentative.html b/tests/wpt/tests/soft-navigation-heuristics/keydown.tentative.html deleted file mode 100644 index 19971e6d2da..00000000000 --- a/tests/wpt/tests/soft-navigation-heuristics/keydown.tentative.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - -Detect keyboard-event based soft navigations. - - - - - - - -
-
- First LCP! -
-
- - - diff --git a/tests/wpt/tests/soft-navigation-heuristics/keypress.tentative.html b/tests/wpt/tests/soft-navigation-heuristics/keypress.tentative.html deleted file mode 100644 index 5bd512ec3e7..00000000000 --- a/tests/wpt/tests/soft-navigation-heuristics/keypress.tentative.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - -Detect keyboard-event based soft navigations. - - - - - - - -
-
- First LCP! -
-
- - - - diff --git a/tests/wpt/tests/soft-navigation-heuristics/keyup.tentative.html b/tests/wpt/tests/soft-navigation-heuristics/keyup.tentative.html deleted file mode 100644 index 8b5717d62e9..00000000000 --- a/tests/wpt/tests/soft-navigation-heuristics/keyup.tentative.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - -Detect keyboard-event based soft navigations. - - - - - - - -
-
- First LCP! -
-
- - - diff --git a/tests/wpt/tests/soft-navigation-heuristics/resources/soft-navigation-helper.js b/tests/wpt/tests/soft-navigation-heuristics/resources/soft-navigation-helper.js index 6fdc1d100b9..58ca9c22657 100644 --- a/tests/wpt/tests/soft-navigation-heuristics/resources/soft-navigation-helper.js +++ b/tests/wpt/tests/soft-navigation-heuristics/resources/soft-navigation-helper.js @@ -20,7 +20,7 @@ const testSoftNavigation = const testName = options.testName; const pushUrl = readValue(options.pushUrl, true); const eventType = readValue(options.eventType, "click"); - const interactionType = readValue(options.interactionType, 'click'); + const interactionFunc = options.interactionFunc; const eventPrepWork = options.eventPrepWork; promise_test(async t => { await waitInitialLCP(); @@ -33,7 +33,7 @@ const testSoftNavigation = let paint_entries_promise = waitOnPaintEntriesPromise(firstClick); interacted = false; - interact(link, interactionType); + interact(link, interactionFunc); const navigation_id = await waitOnSoftNav(); if (!first_navigation_id) { @@ -129,12 +129,12 @@ const runEntryValidations = }; const interact = - (link, interactionType = 'click') => { + (link, interactionFunc = undefined) => { if (test_driver) { - if (interactionType == 'click') { - test_driver.click(link); + if (interactionFunc) { + interactionFunc(); } else { - test_driver.send_keys(link, 'j'); + test_driver.click(link); } timestamps[counter] = {"syncPostInteraction": performance.now()}; } diff --git a/tests/wpt/tests/soft-navigation-heuristics/second-interaction-not-softnav.tentative.html b/tests/wpt/tests/soft-navigation-heuristics/second-interaction-not-softnav.tentative.html new file mode 100644 index 00000000000..a9bb337060d --- /dev/null +++ b/tests/wpt/tests/soft-navigation-heuristics/second-interaction-not-softnav.tentative.html @@ -0,0 +1,35 @@ + + + + + + + + + + + +
+

Click me!

+

Then click me!

+
+ + + + diff --git a/tests/wpt/tests/speculation-rules/prerender/navigation-api-location-replace.html b/tests/wpt/tests/speculation-rules/prerender/navigation-api-location-replace.html new file mode 100644 index 00000000000..e3ecf1b72b6 --- /dev/null +++ b/tests/wpt/tests/speculation-rules/prerender/navigation-api-location-replace.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + diff --git a/tests/wpt/tests/speculation-rules/prerender/navigation-api-multiple-entries.html b/tests/wpt/tests/speculation-rules/prerender/navigation-api-multiple-entries.html new file mode 100644 index 00000000000..e8e0f874597 --- /dev/null +++ b/tests/wpt/tests/speculation-rules/prerender/navigation-api-multiple-entries.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + diff --git a/tests/wpt/tests/speculation-rules/prerender/navigation-api.html b/tests/wpt/tests/speculation-rules/prerender/navigation-api.html new file mode 100644 index 00000000000..fd25e94b5b3 --- /dev/null +++ b/tests/wpt/tests/speculation-rules/prerender/navigation-api.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + diff --git a/tests/wpt/tests/speculation-rules/prerender/resources/utils.js b/tests/wpt/tests/speculation-rules/prerender/resources/utils.js index 311d37f0a01..62b3b3225cd 100644 --- a/tests/wpt/tests/speculation-rules/prerender/resources/utils.js +++ b/tests/wpt/tests/speculation-rules/prerender/resources/utils.js @@ -1,7 +1,10 @@ const STORE_URL = '/speculation-rules/prerender/resources/key-value-store.py'; // Starts prerendering for `url`. -function startPrerendering(url) { +// +// `rule_extras` provides additional parameters for the speculation rule used +// to trigger prerendering. +function startPrerendering(url, rule_extras = {}) { // Adds @@ -11,6 +13,10 @@ + + + + + + + + + + + + + + diff --git a/tests/wpt/tests/svg/color-inherit-link-visited-ref.svg b/tests/wpt/tests/svg/color-inherit-link-visited-ref.svg new file mode 100644 index 00000000000..3342e9347c3 --- /dev/null +++ b/tests/wpt/tests/svg/color-inherit-link-visited-ref.svg @@ -0,0 +1,3 @@ + + + diff --git a/tests/wpt/tests/svg/color-inherit-link-visited.svg b/tests/wpt/tests/svg/color-inherit-link-visited.svg new file mode 100644 index 00000000000..9324f1116b0 --- /dev/null +++ b/tests/wpt/tests/svg/color-inherit-link-visited.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/wpt/tests/svg/painting/reftests/mask-percentage-ref.html b/tests/wpt/tests/svg/painting/reftests/mask-percentage-ref.html new file mode 100644 index 00000000000..00c26e85ccf --- /dev/null +++ b/tests/wpt/tests/svg/painting/reftests/mask-percentage-ref.html @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/tests/wpt/tests/svg/painting/reftests/mask-percentage.html b/tests/wpt/tests/svg/painting/reftests/mask-percentage.html new file mode 100644 index 00000000000..e9cd0977413 --- /dev/null +++ b/tests/wpt/tests/svg/painting/reftests/mask-percentage.html @@ -0,0 +1,23 @@ + + +Percentages in a mask + + + + + + + + + + + + + + + + + + diff --git a/tests/wpt/tests/tools/webdriver/webdriver/bidi/modules/browsing_context.py b/tests/wpt/tests/tools/webdriver/webdriver/bidi/modules/browsing_context.py index b8b63c7bb52..15aa26b4427 100644 --- a/tests/wpt/tests/tools/webdriver/webdriver/bidi/modules/browsing_context.py +++ b/tests/wpt/tests/tools/webdriver/webdriver/bidi/modules/browsing_context.py @@ -1,7 +1,9 @@ import base64 +from enum import Enum from typing import Any, Dict, List, Mapping, MutableMapping, Optional, Union from ._module import BidiModule, command +from ..undefined import UNDEFINED, Undefined class ElementOptions(Dict[str, Any]): @@ -24,6 +26,11 @@ class BoxOptions(Dict[str, Any]): ClipOptions = Union[ElementOptions, BoxOptions] +class OriginOptions(Enum): + DOCUMENT = "document" + VIEWPORT = "viewport" + + class BrowsingContext(BidiModule): @command def activate(self, context: str) -> Mapping[str, Any]: @@ -31,13 +38,19 @@ class BrowsingContext(BidiModule): @command def capture_screenshot( - self, context: str, clip: Optional[ClipOptions] = None + self, + context: str, + clip: Optional[ClipOptions] = None, + origin: Optional[OriginOptions] = None, ) -> Mapping[str, Any]: params: MutableMapping[str, Any] = {"context": context} if clip is not None: params["clip"] = clip + if origin is not None: + params["origin"] = origin + return params @capture_screenshot.result @@ -177,16 +190,16 @@ class BrowsingContext(BidiModule): @command def set_viewport(self, context: str, - viewport: Optional[Mapping[str, Any]] = None, - device_pixel_ratio: Optional[float] = None) -> Mapping[str, Any]: + viewport: Union[Optional[Mapping[str, Any]], Undefined] = UNDEFINED, + device_pixel_ratio: Union[Optional[float], Undefined] = UNDEFINED) -> Mapping[str, Any]: params: MutableMapping[str, Any] = { "context": context, } - if viewport is not None: + if viewport is not UNDEFINED: params["viewport"] = viewport - if device_pixel_ratio is not None: + if device_pixel_ratio is not UNDEFINED: params["devicePixelRatio"] = device_pixel_ratio return params diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py index 1848a09eda9..e5e784e6aa4 100644 --- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py +++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/firefox.py @@ -213,7 +213,8 @@ def run_info_extras(**kwargs): "fission": not kwargs.get("disable_fission"), "sessionHistoryInParent": (not kwargs.get("disable_fission") or not get_bool_pref("fission.disableSessionHistoryInParent")), - "swgl": get_bool_pref("gfx.webrender.software")} + "swgl": get_bool_pref("gfx.webrender.software"), + "privateBrowsing": (kwargs["tags"] is not None and ("privatebrowsing" in kwargs["tags"]))} rv.update(run_info_browser_version(**kwargs)) diff --git a/tests/wpt/tests/trusted-types/DOMParser-parseFromString-regression.tentative.html b/tests/wpt/tests/trusted-types/DOMParser-parseFromString-regression.html similarity index 100% rename from tests/wpt/tests/trusted-types/DOMParser-parseFromString-regression.tentative.html rename to tests/wpt/tests/trusted-types/DOMParser-parseFromString-regression.html diff --git a/tests/wpt/tests/trusted-types/DOMParser-parseFromString.tentative.html b/tests/wpt/tests/trusted-types/DOMParser-parseFromString.html similarity index 100% rename from tests/wpt/tests/trusted-types/DOMParser-parseFromString.tentative.html rename to tests/wpt/tests/trusted-types/DOMParser-parseFromString.html diff --git a/tests/wpt/tests/trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.html b/tests/wpt/tests/trusted-types/DOMWindowTimers-setTimeout-setInterval.html similarity index 100% rename from tests/wpt/tests/trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.html rename to tests/wpt/tests/trusted-types/DOMWindowTimers-setTimeout-setInterval.html diff --git a/tests/wpt/tests/trusted-types/Document-execCommand.tentative.html b/tests/wpt/tests/trusted-types/Document-execCommand.html similarity index 100% rename from tests/wpt/tests/trusted-types/Document-execCommand.tentative.html rename to tests/wpt/tests/trusted-types/Document-execCommand.html diff --git a/tests/wpt/tests/trusted-types/Document-write.tentative.html b/tests/wpt/tests/trusted-types/Document-write.html similarity index 100% rename from tests/wpt/tests/trusted-types/Document-write.tentative.html rename to tests/wpt/tests/trusted-types/Document-write.html diff --git a/tests/wpt/tests/trusted-types/Element-insertAdjacentHTML.tentative.html b/tests/wpt/tests/trusted-types/Element-insertAdjacentHTML.html similarity index 100% rename from tests/wpt/tests/trusted-types/Element-insertAdjacentHTML.tentative.html rename to tests/wpt/tests/trusted-types/Element-insertAdjacentHTML.html diff --git a/tests/wpt/tests/trusted-types/Element-insertAdjacentText.tentative.html b/tests/wpt/tests/trusted-types/Element-insertAdjacentText.html similarity index 100% rename from tests/wpt/tests/trusted-types/Element-insertAdjacentText.tentative.html rename to tests/wpt/tests/trusted-types/Element-insertAdjacentText.html diff --git a/tests/wpt/tests/trusted-types/Element-outerHTML.tentative.html b/tests/wpt/tests/trusted-types/Element-outerHTML.html similarity index 100% rename from tests/wpt/tests/trusted-types/Element-outerHTML.tentative.html rename to tests/wpt/tests/trusted-types/Element-outerHTML.html diff --git a/tests/wpt/tests/trusted-types/Element-setAttribute.tentative.html b/tests/wpt/tests/trusted-types/Element-setAttribute.html similarity index 100% rename from tests/wpt/tests/trusted-types/Element-setAttribute.tentative.html rename to tests/wpt/tests/trusted-types/Element-setAttribute.html diff --git a/tests/wpt/tests/trusted-types/Element-setAttributeNS.tentative.html b/tests/wpt/tests/trusted-types/Element-setAttributeNS.html similarity index 100% rename from tests/wpt/tests/trusted-types/Element-setAttributeNS.tentative.html rename to tests/wpt/tests/trusted-types/Element-setAttributeNS.html diff --git a/tests/wpt/tests/trusted-types/GlobalEventHandlers-onclick.tentative.html b/tests/wpt/tests/trusted-types/GlobalEventHandlers-onclick.html similarity index 100% rename from tests/wpt/tests/trusted-types/GlobalEventHandlers-onclick.tentative.html rename to tests/wpt/tests/trusted-types/GlobalEventHandlers-onclick.html diff --git a/tests/wpt/tests/trusted-types/HTMLElement-generic.tentative.html b/tests/wpt/tests/trusted-types/HTMLElement-generic.html similarity index 100% rename from tests/wpt/tests/trusted-types/HTMLElement-generic.tentative.html rename to tests/wpt/tests/trusted-types/HTMLElement-generic.html diff --git a/tests/wpt/tests/trusted-types/HTMLScriptElement-internal-slot.tentative.html b/tests/wpt/tests/trusted-types/HTMLScriptElement-internal-slot.html similarity index 100% rename from tests/wpt/tests/trusted-types/HTMLScriptElement-internal-slot.tentative.html rename to tests/wpt/tests/trusted-types/HTMLScriptElement-internal-slot.html diff --git a/tests/wpt/tests/trusted-types/Node-multiple-arguments.tentative.html b/tests/wpt/tests/trusted-types/Node-multiple-arguments.html similarity index 100% rename from tests/wpt/tests/trusted-types/Node-multiple-arguments.tentative.html rename to tests/wpt/tests/trusted-types/Node-multiple-arguments.html diff --git a/tests/wpt/tests/trusted-types/Range-createContextualFragment.tentative.html b/tests/wpt/tests/trusted-types/Range-createContextualFragment.html similarity index 100% rename from tests/wpt/tests/trusted-types/Range-createContextualFragment.tentative.html rename to tests/wpt/tests/trusted-types/Range-createContextualFragment.html diff --git a/tests/wpt/tests/trusted-types/TrustedType-AttributeNodes.tentative.html b/tests/wpt/tests/trusted-types/TrustedType-AttributeNodes.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedType-AttributeNodes.tentative.html rename to tests/wpt/tests/trusted-types/TrustedType-AttributeNodes.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicy-CSP-no-name.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicy-CSP-no-name.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicy-CSP-no-name.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicy-CSP-no-name.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicy-CSP-wildcard.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicy-CSP-wildcard.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicy-CSP-wildcard.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicy-CSP-wildcard.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicy-createXXX.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicy-createXXX.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicy-createXXX.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicy-createXXX.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-constants.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-constants.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-constants.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-constants.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none-skip.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none-skip.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none-skip.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none-skip.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-wildcard.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-wildcard.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-wildcard.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-wildcard.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-defaultPolicy.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-defaultPolicy.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-defaultPolicy.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-defaultPolicy.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-getAttributeType-namespace.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-getAttributeType-namespace.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-getAttributeType-namespace.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-getAttributeType-namespace.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-getPropertyType.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-getPropertyType.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-getPropertyType.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-getPropertyType.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-isXXX.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-isXXX.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-isXXX.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-isXXX.html diff --git a/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-metadata.tentative.html b/tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-metadata.html similarity index 100% rename from tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-metadata.tentative.html rename to tests/wpt/tests/trusted-types/TrustedTypePolicyFactory-metadata.html diff --git a/tests/wpt/tests/trusted-types/Window-TrustedTypes.tentative.html b/tests/wpt/tests/trusted-types/Window-TrustedTypes.html similarity index 100% rename from tests/wpt/tests/trusted-types/Window-TrustedTypes.tentative.html rename to tests/wpt/tests/trusted-types/Window-TrustedTypes.html diff --git a/tests/wpt/tests/trusted-types/block-Document-execCommand.tentative.html b/tests/wpt/tests/trusted-types/block-Document-execCommand.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-Document-execCommand.tentative.html rename to tests/wpt/tests/trusted-types/block-Document-execCommand.html diff --git a/tests/wpt/tests/trusted-types/block-Node-multiple-arguments.tentative.html b/tests/wpt/tests/trusted-types/block-Node-multiple-arguments.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-Node-multiple-arguments.tentative.html rename to tests/wpt/tests/trusted-types/block-Node-multiple-arguments.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-DOMParser-parseFromString.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-DOMParser-parseFromString.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-DOMParser-parseFromString.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-DOMParser-parseFromString.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-Document-write.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-Document-write.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-Document-write.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-Document-write.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-Element-outerHTML.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-Element-outerHTML.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-Element-outerHTML.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-Element-outerHTML.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-Element-setAttribute.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-Element-setAttribute.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-Element-setAttribute.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-Element-setAttribute.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-Element-setAttributeNS.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-Element-setAttributeNS.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-Element-setAttributeNS.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-Element-setAttributeNS.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-HTMLElement-generic.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-HTMLElement-generic.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-HTMLElement-generic.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-HTMLElement-generic.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-Range-createContextualFragment.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-Range-createContextualFragment.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-Range-createContextualFragment.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-Range-createContextualFragment.html diff --git a/tests/wpt/tests/trusted-types/block-string-assignment-to-attribute-via-attribute-node.tentative.html b/tests/wpt/tests/trusted-types/block-string-assignment-to-attribute-via-attribute-node.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-string-assignment-to-attribute-via-attribute-node.tentative.html rename to tests/wpt/tests/trusted-types/block-string-assignment-to-attribute-via-attribute-node.html diff --git a/tests/wpt/tests/trusted-types/block-text-node-insertion-into-script-element.tentative.html b/tests/wpt/tests/trusted-types/block-text-node-insertion-into-script-element.html similarity index 100% rename from tests/wpt/tests/trusted-types/block-text-node-insertion-into-script-element.tentative.html rename to tests/wpt/tests/trusted-types/block-text-node-insertion-into-script-element.html diff --git a/tests/wpt/tests/trusted-types/csp-block-eval.tentative.html b/tests/wpt/tests/trusted-types/csp-block-eval.html similarity index 100% rename from tests/wpt/tests/trusted-types/csp-block-eval.tentative.html rename to tests/wpt/tests/trusted-types/csp-block-eval.html diff --git a/tests/wpt/tests/trusted-types/default-policy-callback-arguments.tentative.html b/tests/wpt/tests/trusted-types/default-policy-callback-arguments.html similarity index 100% rename from tests/wpt/tests/trusted-types/default-policy-callback-arguments.tentative.html rename to tests/wpt/tests/trusted-types/default-policy-callback-arguments.html diff --git a/tests/wpt/tests/trusted-types/default-policy-report-only.tentative.html b/tests/wpt/tests/trusted-types/default-policy-report-only.html similarity index 100% rename from tests/wpt/tests/trusted-types/default-policy-report-only.tentative.html rename to tests/wpt/tests/trusted-types/default-policy-report-only.html diff --git a/tests/wpt/tests/trusted-types/default-policy-report-only.tentative.html.headers b/tests/wpt/tests/trusted-types/default-policy-report-only.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/default-policy-report-only.tentative.html.headers rename to tests/wpt/tests/trusted-types/default-policy-report-only.html.headers diff --git a/tests/wpt/tests/trusted-types/default-policy.tentative.html b/tests/wpt/tests/trusted-types/default-policy.html similarity index 100% rename from tests/wpt/tests/trusted-types/default-policy.tentative.html rename to tests/wpt/tests/trusted-types/default-policy.html diff --git a/tests/wpt/tests/trusted-types/default-policy.tentative.html.headers b/tests/wpt/tests/trusted-types/default-policy.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/default-policy.tentative.html.headers rename to tests/wpt/tests/trusted-types/default-policy.html.headers diff --git a/tests/wpt/tests/trusted-types/empty-default-policy-report-only.tentative.html b/tests/wpt/tests/trusted-types/empty-default-policy-report-only.html similarity index 100% rename from tests/wpt/tests/trusted-types/empty-default-policy-report-only.tentative.html rename to tests/wpt/tests/trusted-types/empty-default-policy-report-only.html diff --git a/tests/wpt/tests/trusted-types/empty-default-policy-report-only.tentative.html.headers b/tests/wpt/tests/trusted-types/empty-default-policy-report-only.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/empty-default-policy-report-only.tentative.html.headers rename to tests/wpt/tests/trusted-types/empty-default-policy-report-only.html.headers diff --git a/tests/wpt/tests/trusted-types/empty-default-policy.tentative.html b/tests/wpt/tests/trusted-types/empty-default-policy.html similarity index 100% rename from tests/wpt/tests/trusted-types/empty-default-policy.tentative.html rename to tests/wpt/tests/trusted-types/empty-default-policy.html diff --git a/tests/wpt/tests/trusted-types/empty-default-policy.tentative.html.headers b/tests/wpt/tests/trusted-types/empty-default-policy.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/empty-default-policy.tentative.html.headers rename to tests/wpt/tests/trusted-types/empty-default-policy.html.headers diff --git a/tests/wpt/tests/trusted-types/eval-csp-no-tt.tentative.html b/tests/wpt/tests/trusted-types/eval-csp-no-tt.html similarity index 100% rename from tests/wpt/tests/trusted-types/eval-csp-no-tt.tentative.html rename to tests/wpt/tests/trusted-types/eval-csp-no-tt.html diff --git a/tests/wpt/tests/trusted-types/eval-csp-tt-default-policy.tentative.html b/tests/wpt/tests/trusted-types/eval-csp-tt-default-policy.html similarity index 100% rename from tests/wpt/tests/trusted-types/eval-csp-tt-default-policy.tentative.html rename to tests/wpt/tests/trusted-types/eval-csp-tt-default-policy.html diff --git a/tests/wpt/tests/trusted-types/eval-csp-tt-no-default-policy.tentative.html b/tests/wpt/tests/trusted-types/eval-csp-tt-no-default-policy.html similarity index 100% rename from tests/wpt/tests/trusted-types/eval-csp-tt-no-default-policy.tentative.html rename to tests/wpt/tests/trusted-types/eval-csp-tt-no-default-policy.html diff --git a/tests/wpt/tests/trusted-types/eval-function-constructor.tentative.html b/tests/wpt/tests/trusted-types/eval-function-constructor.html similarity index 100% rename from tests/wpt/tests/trusted-types/eval-function-constructor.tentative.html rename to tests/wpt/tests/trusted-types/eval-function-constructor.html diff --git a/tests/wpt/tests/trusted-types/eval-no-csp-no-tt-default-policy.tentative.html b/tests/wpt/tests/trusted-types/eval-no-csp-no-tt-default-policy.html similarity index 100% rename from tests/wpt/tests/trusted-types/eval-no-csp-no-tt-default-policy.tentative.html rename to tests/wpt/tests/trusted-types/eval-no-csp-no-tt-default-policy.html diff --git a/tests/wpt/tests/trusted-types/eval-no-csp-no-tt.tentative.html b/tests/wpt/tests/trusted-types/eval-no-csp-no-tt.html similarity index 100% rename from tests/wpt/tests/trusted-types/eval-no-csp-no-tt.tentative.html rename to tests/wpt/tests/trusted-types/eval-no-csp-no-tt.html diff --git a/tests/wpt/tests/trusted-types/eval-with-permissive-csp.tentative.html b/tests/wpt/tests/trusted-types/eval-with-permissive-csp.html similarity index 100% rename from tests/wpt/tests/trusted-types/eval-with-permissive-csp.tentative.html rename to tests/wpt/tests/trusted-types/eval-with-permissive-csp.html diff --git a/tests/wpt/tests/trusted-types/idlharness.tentative.window.js b/tests/wpt/tests/trusted-types/idlharness.tentative.window.js.html similarity index 100% rename from tests/wpt/tests/trusted-types/idlharness.tentative.window.js rename to tests/wpt/tests/trusted-types/idlharness.tentative.window.js.html diff --git a/tests/wpt/tests/trusted-types/no-require-trusted-types-for-report-only.tentative.html b/tests/wpt/tests/trusted-types/no-require-trusted-types-for-report-only.html similarity index 100% rename from tests/wpt/tests/trusted-types/no-require-trusted-types-for-report-only.tentative.html rename to tests/wpt/tests/trusted-types/no-require-trusted-types-for-report-only.html diff --git a/tests/wpt/tests/trusted-types/no-require-trusted-types-for-report-only.tentative.html.headers b/tests/wpt/tests/trusted-types/no-require-trusted-types-for-report-only.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/no-require-trusted-types-for-report-only.tentative.html.headers rename to tests/wpt/tests/trusted-types/no-require-trusted-types-for-report-only.html.headers diff --git a/tests/wpt/tests/trusted-types/no-require-trusted-types-for.tentative.html b/tests/wpt/tests/trusted-types/no-require-trusted-types-for.html similarity index 100% rename from tests/wpt/tests/trusted-types/no-require-trusted-types-for.tentative.html rename to tests/wpt/tests/trusted-types/no-require-trusted-types-for.html diff --git a/tests/wpt/tests/trusted-types/require-trusted-types-for-report-only.tentative.html b/tests/wpt/tests/trusted-types/require-trusted-types-for-report-only.html similarity index 100% rename from tests/wpt/tests/trusted-types/require-trusted-types-for-report-only.tentative.html rename to tests/wpt/tests/trusted-types/require-trusted-types-for-report-only.html diff --git a/tests/wpt/tests/trusted-types/require-trusted-types-for-report-only.tentative.html.headers b/tests/wpt/tests/trusted-types/require-trusted-types-for-report-only.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/require-trusted-types-for-report-only.tentative.html.headers rename to tests/wpt/tests/trusted-types/require-trusted-types-for-report-only.html.headers diff --git a/tests/wpt/tests/trusted-types/require-trusted-types-for.tentative.html b/tests/wpt/tests/trusted-types/require-trusted-types-for.html similarity index 100% rename from tests/wpt/tests/trusted-types/require-trusted-types-for.tentative.html rename to tests/wpt/tests/trusted-types/require-trusted-types-for.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-createHTMLDocument.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-createHTMLDocument.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-createHTMLDocument.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-createHTMLDocument.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list-report-only.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list-report-only.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.html.headers b/tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list-report-only.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.html.headers rename to tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list-report-only.html.headers diff --git a/tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-duplicate-names-list.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-duplicate-names-without-enforcement.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-duplicate-names-without-enforcement.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-duplicate-names-without-enforcement.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-duplicate-names-without-enforcement.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-duplicate-names.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-duplicate-names.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-duplicate-names.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-duplicate-names.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.html.headers b/tests/wpt/tests/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.html.headers rename to tests/wpt/tests/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.html.headers diff --git a/tests/wpt/tests/trusted-types/trusted-types-eval-reporting-report-only.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-eval-reporting-report-only.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-eval-reporting-report-only.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-eval-reporting-report-only.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-eval-reporting-report-only.tentative.html.headers b/tests/wpt/tests/trusted-types/trusted-types-eval-reporting-report-only.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-eval-reporting-report-only.tentative.html.headers rename to tests/wpt/tests/trusted-types/trusted-types-eval-reporting-report-only.html.headers diff --git a/tests/wpt/tests/trusted-types/trusted-types-eval-reporting.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-eval-reporting.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-eval-reporting.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-eval-reporting.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-eval-reporting.tentative.html.headers b/tests/wpt/tests/trusted-types/trusted-types-eval-reporting.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-eval-reporting.tentative.html.headers rename to tests/wpt/tests/trusted-types/trusted-types-eval-reporting.html.headers diff --git a/tests/wpt/tests/trusted-types/trusted-types-event-handlers.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-event-handlers.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-event-handlers.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-event-handlers.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-from-literal.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-from-literal.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-from-literal.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-from-literal.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-navigation.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-navigation.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-navigation.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-navigation.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-report-only.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-report-only.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-report-only.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-report-only.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-report-only.tentative.html.headers b/tests/wpt/tests/trusted-types/trusted-types-report-only.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-report-only.tentative.html.headers rename to tests/wpt/tests/trusted-types/trusted-types-report-only.html.headers diff --git a/tests/wpt/tests/trusted-types/trusted-types-reporting.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-reporting.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-reporting.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-reporting.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-reporting.tentative.html.headers b/tests/wpt/tests/trusted-types/trusted-types-reporting.html.headers similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-reporting.tentative.html.headers rename to tests/wpt/tests/trusted-types/trusted-types-reporting.html.headers diff --git a/tests/wpt/tests/trusted-types/trusted-types-source-file-path.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-source-file-path.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-source-file-path.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-source-file-path.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-svg-script.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-svg-script.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-svg-script.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-svg-script.html diff --git a/tests/wpt/tests/trusted-types/trusted-types-tojson.tentative.html b/tests/wpt/tests/trusted-types/trusted-types-tojson.html similarity index 100% rename from tests/wpt/tests/trusted-types/trusted-types-tojson.tentative.html rename to tests/wpt/tests/trusted-types/trusted-types-tojson.html diff --git a/tests/wpt/tests/trusted-types/tt-block-eval.tentative.html b/tests/wpt/tests/trusted-types/tt-block-eval.html similarity index 100% rename from tests/wpt/tests/trusted-types/tt-block-eval.tentative.html rename to tests/wpt/tests/trusted-types/tt-block-eval.html diff --git a/tests/wpt/tests/wai-aria/role/ReadMe.md b/tests/wpt/tests/wai-aria/role/ReadMe.md index 189c9f75eb8..eb89da7846b 100644 --- a/tests/wpt/tests/wai-aria/role/ReadMe.md +++ b/tests/wpt/tests/wai-aria/role/ReadMe.md @@ -4,8 +4,8 @@ /wai-aria/roles/ includes various files broken up by test type - **roles.html** covers simple assignment/verification of most core WAI-ARIA roles, and includes a list of cross-references to other specific files and spec directories. -- role testing of *host language* implicit roles (E.g., `
-> main`) are in other directories (E.g., [html-aam](https://github.com/web-platform-tests/interop-2023-accessibility-testing/issues/13)) -- role testing of **ARIA extension specs** are in other directories (E.g., [graphics-aria](https://github.com/web-platform-tests/interop-2023-accessibility-testing/issues/9)) +- role testing of *host language* implicit roles (E.g., `
-> main`) are in other directories (E.g., [html-aam](https://github.com/web-platform-tests/interop-accessibility/issues/13)) +- role testing of **ARIA extension specs** are in other directories (E.g., [graphics-aria](https://github.com/web-platform-tests/interop-accessibility/issues/9)) - basic.html was the first to ensure basic test coverage of webdriver getcomputedrole - other context-dependent role tests, error handling, and edge cases are covered in separate files - list-roles.html diff --git a/tests/wpt/tests/wai-aria/scripts/aria-utils.js b/tests/wpt/tests/wai-aria/scripts/aria-utils.js index 86aed2bae5a..a281bec1783 100644 --- a/tests/wpt/tests/wai-aria/scripts/aria-utils.js +++ b/tests/wpt/tests/wai-aria/scripts/aria-utils.js @@ -105,12 +105,12 @@ const AriaUtils = { AriaUtils.verifyGenericRolesBySelector(".ex-generic"); This helper function is equivalant to AriaUtils.verifyRoleOrVariantRolesBySelector(".ex-generic", ["generic", "", "none"]); - See various issues and discussions linked from https://github.com/web-platform-tests/interop-2023-accessibility-testing/issues/48 + See various issues and discussions linked from https://github.com/web-platform-tests/interop-accessibility/issues/48 */ verifyGenericRolesBySelector: function(selector) { // ARIA WG determined implementation variants "none" (Chromium), and the empty string "" (WebKit), are sufficiently equivalent to "generic" for WPT test verification of HTML-AAM. - // See various discussions linked from https://github.com/web-platform-tests/interop-2023-accessibility-testing/issues/48 + // See various discussions linked from https://github.com/web-platform-tests/interop-accessibility/issues/48 this.verifyRoleOrVariantRolesBySelector(selector, ["generic", "", "none"]); }, diff --git a/tests/wpt/tests/wasm/jsapi/module/moduleSource.tentative.any.js b/tests/wpt/tests/wasm/jsapi/module/moduleSource.tentative.any.js new file mode 100644 index 00000000000..a3d09d55d6e --- /dev/null +++ b/tests/wpt/tests/wasm/jsapi/module/moduleSource.tentative.any.js @@ -0,0 +1,41 @@ +// META: global=window,dedicatedworker,jsshell,shadowrealm +// META: script=/wasm/jsapi/wasm-module-builder.js +// META: script=/wasm/jsapi/assertions.js + +let emptyModuleBinary; +setup(() => { + emptyModuleBinary = new WasmModuleBuilder().toBuffer(); +}); + +test(() => { + assert_equals(typeof AbstractModuleSource, "undefined"); + const AbstractModuleSource = Object.getPrototypeOf(WebAssembly.Module); + assert_equals(AbstractModuleSource.name, "AbstractModuleSource"); + assert_not_equals(AbstractModuleSource, Function); +}, "AbstractModuleSource intrinsic"); + +test(() => { + const AbstractModuleSourceProto = Object.getPrototypeOf(WebAssembly.Module.prototype); + assert_not_equals(AbstractModuleSourceProto, Object); + const AbstractModuleSource = Object.getPrototypeOf(WebAssembly.Module); + assert_equals(AbstractModuleSource.prototype, AbstractModuleSourceProto); +}, "AbstractModuleSourceProto intrinsic"); + +test(() => { + const builder = new WasmModuleBuilder(); + + builder + .addFunction("fn", kSig_v_v) + .addBody([]) + .exportFunc(); + builder.addMemory(0, 256, true); + + const buffer = builder.toBuffer() + const module = new WebAssembly.Module(buffer); + + const AbstractModuleSource = Object.getPrototypeOf(WebAssembly.Module); + const toStringTag = Object.getOwnPropertyDescriptor(AbstractModuleSource.prototype, Symbol.toStringTag).get; + + assert_equals(toStringTag.call(module), "WebAssembly.Module"); + assert_throws_js(TypeError, () => toStringTag.call({})); +}, "AbstractModuleSourceProto toStringTag brand check"); \ No newline at end of file diff --git a/tests/wpt/tests/wasm/webapi/esm-integration/resources/worker-source-phase.js b/tests/wpt/tests/wasm/webapi/esm-integration/resources/worker-source-phase.js new file mode 100644 index 00000000000..c7a4f0d437c --- /dev/null +++ b/tests/wpt/tests/wasm/webapi/esm-integration/resources/worker-source-phase.js @@ -0,0 +1,3 @@ +import source modSource from "./worker.wasm"; +assert_true(modSource instanceof WebAssembly.Module); +assert_true(await import.source("./worker.wasm") === modSource); diff --git a/tests/wpt/tests/wasm/webapi/esm-integration/resources/worker.js b/tests/wpt/tests/wasm/webapi/esm-integration/resources/worker.js index c72464f71a4..1163e477fd7 100644 --- a/tests/wpt/tests/wasm/webapi/esm-integration/resources/worker.js +++ b/tests/wpt/tests/wasm/webapi/esm-integration/resources/worker.js @@ -1 +1,2 @@ -import * as mod from "./worker.wasm" +import * as mod from "./worker.wasm"; +assert_true(await import("./worker.wasm") === mod); diff --git a/tests/wpt/tests/wasm/webapi/esm-integration/source-phase.tentative.html b/tests/wpt/tests/wasm/webapi/esm-integration/source-phase.tentative.html new file mode 100644 index 00000000000..eb415a4c6f1 --- /dev/null +++ b/tests/wpt/tests/wasm/webapi/esm-integration/source-phase.tentative.html @@ -0,0 +1,35 @@ + +Source phase imports + + + + diff --git a/tests/wpt/tests/web-animations/animation-model/animation-types/property-list.js b/tests/wpt/tests/web-animations/animation-model/animation-types/property-list.js index 14a175d7549..32b857c30ed 100644 --- a/tests/wpt/tests/web-animations/animation-model/animation-types/property-list.js +++ b/tests/wpt/tests/web-animations/animation-model/animation-types/property-list.js @@ -670,7 +670,7 @@ const gCSSProperties1 = { 'grid-template-areas': { // https://drafts.csswg.org/css-template/#grid-template-areas types: [ - { type: 'discrete', options: [ [ '". . a b" ". .a b"', 'none' ] ] } + { type: 'discrete', options: [ [ '". . a b" ". . a b"', 'none' ] ] } ] }, 'height': { diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/clip.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/clip.py index 740ee531906..1916cb9b7fa 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/clip.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/clip.py @@ -5,7 +5,6 @@ from webdriver.bidi.modules.script import ContextTarget from . import ( get_element_coordinates, - get_page_y_offset, get_physical_element_dimensions, get_reference_screenshot, ) @@ -176,7 +175,7 @@ async def test_clip_viewport_scroll_to( element = await bidi_session.script.call_function( await_promise=False, - function_declaration=f"""() => {{ + function_declaration="""() => {{ const element = document.querySelector('div'); const rect = element.getBoundingClientRect(); diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/context_created/context_created.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/context_created/context_created.py index 62e7f8dd574..9b0926c0975 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/context_created/context_created.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/context_created/context_created.py @@ -32,12 +32,12 @@ async def test_not_unsubscribed(bidi_session): @pytest.mark.parametrize("type_hint", ["tab", "window"]) -async def test_new_context(bidi_session, wait_for_event, subscribe_events, type_hint): +async def test_new_context(bidi_session, wait_for_event, wait_for_future_safe, subscribe_events, type_hint): await subscribe_events([CONTEXT_CREATED_EVENT]) on_entry = wait_for_event(CONTEXT_CREATED_EVENT) top_level_context = await bidi_session.browsing_context.create(type_hint=type_hint) - context_info = await on_entry + context_info = await wait_for_future_safe(on_entry) assert_browsing_context( context_info, @@ -48,7 +48,7 @@ async def test_new_context(bidi_session, wait_for_event, subscribe_events, type_ ) -async def test_evaluate_window_open_without_url(bidi_session, subscribe_events, wait_for_event, top_context): +async def test_evaluate_window_open_without_url(bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, top_context): await subscribe_events([CONTEXT_CREATED_EVENT]) on_entry = wait_for_event(CONTEXT_CREATED_EVENT) @@ -58,7 +58,7 @@ async def test_evaluate_window_open_without_url(bidi_session, subscribe_events, target=ContextTarget(top_context["context"]), await_promise=False) - context_info = await on_entry + context_info = await wait_for_future_safe(on_entry) assert_browsing_context( context_info, @@ -69,7 +69,7 @@ async def test_evaluate_window_open_without_url(bidi_session, subscribe_events, ) -async def test_evaluate_window_open_with_url(bidi_session, subscribe_events, wait_for_event, inline, top_context): +async def test_evaluate_window_open_with_url(bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, inline, top_context): url = inline("
foo
") await subscribe_events([CONTEXT_CREATED_EVENT]) @@ -80,7 +80,7 @@ async def test_evaluate_window_open_with_url(bidi_session, subscribe_events, wai expression=f"""window.open("{url}");""", target=ContextTarget(top_context["context"]), await_promise=False) - context_info = await on_entry + context_info = await wait_for_future_safe(on_entry) assert_browsing_context( context_info, diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/context_destroyed/context_destroyed.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/context_destroyed/context_destroyed.py index 5baac7abd2d..0dad8bc21d4 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/context_destroyed/context_destroyed.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/context_destroyed/context_destroyed.py @@ -32,7 +32,7 @@ async def test_unsubscribe(bidi_session, new_tab): @pytest.mark.parametrize("type_hint", ["tab", "window"]) -async def test_new_context(bidi_session, wait_for_event, subscribe_events, type_hint): +async def test_new_context(bidi_session, wait_for_event, wait_for_future_safe, subscribe_events, type_hint): await subscribe_events([CONTEXT_DESTROYED_EVENT]) on_entry = wait_for_event(CONTEXT_DESTROYED_EVENT) @@ -40,7 +40,7 @@ async def test_new_context(bidi_session, wait_for_event, subscribe_events, type_ await bidi_session.browsing_context.close(context=new_context["context"]) - context_info = await on_entry + context_info = await wait_for_future_safe(on_entry) assert_browsing_context( context_info, @@ -63,7 +63,7 @@ async def test_navigate(bidi_session, subscribe_events, new_tab, inline, domain) remove_listener = bidi_session.add_event_listener(CONTEXT_DESTROYED_EVENT, on_event) - url = inline(f"
test
", domain=domain) + url = inline("
test
", domain=domain) await bidi_session.browsing_context.navigate( url=url, context=new_tab["context"], wait="complete" ) @@ -78,7 +78,7 @@ async def test_navigate(bidi_session, subscribe_events, new_tab, inline, domain) @pytest.mark.parametrize("domain", ["", "alt"], ids=["same_origin", "cross_origin"]) async def test_navigate_iframe( - bidi_session, wait_for_event, subscribe_events, new_tab, inline, domain + bidi_session, wait_for_event, wait_for_future_safe, subscribe_events, new_tab, inline, domain ): await subscribe_events([CONTEXT_DESTROYED_EVENT]) @@ -99,7 +99,7 @@ async def test_navigate_iframe( url=url, context=new_tab["context"], wait="complete" ) - context_info = await on_entry + context_info = await wait_for_future_safe(on_entry) assert_browsing_context( context_info, @@ -111,7 +111,7 @@ async def test_navigate_iframe( async def test_delete_iframe( - bidi_session, wait_for_event, subscribe_events, new_tab, inline + bidi_session, wait_for_event, wait_for_future_safe, subscribe_events, new_tab, inline ): await subscribe_events([CONTEXT_DESTROYED_EVENT]) @@ -133,7 +133,7 @@ async def test_delete_iframe( await_promise=False, ) - context_info = await on_entry + context_info = await wait_for_future_safe(on_entry) assert_browsing_context( context_info, diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/reference_context.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/reference_context.py index f8a834069a1..ffc95ef41ca 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/reference_context.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/create/reference_context.py @@ -1,7 +1,6 @@ import pytest from .. import assert_browsing_context -from webdriver.bidi.modules.script import ContextTarget pytestmark = pytest.mark.asyncio diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/dom_content_loaded/dom_content_loaded.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/dom_content_loaded/dom_content_loaded.py index 402c23f164d..00cdad1dbb6 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/dom_content_loaded/dom_content_loaded.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/dom_content_loaded/dom_content_loaded.py @@ -39,7 +39,7 @@ async def test_unsubscribe(bidi_session, inline, top_context): async def test_subscribe( - bidi_session, subscribe_events, inline, new_tab, wait_for_event + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[DOM_CONTENT_LOADED_EVENT]) @@ -48,7 +48,7 @@ async def test_subscribe( result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info( event, @@ -61,7 +61,7 @@ async def test_subscribe( async def test_timestamp( - bidi_session, current_time, subscribe_events, inline, new_tab, wait_for_event + bidi_session, current_time, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[DOM_CONTENT_LOADED_EVENT]) @@ -72,7 +72,7 @@ async def test_timestamp( result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url ) - event = await on_entry + event = await wait_for_future_safe(on_entry) time_end = await current_time() @@ -142,12 +142,12 @@ async def test_iframe( @pytest.mark.parametrize("type_hint", ["tab", "window"]) -async def test_new_context(bidi_session, subscribe_events, wait_for_event, type_hint): +async def test_new_context(bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, type_hint): await subscribe_events(events=[DOM_CONTENT_LOADED_EVENT]) on_entry = wait_for_event(DOM_CONTENT_LOADED_EVENT) new_context = await bidi_session.browsing_context.create(type_hint=type_hint) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info( event, {"context": new_context["context"], "url": "about:blank"} @@ -156,7 +156,7 @@ async def test_new_context(bidi_session, subscribe_events, wait_for_event, type_ async def test_document_write( - bidi_session, subscribe_events, inline, top_context, wait_for_event + bidi_session, subscribe_events, inline, top_context, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[DOM_CONTENT_LOADED_EVENT]) @@ -168,7 +168,7 @@ async def test_document_write( await_promise=False, ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info( event, @@ -178,7 +178,7 @@ async def test_document_write( async def test_page_with_base_tag( - bidi_session, subscribe_events, inline, new_tab, wait_for_event + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[DOM_CONTENT_LOADED_EVENT]) @@ -187,7 +187,7 @@ async def test_page_with_base_tag( result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info( event, diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/fragment_navigated/fragment_navigated.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/fragment_navigated/fragment_navigated.py index affedfdf588..a4bd012588d 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/fragment_navigated/fragment_navigated.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/fragment_navigated/fragment_navigated.py @@ -4,7 +4,7 @@ from tests.support.sync import AsyncPoll from webdriver.bidi.modules.script import ContextTarget from webdriver.error import TimeoutException -from ... import any_int, any_string, recursive_compare, int_interval +from ... import any_int, recursive_compare, int_interval from .. import assert_navigation_info pytestmark = pytest.mark.asyncio @@ -42,7 +42,7 @@ async def test_unsubscribe(bidi_session, url, top_context): remove_listener() -async def test_subscribe(bidi_session, subscribe_events, url, new_tab, wait_for_event): +async def test_subscribe(bidi_session, subscribe_events, url, new_tab, wait_for_event, wait_for_future_safe): await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url(EMPTY_PAGE), wait="complete" ) @@ -52,7 +52,7 @@ async def test_subscribe(bidi_session, subscribe_events, url, new_tab, wait_for_ on_entry = wait_for_event(FRAGMENT_NAVIGATED_EVENT) target_url = url(EMPTY_PAGE + '#foo') await bidi_session.browsing_context.navigate(context=new_tab["context"], url=target_url, wait="complete") - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info(event, {"context": new_tab["context"], "url": target_url}) @@ -69,7 +69,7 @@ async def test_timestamp(bidi_session, current_time, subscribe_events, url, new_ on_entry = wait_for_event(FRAGMENT_NAVIGATED_EVENT) target_url = url(EMPTY_PAGE + '#foo') await bidi_session.browsing_context.navigate(context=new_tab["context"], url=target_url, wait="complete") - event = await on_entry + event = await wait_for_future_safe(on_entry) time_end = await current_time() @@ -80,7 +80,7 @@ async def test_timestamp(bidi_session, current_time, subscribe_events, url, new_ async def test_navigation_id( - bidi_session, new_tab, url, subscribe_events, wait_for_event + bidi_session, new_tab, url, subscribe_events, wait_for_event, wait_for_future_safe ): await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url(EMPTY_PAGE), wait="complete" @@ -90,7 +90,7 @@ async def test_navigation_id( on_frame_navigated = wait_for_event(FRAGMENT_NAVIGATED_EVENT) - target_url = url(EMPTY_PAGE + '#foo'); + target_url = url(EMPTY_PAGE + '#foo') result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=target_url, wait="complete") @@ -101,11 +101,11 @@ async def test_navigation_id( 'timestamp': any_int, 'url': target_url }, - await on_frame_navigated, + await wait_for_future_safe(on_frame_navigated), ) -async def test_url_with_base_tag(bidi_session, subscribe_events, inline, new_tab, wait_for_event): +async def test_url_with_base_tag(bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe): url = inline("""""") await bidi_session.browsing_context.navigate(context=new_tab["context"], url=url, wait="complete") @@ -113,7 +113,7 @@ async def test_url_with_base_tag(bidi_session, subscribe_events, inline, new_tab on_frame_navigated = wait_for_event(FRAGMENT_NAVIGATED_EVENT) - target_url = url + '#foo'; + target_url = url + '#foo' await bidi_session.browsing_context.navigate(context=new_tab["context"], url=target_url, wait="complete") recursive_compare( @@ -121,12 +121,12 @@ async def test_url_with_base_tag(bidi_session, subscribe_events, inline, new_tab 'context': new_tab["context"], 'url': target_url }, - await on_frame_navigated, + await wait_for_future_safe(on_frame_navigated), ) async def test_iframe( - bidi_session, new_tab, url, inline, subscribe_events, wait_for_event + bidi_session, new_tab, url, inline, subscribe_events, wait_for_event, wait_for_future_safe ): initial_url = url(EMPTY_PAGE + '#foo') parent_url = inline(f"") @@ -155,7 +155,7 @@ async def test_iframe( 'timestamp': any_int, 'url': target_url }, - await on_frame_navigated, + await wait_for_future_safe(on_frame_navigated), ) @@ -168,7 +168,7 @@ async def test_iframe( ] ) async def test_document_location( - bidi_session, new_tab, url, subscribe_events, wait_for_event, hash_before, hash_after + bidi_session, new_tab, url, subscribe_events, wait_for_event, wait_for_future_safe, hash_before, hash_after ): target_context = new_tab["context"] @@ -200,7 +200,7 @@ async def test_document_location( 'timestamp': any_int, 'url': target_url }, - await on_frame_navigated, + await wait_for_future_safe(on_frame_navigated), ) @@ -213,7 +213,7 @@ async def test_document_location( ] ) async def test_browsing_context_navigate( - bidi_session, new_tab, url, subscribe_events, wait_for_event, hash_before, hash_after + bidi_session, new_tab, url, subscribe_events, wait_for_event, wait_for_future_safe, hash_before, hash_after ): target_context = new_tab["context"] @@ -236,7 +236,7 @@ async def test_browsing_context_navigate( 'timestamp': any_int, 'url': target_url }, - await on_frame_navigated, + await wait_for_future_safe(on_frame_navigated), ) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/fragment_navigated/history_api.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/fragment_navigated/history_api.py index 5343b432605..0af0a71c2b8 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/fragment_navigated/history_api.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/fragment_navigated/history_api.py @@ -20,7 +20,8 @@ FRAGMENT_NAVIGATED_EVENT = "browsingContext.fragmentNavigated" ] ) async def test_history_push_state( - bidi_session, new_tab, url, subscribe_events, wait_for_event, hash_before, hash_after + bidi_session, new_tab, url, subscribe_events, wait_for_event, + wait_for_future_safe, hash_before, hash_after ): target_context = new_tab["context"] @@ -52,5 +53,5 @@ async def test_history_push_state( 'timestamp': any_int, 'url': target_url }, - await on_frame_navigated, + await wait_for_future_safe(on_frame_navigated), ) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/handle_user_prompt/handle_user_prompt.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/handle_user_prompt/handle_user_prompt.py index 5d9fe587b69..767305405c6 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/handle_user_prompt/handle_user_prompt.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/handle_user_prompt/handle_user_prompt.py @@ -9,7 +9,7 @@ pytestmark = pytest.mark.asyncio USER_PROMPT_OPENED_EVENT = "browsingContext.userPromptOpened" -async def test_alert(bidi_session, wait_for_event, top_context, subscribe_events): +async def test_alert(bidi_session, wait_for_event, wait_for_future_safe, top_context, subscribe_events): await subscribe_events([USER_PROMPT_OPENED_EVENT]) on_entry = wait_for_event(USER_PROMPT_OPENED_EVENT) @@ -23,7 +23,7 @@ async def test_alert(bidi_session, wait_for_event, top_context, subscribe_events ) # Wait for prompt to appear. - await on_entry + await wait_for_future_safe(on_entry) await bidi_session.browsing_context.handle_user_prompt( context=top_context["context"] @@ -37,7 +37,7 @@ async def test_alert(bidi_session, wait_for_event, top_context, subscribe_events @pytest.mark.parametrize("accept", [True, False]) async def test_confirm( - bidi_session, wait_for_event, top_context, subscribe_events, accept + bidi_session, wait_for_event, wait_for_future_safe, top_context, subscribe_events, accept ): await subscribe_events([USER_PROMPT_OPENED_EVENT]) on_entry = wait_for_event(USER_PROMPT_OPENED_EVENT) @@ -52,7 +52,7 @@ async def test_confirm( ) # Wait for prompt to appear. - await on_entry + await wait_for_future_safe(on_entry) await bidi_session.browsing_context.handle_user_prompt( context=top_context["context"], accept=accept @@ -66,7 +66,7 @@ async def test_confirm( @pytest.mark.parametrize("accept", [True, False]) async def test_prompt( - bidi_session, wait_for_event, top_context, subscribe_events, accept + bidi_session, wait_for_event, wait_for_future_safe, top_context, subscribe_events, accept ): await subscribe_events([USER_PROMPT_OPENED_EVENT]) on_entry = wait_for_event(USER_PROMPT_OPENED_EVENT) @@ -81,7 +81,7 @@ async def test_prompt( ) # Wait for prompt to appear. - await on_entry + await wait_for_future_safe(on_entry) test_user_text = "Test" await bidi_session.browsing_context.handle_user_prompt( @@ -99,7 +99,8 @@ async def test_prompt( @pytest.mark.parametrize("type_hint", ["tab", "window"]) async def test_two_top_level_contexts( - bidi_session, top_context, inline, subscribe_events, wait_for_event, type_hint + bidi_session, top_context, inline, subscribe_events, wait_for_event, + wait_for_future_safe, type_hint ): new_context = await bidi_session.browsing_context.create(type_hint=type_hint) @@ -112,7 +113,7 @@ async def test_two_top_level_contexts( ) # Wait for prompt to appear. - await on_entry + await wait_for_future_safe(on_entry) # Try to close the prompt in another context. with pytest.raises(error.NoSuchAlertException): @@ -135,6 +136,7 @@ async def test_multiple_frames( test_page_multiple_frames, subscribe_events, wait_for_event, + wait_for_future_safe, ): await subscribe_events([USER_PROMPT_OPENED_EVENT]) on_entry = wait_for_event(USER_PROMPT_OPENED_EVENT) @@ -159,7 +161,7 @@ async def test_multiple_frames( ) # Wait for prompt to appear. - await on_entry + await wait_for_future_safe(on_entry) # Close prompt from the second frame. await bidi_session.browsing_context.handle_user_prompt( diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/load/load.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/load/load.py index 568ee517881..4c2c6e74c53 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/load/load.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/load/load.py @@ -36,20 +36,20 @@ async def test_unsubscribe(bidi_session, inline, new_tab): async def test_subscribe( - bidi_session, subscribe_events, inline, new_tab, wait_for_event + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[CONTEXT_LOAD_EVENT]) on_entry = wait_for_event(CONTEXT_LOAD_EVENT) url = inline("
foo
") await bidi_session.browsing_context.navigate(context=new_tab["context"], url=url) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info(event, {"context": new_tab["context"], "url": url}) async def test_timestamp( - bidi_session, current_time, subscribe_events, inline, new_tab, wait_for_event + bidi_session, current_time, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[CONTEXT_LOAD_EVENT]) @@ -60,7 +60,7 @@ async def test_timestamp( result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url ) - event = await on_entry + event = await wait_for_future_safe(on_entry) time_end = await current_time() @@ -122,12 +122,12 @@ async def test_iframe( @pytest.mark.parametrize("type_hint", ["tab", "window"]) -async def test_new_context(bidi_session, subscribe_events, wait_for_event, type_hint): +async def test_new_context(bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, type_hint): await subscribe_events(events=[CONTEXT_LOAD_EVENT]) on_entry = wait_for_event(CONTEXT_LOAD_EVENT) new_context = await bidi_session.browsing_context.create(type_hint=type_hint) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info( event, {"context": new_context["context"], "url": "about:blank"} @@ -136,7 +136,7 @@ async def test_new_context(bidi_session, subscribe_events, wait_for_event, type_ async def test_document_write( - bidi_session, subscribe_events, top_context, wait_for_event + bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[CONTEXT_LOAD_EVENT]) @@ -148,7 +148,7 @@ async def test_document_write( await_promise=False, ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info( event, @@ -158,7 +158,7 @@ async def test_document_write( async def test_page_with_base_tag( - bidi_session, subscribe_events, inline, new_tab, wait_for_event + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[CONTEXT_LOAD_EVENT]) @@ -167,7 +167,7 @@ async def test_page_with_base_tag( result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info( event, diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/data_url.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/data_url.py index 6d95beb66c0..390b519034f 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/data_url.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/data_url.py @@ -7,11 +7,11 @@ from . import navigate_and_assert pytestmark = pytest.mark.asyncio -def dataURL(doc, mime_type="text/html", charset="utf-8", isBase64=False): +def dataURL(doc, mime_type="text/html", charset="utf-8", is_base64=False): encoding = "" if charset: encoding = f"charset={charset}" - elif isBase64: + elif is_base64: encoding = "base64" return f"data:{mime_type};{encoding},{quote(doc)}" diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/navigate.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/navigate.py index dedeeb98288..934fd3554f7 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/navigate.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigate/navigate.py @@ -18,7 +18,7 @@ async def test_payload(bidi_session, inline, new_tab): assert result["url"] == url -async def test_interactive_simultaneous_navigation(bidi_session, inline, new_tab): +async def test_interactive_simultaneous_navigation(bidi_session, wait_for_future_safe, inline, new_tab): frame1_start_url = inline("frame1") frame2_start_url = inline("frame2") @@ -61,7 +61,7 @@ async def test_interactive_simultaneous_navigation(bidi_session, inline, new_tab assert frame2_result["url"] == frame2_url # The "interactive" navigation should resolve before the 5 seconds timeout. - await asyncio.wait_for(frame1_task, timeout=5) + await wait_for_future_safe(frame1_task, timeout=5) frame1_result = frame1_task.result() assert frame1_result["url"] == frame1_url diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigation_started/navigation_started.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigation_started/navigation_started.py index 448f96e0f60..af91f0110aa 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigation_started/navigation_started.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/navigation_started/navigation_started.py @@ -1,5 +1,3 @@ -import asyncio - import pytest from tests.support.sync import AsyncPoll @@ -45,7 +43,7 @@ async def test_unsubscribe(bidi_session): async def test_subscribe( - bidi_session, subscribe_events, inline, new_tab, wait_for_event + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[NAVIGATION_STARTED_EVENT]) @@ -54,7 +52,7 @@ async def test_subscribe( result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info( event, @@ -67,7 +65,7 @@ async def test_subscribe( async def test_timestamp( - bidi_session, current_time, subscribe_events, inline, new_tab, wait_for_event + bidi_session, current_time, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[NAVIGATION_STARTED_EVENT]) @@ -78,7 +76,7 @@ async def test_timestamp( result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url ) - event = await on_entry + event = await wait_for_future_safe(on_entry) time_end = await current_time() @@ -214,12 +212,12 @@ async def test_nested_iframes( @pytest.mark.parametrize("type_hint", ["tab", "window"]) -async def test_new_context(bidi_session, subscribe_events, wait_for_event, type_hint): +async def test_new_context(bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, type_hint): await subscribe_events(events=[NAVIGATION_STARTED_EVENT]) on_entry = wait_for_event(NAVIGATION_STARTED_EVENT) top_level_context = await bidi_session.browsing_context.create(type_hint="tab") - navigation_info = await on_entry + navigation_info = await wait_for_future_safe(on_entry) assert_navigation_info( navigation_info, { @@ -253,7 +251,7 @@ async def test_same_document_navigation(bidi_session, new_tab, url, subscribe_ev remove_listener() -async def test_window_open(bidi_session, subscribe_events, wait_for_event, top_context): +async def test_window_open(bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, top_context): await subscribe_events(events=[NAVIGATION_STARTED_EVENT]) on_entry = wait_for_event(NAVIGATION_STARTED_EVENT) @@ -264,7 +262,7 @@ async def test_window_open(bidi_session, subscribe_events, wait_for_event, top_c await_promise=False, ) - navigation_info = await on_entry + navigation_info = await wait_for_future_safe(on_entry) assert_navigation_info( navigation_info, { @@ -305,7 +303,7 @@ async def test_document_write(bidi_session, subscribe_events, top_context): async def test_page_with_base_tag( - bidi_session, subscribe_events, inline, new_tab, wait_for_event + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[NAVIGATION_STARTED_EVENT]) @@ -314,7 +312,7 @@ async def test_page_with_base_tag( result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert_navigation_info( event, @@ -334,7 +332,7 @@ async def test_page_with_base_tag( ], ) async def test_invalid_navigation( - bidi_session, new_tab, subscribe_events, wait_for_event, url + bidi_session, new_tab, subscribe_events, wait_for_event, wait_for_future_safe, url ): await subscribe_events(events=[NAVIGATION_STARTED_EVENT]) @@ -345,7 +343,7 @@ async def test_invalid_navigation( context=new_tab["context"], url=url, wait="complete" ) - navigation_info = await on_entry + navigation_info = await wait_for_future_safe(on_entry) assert_navigation_info( navigation_info, { @@ -377,14 +375,14 @@ async def test_redirect_http_equiv( http_equiv_url = url(PAGE_REDIRECT_HTTP_EQUIV) redirected_url = url(PAGE_REDIRECTED_HTML) - result = await bidi_session.browsing_context.navigate( + await bidi_session.browsing_context.navigate( context=top_context["context"], url=http_equiv_url, wait="complete", ) - # Wait until we receive two events, one for the initial navigation and one for - # the http-equiv "redirect". + # Wait until we receive two events, one for the initial navigation and one + # for the http-equiv "redirect". wait = AsyncPoll(bidi_session, timeout=2) await wait.until(lambda _: len(events) >= 2) @@ -404,6 +402,8 @@ async def test_redirect_http_equiv( }, ) + remove_listener() + async def test_redirect_navigation( bidi_session, subscribe_events, top_context, url @@ -425,7 +425,7 @@ async def test_redirect_navigation( f"/webdriver/tests/support/http_handlers/redirect.py?location={html_url}" ) - result = await bidi_session.browsing_context.navigate( + await bidi_session.browsing_context.navigate( context=top_context["context"], url=redirect_url, wait="complete", @@ -440,9 +440,11 @@ async def test_redirect_navigation( }, ) + remove_listener() + async def test_navigate_history_pushstate( - bidi_session, inline, new_tab, subscribe_events, wait_for_event + bidi_session, inline, new_tab, subscribe_events, wait_for_event, wait_for_future_safe ): await subscribe_events([NAVIGATION_STARTED_EVENT]) @@ -456,6 +458,6 @@ async def test_navigate_history_pushstate( result = await bidi_session.browsing_context.navigate( context=new_tab["context"], url=url, wait="complete" ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert event["navigation"] == result["navigation"] diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/print/margin.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/print/margin.py index 0ceb68f4b09..1863cec1ca9 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/print/margin.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/print/margin.py @@ -173,8 +173,8 @@ async def test_margin_minimum_page_size( # Check that margins don't affect page dimensions and equal defaults. await assert_pdf_dimensions(value, { - "width": expected_width, - "height": expected_height, + "width": expected_width, + "height": expected_height, }) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/set_viewport/set_viewport.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/set_viewport/set_viewport.py index 1aa977be421..51203db1d61 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/set_viewport/set_viewport.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/set_viewport/set_viewport.py @@ -1,8 +1,8 @@ import pytest +from webdriver.bidi.undefined import UNDEFINED from ... import get_viewport_dimensions - @pytest.mark.asyncio async def test_set_viewport(bidi_session, new_tab): test_viewport = {"width": 250, "height": 300} @@ -44,14 +44,16 @@ async def test_set_viewport_reset(bidi_session, new_tab): assert await get_viewport_dimensions(bidi_session, new_tab) != test_viewport await bidi_session.browsing_context.set_viewport( - context=new_tab["context"], - viewport=test_viewport) + context=new_tab["context"], + viewport=test_viewport + ) assert await get_viewport_dimensions(bidi_session, new_tab) == test_viewport await bidi_session.browsing_context.set_viewport( - context=new_tab["context"], - viewport=None) + context=new_tab["context"], + viewport=None + ) assert await get_viewport_dimensions(bidi_session, new_tab) == original_viewport @@ -64,8 +66,9 @@ async def test_set_viewport_affects_specific_context(bidi_session, top_context, assert await get_viewport_dimensions(bidi_session, new_tab) != test_viewport await bidi_session.browsing_context.set_viewport( - context=new_tab["context"], - viewport=test_viewport) + context=new_tab["context"], + viewport=test_viewport + ) assert await get_viewport_dimensions(bidi_session, new_tab) == test_viewport assert await get_viewport_dimensions(bidi_session, top_context) == original_viewport @@ -124,3 +127,22 @@ async def test_set_viewport_persists_on_reload(bidi_session, new_tab): ) assert await get_viewport_dimensions(bidi_session, new_tab) == test_viewport + + +@pytest.mark.asyncio +async def test_set_viewport_undefined(bidi_session, new_tab): + test_viewport = {"width": 499, "height": 599} + + assert await get_viewport_dimensions(bidi_session, new_tab) != test_viewport + + await bidi_session.browsing_context.set_viewport( + context=new_tab["context"], + viewport=test_viewport) + + assert await get_viewport_dimensions(bidi_session, new_tab) == test_viewport + + await bidi_session.browsing_context.set_viewport( + context=new_tab["context"], + viewport=UNDEFINED) + + assert await get_viewport_dimensions(bidi_session, new_tab) == test_viewport diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_closed/user_prompt_closed.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_closed/user_prompt_closed.py index ffbdcec8597..d22363dd092 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_closed/user_prompt_closed.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_closed/user_prompt_closed.py @@ -1,4 +1,3 @@ -import asyncio import pytest from tests.support.sync import AsyncPoll from webdriver.error import TimeoutException @@ -9,7 +8,7 @@ USER_PROMPT_CLOSED_EVENT = "browsingContext.userPromptClosed" USER_PROMPT_OPENED_EVENT = "browsingContext.userPromptOpened" -async def test_unsubscribe(bidi_session, inline, new_tab, wait_for_event): +async def test_unsubscribe(bidi_session, inline, new_tab, wait_for_event, wait_for_future_safe): await bidi_session.session.subscribe( events=[USER_PROMPT_CLOSED_EVENT, USER_PROMPT_OPENED_EVENT] ) @@ -23,7 +22,7 @@ async def test_unsubscribe(bidi_session, inline, new_tab, wait_for_event): ) # Wait for the alert to open - await on_entry + await wait_for_future_safe(on_entry) # Track all received browsingContext.userPromptClosed events in the events array events = [] @@ -45,7 +44,7 @@ async def test_unsubscribe(bidi_session, inline, new_tab, wait_for_event): async def test_subscribe_with_alert( - bidi_session, subscribe_events, inline, new_tab, wait_for_event + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[USER_PROMPT_CLOSED_EVENT, USER_PROMPT_OPENED_EVENT]) @@ -57,20 +56,20 @@ async def test_subscribe_with_alert( ) # Wait for the prompt to open. - await on_prompt_opened + await wait_for_future_safe(on_prompt_opened) on_prompt_closed = wait_for_event(USER_PROMPT_CLOSED_EVENT) await bidi_session.browsing_context.handle_user_prompt(context=new_tab["context"]) - event = await on_prompt_closed + event = await wait_for_future_safe(on_prompt_closed) assert event == {"context": new_tab["context"], "accepted": True} @pytest.mark.parametrize("accept", [True, False]) async def test_subscribe_with_confirm( - bidi_session, subscribe_events, inline, new_tab, wait_for_event, accept + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe, accept ): await subscribe_events(events=[USER_PROMPT_CLOSED_EVENT, USER_PROMPT_OPENED_EVENT]) @@ -82,7 +81,7 @@ async def test_subscribe_with_confirm( ) # Wait for the prompt to open. - await on_prompt_opened + await wait_for_future_safe(on_prompt_opened) on_prompt_closed = wait_for_event(USER_PROMPT_CLOSED_EVENT) @@ -90,14 +89,14 @@ async def test_subscribe_with_confirm( context=new_tab["context"], accept=accept ) - event = await on_prompt_closed + event = await wait_for_future_safe(on_prompt_closed) assert event == {"context": new_tab["context"], "accepted": accept} @pytest.mark.parametrize("accept", [True, False]) async def test_subscribe_with_prompt( - bidi_session, subscribe_events, inline, new_tab, wait_for_event, accept + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe, accept ): await subscribe_events(events=[USER_PROMPT_CLOSED_EVENT, USER_PROMPT_OPENED_EVENT]) @@ -109,7 +108,7 @@ async def test_subscribe_with_prompt( ) # Wait for the prompt to open. - await on_prompt_opened + await wait_for_future_safe(on_prompt_opened) on_prompt_closed = wait_for_event(USER_PROMPT_CLOSED_EVENT) @@ -118,7 +117,7 @@ async def test_subscribe_with_prompt( context=new_tab["context"], accept=accept, user_text=test_user_text ) - event = await on_prompt_closed + event = await wait_for_future_safe(on_prompt_closed) if accept is True: assert event == { @@ -131,7 +130,7 @@ async def test_subscribe_with_prompt( async def test_subscribe_with_prompt_with_defaults( - bidi_session, subscribe_events, inline, new_tab, wait_for_event + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await subscribe_events(events=[USER_PROMPT_CLOSED_EVENT, USER_PROMPT_OPENED_EVENT]) @@ -143,7 +142,7 @@ async def test_subscribe_with_prompt_with_defaults( ) # Wait for the prompt to open. - await on_prompt_opened + await wait_for_future_safe(on_prompt_opened) on_prompt_closed = wait_for_event(USER_PROMPT_CLOSED_EVENT) @@ -151,14 +150,14 @@ async def test_subscribe_with_prompt_with_defaults( context=new_tab["context"] ) - event = await on_prompt_closed + event = await wait_for_future_safe(on_prompt_closed) assert event == {"context": new_tab["context"], "accepted": True} @pytest.mark.parametrize("type_hint", ["tab", "window"]) async def test_subscribe_to_one_context( - bidi_session, subscribe_events, inline, wait_for_event, type_hint + bidi_session, subscribe_events, inline, wait_for_event, wait_for_future_safe, type_hint ): new_context = await bidi_session.browsing_context.create(type_hint=type_hint) @@ -189,10 +188,10 @@ async def test_subscribe_to_one_context( # Open a prompt in the different context. await bidi_session.browsing_context.navigate( context=another_new_context["context"], - url=inline(f""), + url=inline(""), ) - await on_prompt_opened + await wait_for_future_safe(on_prompt_opened) await bidi_session.browsing_context.handle_user_prompt( context=another_new_context["context"] @@ -209,15 +208,15 @@ async def test_subscribe_to_one_context( # Open a prompt in the subscribed context. await bidi_session.browsing_context.navigate( context=new_context["context"], - url=inline(f""), + url=inline(""), ) - await on_prompt_opened + await wait_for_future_safe(on_prompt_opened) await bidi_session.browsing_context.handle_user_prompt( context=new_context["context"] ) - event = await on_prompt_closed + event = await wait_for_future_safe(s) assert event == { "context": new_context["context"], @@ -236,6 +235,7 @@ async def test_iframe( test_origin, subscribe_events, wait_for_event, + wait_for_future_safe, ): await subscribe_events(events=[USER_PROMPT_CLOSED_EVENT, USER_PROMPT_OPENED_EVENT]) @@ -259,12 +259,12 @@ async def test_iframe( url=inline(""), ) - await on_prompt_opened + await wait_for_future_safe(on_prompt_opened) await bidi_session.browsing_context.handle_user_prompt( context=frame["context"] ) - event = await on_prompt_closed + event = await wait_for_future_safe(on_prompt_closed) assert event == {"context": new_tab["context"], "accepted": True} diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_opened/user_prompt_opened.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_opened/user_prompt_opened.py index a2d5d840a49..fcd030116df 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_opened/user_prompt_opened.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/user_prompt_opened/user_prompt_opened.py @@ -35,7 +35,7 @@ async def test_unsubscribe(bidi_session, inline, new_tab): @pytest.mark.parametrize("prompt_type", ["alert", "confirm", "prompt"]) async def test_prompt_type( - bidi_session, subscribe_events, inline, new_tab, wait_for_event, prompt_type + bidi_session, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe, prompt_type ): await subscribe_events(events=[USER_PROMPT_OPENED_EVENT]) on_entry = wait_for_event(USER_PROMPT_OPENED_EVENT) @@ -47,7 +47,7 @@ async def test_prompt_type( url=inline(f""), ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert event == { "context": new_tab["context"], @@ -60,7 +60,7 @@ async def test_prompt_type( "default", [None, "", "default"], ids=["null", "empty string", "non empty string"] ) async def test_prompt_default_value( - bidi_session, inline, new_tab, subscribe_events, wait_for_event, default + bidi_session, inline, new_tab, subscribe_events, wait_for_event, wait_for_future_safe, default ): await subscribe_events(events=[USER_PROMPT_OPENED_EVENT]) on_entry = wait_for_event(USER_PROMPT_OPENED_EVENT) @@ -77,7 +77,7 @@ async def test_prompt_default_value( url=inline(script), ) - event = await on_entry + event = await wait_for_future_safe(on_entry) expected_event = { "context": new_tab["context"], @@ -93,7 +93,7 @@ async def test_prompt_default_value( @pytest.mark.parametrize("type_hint", ["tab", "window"]) async def test_subscribe_to_one_context( - bidi_session, subscribe_events, inline, wait_for_event, type_hint + bidi_session, subscribe_events, inline, wait_for_event, wait_for_future_safe, type_hint ): new_context = await bidi_session.browsing_context.create(type_hint=type_hint) await subscribe_events( @@ -132,7 +132,7 @@ async def test_subscribe_to_one_context( url=inline(""), ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert event == { "context": new_context["context"], @@ -152,6 +152,7 @@ async def test_iframe( test_origin, subscribe_events, wait_for_event, + wait_for_future_safe, ): await subscribe_events([USER_PROMPT_OPENED_EVENT]) on_entry = wait_for_event(USER_PROMPT_OPENED_EVENT) @@ -173,7 +174,7 @@ async def test_iframe( url=inline(""), ) - event = await on_entry + event = await wait_for_future_safe(on_entry) assert event == { "context": new_tab["context"], diff --git a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/__init__.py b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/__init__.py index 626dbad1476..26fbd423ea4 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/__init__.py +++ b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/__init__.py @@ -133,4 +133,4 @@ async def record_pointer_events(bidi_session, context, container, selector): await_promise=False, ) - return target \ No newline at end of file + return target diff --git a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/invalid.py b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/invalid.py index 631b3026c17..f1e8c3c441a 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/invalid.py +++ b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/invalid.py @@ -6,10 +6,8 @@ import pytest_asyncio from webdriver.bidi.modules.input import Actions from webdriver.bidi.error import InvalidArgumentException - pytestmark = pytest.mark.asyncio - MAX_INT = 9007199254740991 MIN_INT = -MAX_INT @@ -17,9 +15,8 @@ MIN_INT = -MAX_INT @pytest_asyncio.fixture async def perform_actions(bidi_session, top_context): async def perform_actions(actions, context=top_context["context"]): - return await bidi_session.input.perform_actions( - actions=actions, context=context - ) + return await bidi_session.input.perform_actions(actions=actions, + context=context) yield perform_actions @@ -99,24 +96,25 @@ async def test_params_context_invalid_type(perform_actions, value): @pytest.mark.parametrize("value", [None, "foo", True, 42, {}]) -async def test_params_input_source_actions_invalid_type(perform_actions, value): +async def test_params_input_source_actions_invalid_type( + perform_actions, value): with pytest.raises(InvalidArgumentException): await perform_actions(value) @pytest.mark.parametrize("value", [None, "foo", True, 42, {}]) -async def test_params_input_source_action_sequence_invalid_type(perform_actions, value): +async def test_params_input_source_action_sequence_invalid_type( + perform_actions, value): with pytest.raises(InvalidArgumentException): await perform_actions([value]) -async def test_params_input_source_action_sequence_type_missing(perform_actions): - actions = [ - { - "id": "foo", - "actions": [], - } - ] +async def test_params_input_source_action_sequence_type_missing( + perform_actions): + actions = [{ + "id": "foo", + "actions": [], + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -124,14 +122,11 @@ async def test_params_input_source_action_sequence_type_missing(perform_actions) @pytest.mark.parametrize("action_type", ["none", "key", "pointer", "wheel"]) async def test_params_input_source_action_sequence_id_missing( - perform_actions, action_type -): - actions = [ - { - "type": action_type, - "actions": [], - } - ] + perform_actions, action_type): + actions = [{ + "type": action_type, + "actions": [], + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -139,14 +134,11 @@ async def test_params_input_source_action_sequence_id_missing( @pytest.mark.parametrize("action_type", ["none", "key", "pointer", "wheel"]) async def test_params_input_source_action_sequence_actions_missing( - perform_actions, action_type -): - actions = [ - { - "type": action_type, - "id": "foo", - } - ] + perform_actions, action_type): + actions = [{ + "type": action_type, + "id": "foo", + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -154,31 +146,26 @@ async def test_params_input_source_action_sequence_actions_missing( @pytest.mark.parametrize("value", [None, True, 42, [], {}]) async def test_params_input_source_action_sequence_type_invalid_type( - perform_actions, value -): - actions = [ - { - "type": value, - "id": "foo", - "actions": [], - } - ] + perform_actions, value): + actions = [{ + "type": value, + "id": "foo", + "actions": [], + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) -@pytest.mark.parametrize("action_type", ["", "nones", "keys", "pointers", "wheels"]) +@pytest.mark.parametrize("action_type", + ["", "nones", "keys", "pointers", "wheels"]) async def test_params_input_source_action_sequence_type_invalid_value( - perform_actions, action_type -): - actions = [ - { - "type": action_type, - "id": "foo", - "actions": [], - } - ] + perform_actions, action_type): + actions = [{ + "type": action_type, + "id": "foo", + "actions": [], + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -187,15 +174,12 @@ async def test_params_input_source_action_sequence_type_invalid_value( @pytest.mark.parametrize("action_type", ["none", "key", "pointer", "wheel"]) @pytest.mark.parametrize("value", [None, True, 42, [], {}]) async def test_params_input_source_action_sequence_id_invalid_type( - perform_actions, action_type, value -): - actions = [ - { - "type": action_type, - "id": value, - "actions": [], - } - ] + perform_actions, action_type, value): + actions = [{ + "type": action_type, + "id": value, + "actions": [], + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -204,15 +188,12 @@ async def test_params_input_source_action_sequence_id_invalid_type( @pytest.mark.parametrize("action_type", ["none", "key", "pointer", "wheel"]) @pytest.mark.parametrize("value", [None, "foo", True, 42, {}]) async def test_params_input_source_action_sequence_actions_invalid_type( - perform_actions, action_type, value -): - actions = [ - { - "type": action_type, - "id": "foo", - "actions": value, - } - ] + perform_actions, action_type, value): + actions = [{ + "type": action_type, + "id": "foo", + "actions": value, + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -221,15 +202,12 @@ async def test_params_input_source_action_sequence_actions_invalid_type( @pytest.mark.parametrize("action_type", ["none", "key", "pointer", "wheel"]) @pytest.mark.parametrize("value", [None, "foo", True, 42, {}]) async def test_params_input_source_action_sequence_actions_actions_invalid_type( - perform_actions, action_type, value -): - actions = [ - { - "type": action_type, - "id": "foo", - "actions": [value], - } - ] + perform_actions, action_type, value): + actions = [{ + "type": action_type, + "id": "foo", + "actions": [value], + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -237,9 +215,13 @@ async def test_params_input_source_action_sequence_actions_actions_invalid_type( @pytest.mark.parametrize("value", [None, "foo", True, 42, []]) async def test_params_input_source_action_sequence_pointer_parameters_invalid_type( - perform_actions, value -): - actions = [{"type": "pointer", "id": "foo", "actions": [], "parameters": value}] + perform_actions, value): + actions = [{ + "type": "pointer", + "id": "foo", + "actions": [], + "parameters": value + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -247,18 +229,15 @@ async def test_params_input_source_action_sequence_pointer_parameters_invalid_ty @pytest.mark.parametrize("value", [None, True, 42, [], {}]) async def test_params_input_source_action_sequence_pointer_parameters_pointer_type_invalid_type( - perform_actions, value -): - actions = [ - { - "type": "pointer", - "id": "foo", - "actions": [], - "parameters": { - "pointerType": value, - }, - } - ] + perform_actions, value): + actions = [{ + "type": "pointer", + "id": "foo", + "actions": [], + "parameters": { + "pointerType": value, + }, + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -266,18 +245,15 @@ async def test_params_input_source_action_sequence_pointer_parameters_pointer_ty @pytest.mark.parametrize("value", ["", "mouses", "pens", "touchs"]) async def test_params_input_source_action_sequence_pointer_parameters_pointer_type_invalid_value( - perform_actions, value -): - actions = [ - { - "type": "pointer", - "id": "foo", - "actions": [], - "parameters": { - "pointerType": value, - }, - } - ] + perform_actions, value): + actions = [{ + "type": "pointer", + "id": "foo", + "actions": [], + "parameters": { + "pointerType": value, + }, + }] with pytest.raises(InvalidArgumentException): await perform_actions(actions) @@ -286,45 +262,57 @@ async def test_params_input_source_action_sequence_pointer_parameters_pointer_ty @pytest.mark.parametrize("action_type", ["none", "key", "pointer", "wheel"]) @pytest.mark.parametrize("value", [None, True, 42, [], {}]) async def test_params_input_source_action_sequence_actions_type_invalid_type( - perform_actions, action_type, value -): + perform_actions, action_type, value): action = {"type": value, "duration": 0} with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": action_type, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": action_type, + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("action_type", ["none", "key", "pointer", "wheel"]) @pytest.mark.parametrize("value", ["", "pauses"]) async def test_params_input_source_action_sequence_actions_subtype_invalid_value( - perform_actions, action_type, value -): + perform_actions, action_type, value): action = {"type": value, "duration": 0} with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": action_type, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": action_type, + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("action_type", ["none", "key", "pointer", "wheel"]) @pytest.mark.parametrize("value", [None, "foo", True, 0.1, [], {}]) async def test_params_input_source_action_sequence_actions_pause_duration_invalid_type( - perform_actions, action_type, value -): + perform_actions, action_type, value): action = {"type": "pause", "duration": value} with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": action_type, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": action_type, + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("action_type", ["none", "key", "pointer", "wheel"]) @pytest.mark.parametrize("value", [-1, MAX_INT + 1]) async def test_params_input_source_action_sequence_actions_pause_duration_invalid_value( - perform_actions, action_type, value -): + perform_actions, action_type, value): action = {"type": "pause", "duration": value} with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": action_type, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": action_type, + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("value", ["", "pauses"]) @@ -332,14 +320,22 @@ async def test_params_null_action_type_invalid_value(perform_actions, value): action = {"type": value, "duration": 0} with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "none", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "none", + "id": "foo", + "actions": [action] + }]) async def test_params_key_action_subtype_missing(perform_actions): action = create_key_action("keyDown", {"value": "f"}, removals=["type"]) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "key", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "key", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("value", ["", "keyDowns", "keyUps"]) @@ -347,7 +343,11 @@ async def test_params_key_action_subtype_invalid_value(perform_actions, value): action = create_key_action(value, {"value": "f"}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "key", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "key", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("key_action", ["keyDown", "keyUp"]) @@ -355,56 +355,80 @@ async def test_params_key_action_value_missing(perform_actions, key_action): action = create_key_action(key_action, {"value": "f"}, removals=["value"]) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "key", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "key", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("key_action", ["keyDown", "keyUp"]) @pytest.mark.parametrize("value", [None, True, 42, [], {}]) -async def test_params_key_action_value_invalid_type(perform_actions, key_action, value): +async def test_params_key_action_value_invalid_type(perform_actions, + key_action, value): action = create_key_action(key_action, {"value": value}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "key", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "key", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize( "value", ["fa", "\u0BA8\u0BBFb", "\u0BA8\u0BBF\u0BA8", "\u1100\u1161\u11A8c"], ) -async def test_params_key_action_value_invalid_multiple_codepoints(perform_actions, value): +async def test_params_key_action_value_invalid_multiple_codepoints( + perform_actions, value): actions = [ create_key_action("keyDown", {"value": value}), create_key_action("keyUp", {"value": value}), ] with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "key", "id": "foo", "actions": actions}]) + await perform_actions([{ + "type": "key", + "id": "foo", + "actions": actions + }]) -@pytest.mark.parametrize("value", ["", "pointerDowns", "pointerMoves", "pointerUps"]) -async def test_params_pointer_action_subtype_invalid_value(perform_actions, value): +@pytest.mark.parametrize("value", + ["", "pointerDowns", "pointerMoves", "pointerUps"]) +async def test_params_pointer_action_subtype_invalid_value( + perform_actions, value): if value == "pointerMoves": action = create_pointer_action(value, {"x": 0, "y": 0}) else: action = create_pointer_action(value, {"button": 0}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("coordinate", ["x", "y"]) -async def test_params_pointer_action_up_down_button_missing(perform_actions, coordinate): +async def test_params_pointer_action_move_coordinate_missing( + perform_actions, coordinate): action = create_pointer_action("pointerMove", removals=[coordinate]) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("coordinate", ["x", "y"]) @pytest.mark.parametrize("value", [None, "foo", True, 0.1, [], {}]) async def test_params_pointer_action_move_coordinate_invalid_type( - perform_actions, coordinate, value -): + perform_actions, coordinate, value): action = create_pointer_action( "pointerMove", { @@ -414,14 +438,17 @@ async def test_params_pointer_action_move_coordinate_invalid_type( ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("coordinate", ["x", "y"]) @pytest.mark.parametrize("value", [MIN_INT - 1, MAX_INT + 1]) async def test_params_pointer_action_move_coordinate_invalid_value( - perform_actions, coordinate, value -): + perform_actions, coordinate, value): action = create_pointer_action( "pointerMove", { @@ -431,61 +458,86 @@ async def test_params_pointer_action_move_coordinate_invalid_value( ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("value", [None, True, 42, [], {}]) -async def test_params_pointer_action_move_origin_invalid_type(perform_actions, value): +async def test_params_pointer_action_move_origin_invalid_type( + perform_actions, value): action = create_pointer_action("pointerMove", {"origin": value}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("value", ["", "pointers", "viewports"]) -async def test_params_pointer_action_move_origin_invalid_value(perform_actions, value): +async def test_params_pointer_action_move_origin_invalid_value( + perform_actions, value): action = create_pointer_action("pointerMove", {"origin": value}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("pointer_action", ["pointerDown", "pointerUp"]) -async def test_params_pointer_action_up_down_button_missing(perform_actions, pointer_action): +async def test_params_pointer_action_up_down_button_missing( + perform_actions, pointer_action): action = create_pointer_action(pointer_action, removals=["button"]) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("pointer_action", ["pointerDown", "pointerUp"]) @pytest.mark.parametrize("value", [None, "foo", True, 0.1, [], {}]) async def test_params_pointer_action_up_down_button_invalid_type( - perform_actions, pointer_action, value -): + perform_actions, pointer_action, value): action = create_pointer_action(pointer_action, {"button": value}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("pointer_action", ["pointerDown", "pointerUp"]) @pytest.mark.parametrize("value", [-1, MAX_INT + 1]) async def test_params_pointer_action_up_down_button_invalid_value( - perform_actions, pointer_action, value -): + perform_actions, pointer_action, value): action = create_pointer_action(pointer_action, {"button": value}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) -@pytest.mark.parametrize("pointer_action", ["pointerDown", "pointerMove", "pointerUp"]) +@pytest.mark.parametrize("pointer_action", + ["pointerDown", "pointerMove", "pointerUp"]) @pytest.mark.parametrize("dimension", ["width", "height"]) @pytest.mark.parametrize("value", [None, "foo", True, 0.1, [], {}]) async def test_params_pointer_action_common_properties_dimensions_invalid_type( - perform_actions, dimension, pointer_action, value -): + perform_actions, dimension, pointer_action, value): action = create_pointer_action( pointer_action, { @@ -495,15 +547,19 @@ async def test_params_pointer_action_common_properties_dimensions_invalid_type( ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("dimension", ["width", "height"]) -@pytest.mark.parametrize("pointer_action", ["pointerDown", "pointerMove", "pointerUp"]) +@pytest.mark.parametrize("pointer_action", + ["pointerDown", "pointerMove", "pointerUp"]) @pytest.mark.parametrize("value", [-1, MAX_INT + 1]) async def test_params_pointer_action_common_properties_dimensions_invalid_value( - perform_actions, dimension, pointer_action, value -): + perform_actions, dimension, pointer_action, value): action = create_pointer_action( pointer_action, { @@ -513,55 +569,73 @@ async def test_params_pointer_action_common_properties_dimensions_invalid_value( ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) -@pytest.mark.parametrize("pointer_action", ["pointerDown", "pointerMove", "pointerUp"]) +@pytest.mark.parametrize("pointer_action", + ["pointerDown", "pointerMove", "pointerUp"]) @pytest.mark.parametrize("pressure", ["pressure", "tangentialPressure"]) @pytest.mark.parametrize("value", [None, "foo", True, [], {}]) async def test_params_pointer_action_common_properties_pressure_invalid_type( - perform_actions, pointer_action, pressure, value -): + perform_actions, pointer_action, pressure, value): action = create_pointer_action( pointer_action, { - "pressure": value if pressure == "pressure" else 0.0, - "tangentialPressure": value if pressure == "tangentialPressure" else 0.0, + "pressure": + value if pressure == "pressure" else 0.0, + "tangentialPressure": + value if pressure == "tangentialPressure" else 0.0, }, ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) -@pytest.mark.parametrize("pointer_action", ["pointerDown", "pointerMove", "pointerUp"]) +@pytest.mark.parametrize("pointer_action", + ["pointerDown", "pointerMove", "pointerUp"]) @pytest.mark.parametrize("value", [None, "foo", True, 0.1, [], {}]) async def test_params_pointer_action_common_properties_twist_invalid_type( - perform_actions, pointer_action, value -): + perform_actions, pointer_action, value): action = create_pointer_action(pointer_action, {"twist": value}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) -@pytest.mark.parametrize("pointer_action", ["pointerDown", "pointerMove", "pointerUp"]) +@pytest.mark.parametrize("pointer_action", + ["pointerDown", "pointerMove", "pointerUp"]) @pytest.mark.parametrize("value", [-1, 360]) async def test_params_pointer_action_common_properties_twist_invalid_value( - perform_actions, pointer_action, value -): + perform_actions, pointer_action, value): action = create_pointer_action(pointer_action, {"twist": value}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) -@pytest.mark.parametrize("pointer_action", ["pointerDown", "pointerMove", "pointerUp"]) +@pytest.mark.parametrize("pointer_action", + ["pointerDown", "pointerMove", "pointerUp"]) @pytest.mark.parametrize("angle", ["altitudeAngle", "azimuthAngle"]) @pytest.mark.parametrize("value", [None, "foo", True, [], {}]) async def test_params_pointer_action_common_properties_angle_invalid_type( - perform_actions, pointer_action, angle, value -): + perform_actions, pointer_action, angle, value): action = create_pointer_action( pointer_action, { @@ -571,14 +645,17 @@ async def test_params_pointer_action_common_properties_angle_invalid_type( ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "pointer", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "pointer", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("coordinate", ["x", "y"]) @pytest.mark.parametrize("value", [None, "foo", True, 0.1, [], {}]) async def test_params_wheel_action_scroll_coordinate_invalid_type( - perform_actions, coordinate, value -): + perform_actions, coordinate, value): action = create_wheel_action( "scroll", { @@ -588,14 +665,17 @@ async def test_params_wheel_action_scroll_coordinate_invalid_type( ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "wheel", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "wheel", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("coordinate", ["x", "y"]) @pytest.mark.parametrize("value", [MIN_INT - 1, MAX_INT + 1]) async def test_params_wheel_action_scroll_coordinate_invalid_value( - perform_actions, coordinate, value -): + perform_actions, coordinate, value): action = create_wheel_action( "scroll", { @@ -605,14 +685,17 @@ async def test_params_wheel_action_scroll_coordinate_invalid_value( ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "wheel", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "wheel", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("delta", ["x", "y"]) @pytest.mark.parametrize("value", [None, "foo", True, 0.1, [], {}]) async def test_params_wheel_action_scroll_delta_invalid_type( - perform_actions, delta, value -): + perform_actions, delta, value): action = create_wheel_action( "scroll", { @@ -622,14 +705,17 @@ async def test_params_wheel_action_scroll_delta_invalid_type( ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "wheel", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "wheel", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("delta", ["x", "y"]) @pytest.mark.parametrize("value", [MIN_INT - 1, MAX_INT + 1]) async def test_params_wheel_action_scroll_delta_invalid_value( - perform_actions, delta, value -): + perform_actions, delta, value): action = create_wheel_action( "scroll", { @@ -639,49 +725,73 @@ async def test_params_wheel_action_scroll_delta_invalid_value( ) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "wheel", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "wheel", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("value", [None, True, 42, [], {}]) -async def test_params_wheel_action_scroll_origin_invalid_type(perform_actions, value): +async def test_params_wheel_action_scroll_origin_invalid_type( + perform_actions, value): action = create_wheel_action("scroll", {"origin": value}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "wheel", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "wheel", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("value", ["", "pointers", "viewports"]) -async def test_params_wheel_action_scroll_origin_invalid_value(perform_actions, value): +async def test_params_wheel_action_scroll_origin_invalid_value( + perform_actions, value): action = create_wheel_action("scroll", {"origin": value}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "wheel", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "wheel", + "id": "foo", + "actions": [action] + }]) -async def test_params_wheel_action_scroll_origin_pointer_not_supported(perform_actions): +async def test_params_wheel_action_scroll_origin_pointer_not_supported( + perform_actions): # Pointer origin isn't currently supported for wheel input source # See: https://github.com/w3c/webdriver/issues/1758 action = create_wheel_action("scroll", {"origin": "pointer"}) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "wheel", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "wheel", + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("missing", ["x", "y", "deltaX", "deltaY"]) -async def test_params_wheel_action_scroll_property_missing(perform_actions, missing): +async def test_params_wheel_action_scroll_property_missing( + perform_actions, missing): action = create_wheel_action("scroll", removals=[missing]) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": "wheel", "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": "wheel", + "id": "foo", + "actions": [action] + }]) # Element origin tests for pointer and wheel input sources + @pytest.mark.parametrize("input_source", ["pointer", "wheel"]) @pytest.mark.parametrize("value", [None, False, 42, [], {}]) -async def test_params_origin_element_type_invalid_type( - perform_actions, input_source, value -): +async def test_params_origin_element_type_invalid_type(perform_actions, + input_source, value): origin = {"origin": {"type": value}} if input_source == "pointer": @@ -690,13 +800,16 @@ async def test_params_origin_element_type_invalid_type( action = create_wheel_action("scroll", origin) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": input_source, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": input_source, + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("input_source", ["pointer", "wheel"]) -async def test_params_origin_element_element_missing( - perform_actions, input_source -): +async def test_params_origin_element_element_missing(perform_actions, + input_source): origin = {"origin": {"type": "element"}} if input_source == "pointer": @@ -705,14 +818,17 @@ async def test_params_origin_element_element_missing( action = create_wheel_action("scroll", origin) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": input_source, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": input_source, + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("input_source", ["pointer", "wheel"]) @pytest.mark.parametrize("value", [None, False, 42, "foo", []]) async def test_params_origin_element_element_invalid_type( - perform_actions, input_source, value -): + perform_actions, input_source, value): origin = {"origin": {"type": "element", "element": value}} if input_source == "pointer": @@ -721,13 +837,16 @@ async def test_params_origin_element_element_invalid_type( action = create_wheel_action("scroll", origin) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": input_source, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": input_source, + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("input_source", ["pointer", "wheel"]) async def test_params_origin_element_element_sharedid_missing( - perform_actions, input_source -): + perform_actions, input_source): origin = {"origin": {"type": "element", "element": {}}} if input_source == "pointer": @@ -736,14 +855,17 @@ async def test_params_origin_element_element_sharedid_missing( action = create_wheel_action("scroll", origin) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": input_source, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": input_source, + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("input_source", ["pointer", "wheel"]) @pytest.mark.parametrize("value", [None, False, 42, [], {}]) async def test_params_origin_element_element_sharedid_invalid_type( - perform_actions, input_source, value -): + perform_actions, input_source, value): origin = {"origin": {"type": "element", "element": {"sharedId": value}}} if input_source == "pointer": @@ -752,13 +874,17 @@ async def test_params_origin_element_element_sharedid_invalid_type( action = create_wheel_action("scroll", origin) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": input_source, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": input_source, + "id": "foo", + "actions": [action] + }]) @pytest.mark.parametrize("input_source", ["pointer", "wheel"]) async def test_params_origin_element_invalid_with_shared_reference( - bidi_session, top_context, get_actions_origin_page, get_element, perform_actions, input_source -): + bidi_session, top_context, get_actions_origin_page, get_element, + perform_actions, input_source): await bidi_session.browsing_context.navigate( context=top_context["context"], url=get_actions_origin_page(""), @@ -773,4 +899,8 @@ async def test_params_origin_element_invalid_with_shared_reference( action = create_wheel_action("scroll", origin) with pytest.raises(InvalidArgumentException): - await perform_actions([{"type": input_source, "id": "foo", "actions": [action]}]) + await perform_actions([{ + "type": input_source, + "id": "foo", + "actions": [action] + }]) diff --git a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse.py b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse.py index 73c80af2639..7077d7bba46 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse.py +++ b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse.py @@ -154,8 +154,8 @@ async def test_middle_click(bidi_session, top_context, load_static_test_page): assert len(events) == 3 expected = [ - {"type": "mousedown", "button": 1, "buttons": 4}, - {"type": "mouseup", "button": 1, "buttons": 0}, + {"type": "mousedown", "button": 1, "buttons": 4}, + {"type": "mouseup", "button": 1, "buttons": 0}, ] filtered_events = [filter_dict(e, expected[0]) for e in events] mousedown_mouseup_events = [ @@ -252,6 +252,7 @@ async def test_click_navigation( inline, subscribe_events, wait_for_event, + wait_for_future_safe, get_element, ): await subscribe_events(events=["browsingContext.load"]) @@ -281,7 +282,7 @@ async def test_click_navigation( on_entry = wait_for_event("browsingContext.load") await click_link() - event = await on_entry + event = await wait_for_future_safe(on_entry) assert event["url"] == destination diff --git a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse_modifier.py b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse_modifier.py index ea50951f378..a2d0ae70753 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse_modifier.py +++ b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse_modifier.py @@ -33,14 +33,14 @@ async def test_control_click( outer = await get_element("#outer") actions = Actions() - key_sources = ( + ( actions.add_key() .pause(duration=0) .key_down(modifier) .pause(duration=200) .key_up(modifier) ) - mouse_sources = ( + ( actions.add_pointer() .pointer_move(x=0, y=0, origin=get_element_origin(outer)) .pointer_down(button=0) @@ -98,8 +98,8 @@ async def test_control_click_release( ) actions = Actions() - key_sources = actions.add_key().pause(duration=0).key_down(Keys.CONTROL) - mouse_sources = ( + actions.add_key().pause(duration=0).key_down(Keys.CONTROL) + ( actions.add_pointer() .pointer_move(x=0, y=0, origin=get_element_origin(key_reporter)) .pointer_down(button=0) @@ -137,7 +137,7 @@ async def test_many_modifiers_click( dblclick_timeout = 800 actions = Actions() - key_sources = ( + ( actions.add_key() .pause(duration=0) .key_down(Keys.ALT) @@ -146,7 +146,7 @@ async def test_many_modifiers_click( .key_up(Keys.ALT) .key_up(Keys.SHIFT) ) - mouse_sources = ( + ( actions.add_pointer() .pointer_move(x=0, y=0, origin=get_element_origin(outer)) .pause(duration=0) @@ -203,7 +203,7 @@ async def test_modifier_click( outer = await get_element("#outer") actions = Actions() - key_sources = ( + ( actions.add_key() .pause(duration=200) .key_down(modifier) @@ -211,7 +211,7 @@ async def test_modifier_click( .pause(duration=0) .key_up(modifier) ) - mouse_sources = ( + ( actions.add_pointer() .pointer_move(x=0, y=0, origin=get_element_origin(outer)) .pause(duration=50) diff --git a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse_multiclick.py b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse_multiclick.py index f74650c2f3e..4f67f8fda94 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse_multiclick.py +++ b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_mouse_multiclick.py @@ -1,6 +1,6 @@ import pytest -from webdriver.bidi.modules.input import Actions, get_element_origin +from webdriver.bidi.modules.input import Actions from webdriver.bidi.modules.script import ContextTarget from tests.support.asserts import assert_move_to_coordinates diff --git a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_pen.py b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_pen.py index 5cdacbbb489..def4552d305 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_pen.py +++ b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_pen.py @@ -1,7 +1,6 @@ import pytest from webdriver.bidi.modules.input import Actions, get_element_origin -from webdriver.bidi.modules.script import ContextTarget from .. import get_events from . import ( diff --git a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_touch.py b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_touch.py index 3b91b934879..95aa62ceba9 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_touch.py +++ b/tests/wpt/tests/webdriver/tests/bidi/input/perform_actions/pointer_touch.py @@ -1,7 +1,6 @@ import pytest from webdriver.bidi.modules.input import Actions, get_element_origin -from webdriver.bidi.modules.script import ContextTarget from .. import get_events from . import ( @@ -137,7 +136,7 @@ async def test_touch_pointer_properties_angle_twist( await load_static_test_page(page="test_actions_pointer.html") pointerArea = await get_element("#pointerArea") - center = await get_inview_center_bidi( + await get_inview_center_bidi( bidi_session, context=top_context, element=pointerArea ) 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 e3ece1e2fb0..4f897479e23 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 @@ -118,20 +118,20 @@ async def test_scroll_shadow_tree( # Add a simplified event recorder to track events in the test ShadowRoot. scrollable = await bidi_session.script.call_function( - function_declaration="""shadowRoot => {{ + function_declaration="""shadowRoot => { window.wheelEvents = []; const scrollable = shadowRoot.querySelector("#scrollableShadowTree"); scrollable.addEventListener("wheel", - function(event) {{ - window.wheelEvents.push({{ + function(event) { + window.wheelEvents.push({ "deltaX": event.deltaX, "deltaY": event.deltaY, "target": event.target.id - }}); - }} + }); + } ); return scrollable; - }} + } """, arguments=[shadow_root], target=ContextTarget(top_context["context"]), diff --git a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/console.py b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/console.py index 9cfca9311b7..533dfd79501 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/console.py +++ b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/console.py @@ -24,14 +24,14 @@ from ... import any_string, int_interval ], ) async def test_text_with_argument_variation( - bidi_session, subscribe_events, top_context, wait_for_event, log_argument, expected_text, + bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe, log_argument, expected_text, ): await subscribe_events(events=["log.entryAdded"]) on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message_from_string( bidi_session, top_context, "log", log_argument) - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry(event_data, text=expected_text, context=top_context["context"]) @@ -51,7 +51,7 @@ async def test_text_with_argument_variation( ], ) async def test_level( - bidi_session, subscribe_events, top_context, wait_for_event, log_method, expected_level + bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe, log_method, expected_level ): await subscribe_events(events=["log.entryAdded"]) @@ -65,7 +65,7 @@ async def test_level( await create_console_api_message_from_string( bidi_session, top_context, log_method, "'foo'") - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry( event_data, text="foo", level=expected_level, method=log_method @@ -73,7 +73,7 @@ async def test_level( @pytest.mark.asyncio -async def test_timestamp(bidi_session, subscribe_events, top_context, wait_for_event, current_time): +async def test_timestamp(bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe, current_time): await subscribe_events(events=["log.entryAdded"]) on_entry_added = wait_for_event("log.entryAdded") @@ -93,7 +93,7 @@ async def test_timestamp(bidi_session, subscribe_events, top_context, wait_for_e target=ContextTarget(top_context["context"]), ) - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) time_end = await current_time() @@ -101,13 +101,13 @@ async def test_timestamp(bidi_session, subscribe_events, top_context, wait_for_e @pytest.mark.asyncio -async def test_new_context_with_new_window(bidi_session, subscribe_events, top_context, wait_for_event): +async def test_new_context_with_new_window(bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe): await subscribe_events(events=["log.entryAdded"]) on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message_from_string( bidi_session, top_context, 'log', "'foo'") - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry(event_data, text="foo", context=top_context["context"]) new_context = await bidi_session.browsing_context.create(type_hint="tab") @@ -115,18 +115,18 @@ async def test_new_context_with_new_window(bidi_session, subscribe_events, top_c on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message_from_string( bidi_session, new_context, 'log', "'foo_in_new_window'") - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry(event_data, text="foo_in_new_window", context=new_context["context"]) @pytest.mark.asyncio -async def test_new_context_with_refresh(bidi_session, subscribe_events, top_context, wait_for_event): +async def test_new_context_with_refresh(bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe): await subscribe_events(events=["log.entryAdded"]) on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message_from_string( bidi_session, top_context, 'log', "'foo'") - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry(event_data, text="foo", context=top_context["context"]) await bidi_session.browsing_context.navigate( @@ -135,7 +135,7 @@ async def test_new_context_with_refresh(bidi_session, subscribe_events, top_cont on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message_from_string( bidi_session, top_context, 'log', "'foo_after_refresh'") - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry( event_data, text="foo_after_refresh", context=top_context["context"] ) @@ -147,6 +147,7 @@ async def test_different_contexts( subscribe_events, top_context, wait_for_event, + wait_for_future_safe, test_page_same_origin_frame, ): await bidi_session.browsing_context.navigate( @@ -161,11 +162,11 @@ async def test_different_contexts( on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message_from_string( bidi_session, top_context, "log", "'foo'") - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry(event_data, text="foo", context=top_context["context"]) on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message_from_string( bidi_session, frame_context, "log", "'bar'") - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry(event_data, text="bar", context=frame_context["context"]) diff --git a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/console_args.py b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/console_args.py index 8e14c2663ed..ffb5183d831 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/console_args.py +++ b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/console_args.py @@ -30,14 +30,15 @@ pytestmark = pytest.mark.asyncio "bigint", ]) async def test_primitive_types( - bidi_session, subscribe_events, top_context, wait_for_event, data, remote_value + bidi_session, subscribe_events, top_context, wait_for_event, + wait_for_future_safe, data, remote_value ): await subscribe_events(events=["log.entryAdded"]) on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message_from_string( bidi_session, top_context, "log", f"'foo', {data}") - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) args = [ {"type": "string", "value": "foo"}, {"type": remote_value["type"]}, @@ -192,7 +193,8 @@ async def test_primitive_types( ], ) async def test_remote_values( - bidi_session, subscribe_events, top_context, wait_for_event, data, remote_value + bidi_session, subscribe_events, top_context, wait_for_event, + wait_for_future_safe, data, remote_value ): await subscribe_events(events=["log.entryAdded"]) @@ -200,7 +202,7 @@ async def test_remote_values( await create_console_api_message_from_string( bidi_session, top_context, "log", data ) - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) arg = {"type": remote_value["type"]} if "value" in remote_value: arg["value"] = remote_value["value"] @@ -255,7 +257,8 @@ async def test_remote_values( ids=["basic", "shadowRoot"], ) async def test_node( - bidi_session, subscribe_events, get_test_page, top_context, wait_for_event, data, expected + bidi_session, subscribe_events, get_test_page, top_context, wait_for_event, + wait_for_future_safe, data, expected ): await bidi_session.browsing_context.navigate( context=top_context["context"], url=get_test_page(), wait="complete" @@ -266,6 +269,6 @@ async def test_node( await create_console_api_message_from_string( bidi_session, top_context, "log", data ) - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry(event_data, args=expected) diff --git a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/event_buffer.py b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/event_buffer.py index f0ceeb966df..35b06a6b33a 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/event_buffer.py +++ b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/event_buffer.py @@ -6,7 +6,7 @@ from . import assert_base_entry, create_log @pytest.mark.asyncio @pytest.mark.parametrize("log_type", ["console_api_log", "javascript_error"]) async def test_console_log_cached_messages( - bidi_session, wait_for_event, log_type, new_tab + bidi_session, wait_for_event, wait_for_future_safe, log_type, new_tab ): # Clear events buffer. await bidi_session.session.subscribe(events=["log.entryAdded"]) @@ -40,7 +40,7 @@ async def test_console_log_cached_messages( on_entry_added = wait_for_event("log.entryAdded") expected_text = await create_log(bidi_session, new_tab, log_type, "live_message") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Check that we only received the live message. assert len(events) == 2 diff --git a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/javascript.py b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/javascript.py index e8afedf3c74..f16343cfb7e 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/javascript.py +++ b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/javascript.py @@ -6,7 +6,7 @@ from ... import int_interval @pytest.mark.asyncio async def test_types_and_values( - bidi_session, subscribe_events, current_time, top_context, wait_for_event + bidi_session, subscribe_events, current_time, top_context, wait_for_event, wait_for_future_safe ): await subscribe_events(events=["log.entryAdded"]) @@ -15,7 +15,7 @@ async def test_types_and_values( time_start = await current_time() expected_text = await create_log(bidi_session, top_context, "javascript_error", "cached_message") - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) time_end = await current_time() diff --git a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/realm.py b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/realm.py index 8761f931c4d..4df72ff6865 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/realm.py +++ b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/realm.py @@ -11,7 +11,7 @@ pytestmark = pytest.mark.asyncio ["", "sandbox_1"], ids=["default realm", "sandbox"], ) -async def test_realm(bidi_session, subscribe_events, top_context, wait_for_event, sandbox_name): +async def test_realm(bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe, sandbox_name): await subscribe_events(events=["log.entryAdded"]) on_entry_added = wait_for_event("log.entryAdded") @@ -22,7 +22,7 @@ async def test_realm(bidi_session, subscribe_events, top_context, wait_for_event await_promise=False, target=ContextTarget(top_context["context"], sandbox=sandbox_name), ) - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry( event_data, diff --git a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/stacktrace.py b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/stacktrace.py index 9d0db6d3527..f9aab697bd8 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/stacktrace.py +++ b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/stacktrace.py @@ -18,7 +18,7 @@ from . import assert_console_entry, assert_javascript_entry ], ) async def test_console_entry_sync_callstack( - bidi_session, subscribe_events, inline, top_context, wait_for_event, log_method, expect_stack + bidi_session, subscribe_events, inline, top_context, wait_for_event, wait_for_future_safe, log_method, expect_stack ): if log_method == "assert": # assert has to be called with a first falsy argument to trigger a log. @@ -59,7 +59,7 @@ async def test_console_entry_sync_callstack( context=top_context["context"], url=url, wait="complete" ) - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_console_entry( event_data, @@ -78,7 +78,7 @@ async def test_console_entry_sync_callstack( @pytest.mark.asyncio async def test_javascript_entry_sync_callstack( - bidi_session, subscribe_events, inline, top_context, wait_for_event + bidi_session, subscribe_events, inline, top_context, wait_for_event, wait_for_future_safe ): url = inline( """ @@ -104,7 +104,7 @@ async def test_javascript_entry_sync_callstack( context=top_context["context"], url=url, wait="complete" ) - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) assert_javascript_entry( event_data, diff --git a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/subscription.py b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/subscription.py index 4d604f6877e..1cb1bce38b1 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/subscription.py +++ b/tests/wpt/tests/webdriver/tests/bidi/log/entry_added/subscription.py @@ -7,7 +7,7 @@ from . import assert_base_entry, create_log @pytest.mark.asyncio @pytest.mark.parametrize("log_type", ["console_api_log", "javascript_error"]) -async def test_subscribe_twice(bidi_session, new_tab, wait_for_event, log_type): +async def test_subscribe_twice(bidi_session, new_tab, wait_for_event, wait_for_future_safe, log_type): # Subscribe to log.entryAdded twice and check that events are received once. await bidi_session.session.subscribe(events=["log.entryAdded"]) await bidi_session.session.subscribe(events=["log.entryAdded"]) @@ -23,7 +23,7 @@ async def test_subscribe_twice(bidi_session, new_tab, wait_for_event, log_type): # Check for a ConsoleLogEntry. on_entry_added = wait_for_event("log.entryAdded") expected_text = await create_log(bidi_session, new_tab, log_type, "text1") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 1 assert_base_entry(events[0], text=expected_text) @@ -37,13 +37,13 @@ async def test_subscribe_twice(bidi_session, new_tab, wait_for_event, log_type): @pytest.mark.asyncio @pytest.mark.parametrize("log_type", ["console_api_log", "javascript_error"]) -async def test_subscribe_unsubscribe(bidi_session, new_tab, wait_for_event, log_type): +async def test_subscribe_unsubscribe(bidi_session, new_tab, wait_for_event, wait_for_future_safe, log_type): # Subscribe for log events globally await bidi_session.session.subscribe(events=["log.entryAdded"]) on_entry_added = wait_for_event("log.entryAdded") await create_log(bidi_session, new_tab, log_type, "some text") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Unsubscribe from log events globally await bidi_session.session.unsubscribe(events=["log.entryAdded"]) @@ -90,7 +90,7 @@ async def test_subscribe_unsubscribe(bidi_session, new_tab, wait_for_event, log_ on_entry_added = wait_for_event("log.entryAdded") expected_text_2 = await create_log(bidi_session, new_tab, log_type, "text_2") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 3 assert_base_entry(events[0], text=expected_text_0, context=new_tab["context"]) @@ -102,7 +102,7 @@ async def test_subscribe_unsubscribe(bidi_session, new_tab, wait_for_event, log_ on_entry_added = wait_for_event("log.entryAdded") expected_text_3 = await create_log(bidi_session, new_context, log_type, "text_3") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 4 assert_base_entry(events[3], text=expected_text_3, context=new_context["context"]) diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/add_intercept.py b/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/add_intercept.py index fad04816b9e..8134d391189 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/add_intercept.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/add_intercept.py @@ -103,6 +103,7 @@ async def test_two_intercepts( add_intercept, fetch, setup_network_test, + wait_for_future_safe, ): await setup_network_test( events=[ @@ -127,7 +128,7 @@ async def test_two_intercepts( # Perform a request to PAGE_EMPTY_TEXT, which should match both intercepts on_network_event = wait_for_event("network.beforeRequestSent") asyncio.ensure_future(fetch(text_url)) - event = await on_network_event + event = await wait_for_future_safe(on_network_event) assert_before_request_sent_event( event, is_blocked=True, intercepts=[string_intercept, global_intercept] @@ -138,7 +139,7 @@ async def test_two_intercepts( on_network_event = wait_for_event("network.beforeRequestSent") asyncio.ensure_future(fetch(other_url)) - event = await on_network_event + event = await wait_for_future_safe(on_network_event) assert_before_request_sent_event( event, is_blocked=True, intercepts=[global_intercept] @@ -153,7 +154,7 @@ async def test_two_intercepts( # intercept. on_network_event = wait_for_event("network.beforeRequestSent") asyncio.ensure_future(fetch(text_url)) - event = await on_network_event + event = await wait_for_future_safe(on_network_event) assert_before_request_sent_event( event, is_blocked=True, intercepts=[string_intercept] diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/phase_auth_required.py b/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/phase_auth_required.py index fb539bf0a14..84b7d281322 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/phase_auth_required.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/phase_auth_required.py @@ -1,7 +1,4 @@ -import asyncio - import pytest -from webdriver.bidi.modules.script import ScriptEvaluateResultException from .. import ( assert_before_request_sent_event, @@ -19,6 +16,7 @@ async def test_basic_authentication( bidi_session, new_tab, wait_for_event, + wait_for_future_safe, url, setup_network_test, add_intercept, @@ -51,7 +49,7 @@ async def test_basic_authentication( wait="none", ) - await on_auth_required + await wait_for_future_safe(on_auth_required) expected_request = {"method": "GET", "url": auth_url} assert len(before_request_sent_events) == 1 @@ -80,12 +78,12 @@ async def test_basic_authentication( async def test_no_authentication( - bidi_session, wait_for_event, url, setup_network_test, add_intercept, fetch, + wait_for_future_safe, ): network_events = await setup_network_test( events=[ @@ -111,7 +109,7 @@ async def test_no_authentication( on_network_event = wait_for_event("network.responseCompleted") await fetch(text_url) - await on_network_event + await wait_for_future_safe(on_network_event) expected_request = {"method": "GET", "url": text_url} diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/phases.py b/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/phases.py index c6fba726c6d..787c5d16c4c 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/phases.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/phases.py @@ -1,5 +1,3 @@ -import asyncio - import pytest from webdriver.bidi.modules.script import ScriptEvaluateResultException @@ -28,6 +26,7 @@ async def test_request_response_phases( setup_network_test, add_intercept, fetch, + wait_for_future_safe, phases, intercepted_phase, ): @@ -57,7 +56,7 @@ async def test_request_response_phases( with pytest.raises(ScriptEvaluateResultException): await fetch(text_url) - await on_network_event + await wait_for_future_safe(on_network_event) expected_request = {"method": "GET", "url": text_url} if intercepted_phase == "beforeRequestSent": diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/url_patterns.py b/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/url_patterns.py index be44709d7f5..4c8e7720ae8 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/url_patterns.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/add_intercept/url_patterns.py @@ -63,10 +63,11 @@ async def test_pattern_patterns_matching( add_intercept, fetch, substitute_host, + wait_for_future_safe, patterns, url_template, ): - await subscribe_events(events=["network.beforeRequestSent"], contexts=[top_context["context"]]) + await subscribe_events(events=["network.beforeRequestSent"], contexts=[top_context["context"]]) for pattern in patterns: for key in pattern: @@ -78,7 +79,7 @@ async def test_pattern_patterns_matching( on_network_event = wait_for_event("network.beforeRequestSent") asyncio.ensure_future(fetch(substitute_host(url_template))) - event = await on_network_event + event = await wait_for_future_safe(on_network_event) assert_before_request_sent_event(event, is_blocked=True, intercepts=[intercept]) @@ -109,10 +110,11 @@ async def test_pattern_patterns_not_matching( add_intercept, fetch, substitute_host, + wait_for_future_safe, pattern, url_template, ): - await subscribe_events(events=["network.beforeRequestSent"], contexts=[top_context["context"]]) + await subscribe_events(events=["network.beforeRequestSent"], contexts=[top_context["context"]]) for key in pattern: pattern[key] = substitute_host(pattern[key]) @@ -123,7 +125,7 @@ async def test_pattern_patterns_not_matching( on_network_event = wait_for_event("network.beforeRequestSent") asyncio.ensure_future(fetch(substitute_host(url_template))) - event = await on_network_event + event = await wait_for_future_safe(on_network_event) assert_before_request_sent_event(event, is_blocked=False) @@ -158,10 +160,11 @@ async def test_string_patterns_matching( add_intercept, fetch, substitute_host, + wait_for_future_safe, pattern, url_template, ): - await subscribe_events(events=["network.beforeRequestSent"], contexts=[top_context["context"]]) + await subscribe_events(events=["network.beforeRequestSent"], contexts=[top_context["context"]]) intercept = await add_intercept( phases=["beforeRequestSent"], @@ -170,7 +173,7 @@ async def test_string_patterns_matching( on_network_event = wait_for_event("network.beforeRequestSent") asyncio.ensure_future(fetch(substitute_host(url_template))) - event = await on_network_event + event = await wait_for_future_safe(on_network_event) assert_before_request_sent_event(event, is_blocked=True, intercepts=[intercept]) @@ -199,10 +202,11 @@ async def test_string_patterns_not_matching( add_intercept, fetch, substitute_host, + wait_for_future_safe, pattern, url_template, ): - await subscribe_events(events=["network.beforeRequestSent"], contexts=[top_context["context"]]) + await subscribe_events(events=["network.beforeRequestSent"], contexts=[top_context["context"]]) await add_intercept( phases=["beforeRequestSent"], @@ -211,6 +215,6 @@ async def test_string_patterns_not_matching( on_network_event = wait_for_event("network.beforeRequestSent") asyncio.ensure_future(fetch(substitute_host(url_template))) - event = await on_network_event + event = await wait_for_future_safe(on_network_event) assert_before_request_sent_event(event, is_blocked=False) diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/auth_required/auth_required.py b/tests/wpt/tests/webdriver/tests/bidi/network/auth_required/auth_required.py index c785334cdce..7a0d53f40ec 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/auth_required/auth_required.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/auth_required/auth_required.py @@ -2,8 +2,6 @@ import asyncio import pytest -from tests.support.sync import AsyncPoll - from .. import assert_response_event PAGE_EMPTY_HTML = "/webdriver/tests/bidi/network/support/empty.html" @@ -13,7 +11,7 @@ AUTH_REQUIRED_EVENT = "network.authRequired" @pytest.mark.asyncio async def test_subscribe_status( - bidi_session, new_tab, subscribe_events, wait_for_event, url + bidi_session, new_tab, subscribe_events, wait_for_event, wait_for_future_safe, url ): await subscribe_events(events=[AUTH_REQUIRED_EVENT]) @@ -39,7 +37,7 @@ async def test_subscribe_status( wait="none", ) - await on_auth_required + await wait_for_future_safe(on_auth_required) assert len(events) == 1 expected_request = {"method": "GET", "url": auth_url} diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/before_request_sent/before_request_sent.py b/tests/wpt/tests/webdriver/tests/bidi/network/before_request_sent/before_request_sent.py index 38ca2c31af5..766a27672bc 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/before_request_sent/before_request_sent.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/before_request_sent/before_request_sent.py @@ -17,7 +17,7 @@ PAGE_REDIRECTED_HTML = "/webdriver/tests/bidi/network/support/redirected.html" @pytest.mark.asyncio -async def test_subscribe_status(bidi_session, subscribe_events, top_context, wait_for_event, url, fetch): +async def test_subscribe_status(bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe, url, fetch): await subscribe_events(events=["network.beforeRequestSent"]) await bidi_session.browsing_context.navigate( @@ -39,7 +39,7 @@ async def test_subscribe_status(bidi_session, subscribe_events, top_context, wai text_url = url(PAGE_EMPTY_TEXT) on_before_request_sent = wait_for_event("network.beforeRequestSent") await fetch(text_url) - await on_before_request_sent + await wait_for_future_safe(on_before_request_sent) assert len(events) == 1 expected_request = {"method": "GET", "url": text_url} @@ -62,7 +62,7 @@ async def test_subscribe_status(bidi_session, subscribe_events, top_context, wai @pytest.mark.asyncio async def test_load_page_twice( - bidi_session, top_context, wait_for_event, url, setup_network_test + bidi_session, top_context, wait_for_event, url, setup_network_test, wait_for_future_safe ): html_url = url(PAGE_EMPTY_HTML) @@ -75,7 +75,7 @@ async def test_load_page_twice( url=html_url, wait="complete", ) - await on_before_request_sent + await wait_for_future_safe(on_before_request_sent) assert len(events) == 1 expected_request = {"method": "GET", "url": html_url} @@ -88,7 +88,7 @@ async def test_load_page_twice( @pytest.mark.asyncio async def test_navigation_id( - bidi_session, top_context, wait_for_event, url, fetch, setup_network_test + bidi_session, top_context, wait_for_event, url, fetch, setup_network_test, wait_for_future_safe ): html_url = url(PAGE_EMPTY_HTML) @@ -101,7 +101,7 @@ async def test_navigation_id( url=html_url, wait="complete", ) - await on_before_request_sent + await wait_for_future_safe(on_before_request_sent) assert len(events) == 1 expected_request = {"method": "GET", "url": html_url} @@ -113,7 +113,7 @@ async def test_navigation_id( text_url = url(PAGE_EMPTY_TEXT) on_before_request_sent = wait_for_event("network.beforeRequestSent") await fetch(text_url, method="GET") - await on_before_request_sent + await wait_for_future_safe(on_before_request_sent) assert len(events) == 2 expected_request = {"method": "GET", "url": text_url} @@ -139,7 +139,7 @@ async def test_navigation_id( ) @pytest.mark.asyncio async def test_request_method( - bidi_session, wait_for_event, url, fetch, setup_network_test, method + wait_for_event, wait_for_future_safe, url, fetch, setup_network_test, method ): text_url = url(PAGE_EMPTY_TEXT) @@ -148,7 +148,7 @@ async def test_request_method( on_before_request_sent = wait_for_event("network.beforeRequestSent") await fetch(text_url, method=method) - await on_before_request_sent + await wait_for_future_safe(on_before_request_sent) assert len(events) == 1 expected_request = {"method": method, "url": text_url} @@ -161,7 +161,7 @@ async def test_request_method( @pytest.mark.asyncio async def test_request_headers( - bidi_session, wait_for_event, url, fetch, setup_network_test + wait_for_event, wait_for_future_safe, url, fetch, setup_network_test ): text_url = url(PAGE_EMPTY_TEXT) @@ -170,7 +170,7 @@ async def test_request_headers( on_before_request_sent = wait_for_event("network.beforeRequestSent") await fetch(text_url, method="GET", headers={"foo": "bar"}) - await on_before_request_sent + await wait_for_future_safe(on_before_request_sent) assert len(events) == 1 expected_request = { @@ -187,7 +187,7 @@ async def test_request_headers( @pytest.mark.asyncio async def test_request_cookies( - bidi_session, top_context, wait_for_event, url, fetch, setup_network_test + bidi_session, top_context, wait_for_event, wait_for_future_safe, url, fetch, setup_network_test ): text_url = url(PAGE_EMPTY_TEXT) @@ -202,7 +202,7 @@ async def test_request_cookies( on_before_request_sent = wait_for_event("network.beforeRequestSent") await fetch(text_url, method="GET") - await on_before_request_sent + await wait_for_future_safe(on_before_request_sent) assert len(events) == 1 expected_request = { @@ -224,7 +224,7 @@ async def test_request_cookies( on_before_request_sent = wait_for_event("network.beforeRequestSent") await fetch(text_url, method="GET") - await on_before_request_sent + await wait_for_future_safe(on_before_request_sent) assert len(events) == 2 diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/combined/network_events.py b/tests/wpt/tests/webdriver/tests/bidi/network/combined/network_events.py index 9eb79dd4231..1a71dc2cdf4 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/combined/network_events.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/combined/network_events.py @@ -13,7 +13,7 @@ PAGE_EMPTY_TEXT = "/webdriver/tests/bidi/network/support/empty.txt" @pytest.mark.asyncio async def test_same_navigation_id( - bidi_session, top_context, wait_for_event, url, setup_network_test + bidi_session, top_context, wait_for_event, wait_for_future_safe, url, setup_network_test ): network_events = await setup_network_test( events=[ @@ -31,7 +31,7 @@ async def test_same_navigation_id( url=html_url, wait="complete", ) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(network_events["network.beforeRequestSent"]) == 1 assert len(network_events["network.responseStarted"]) == 1 @@ -59,7 +59,7 @@ async def test_same_navigation_id( @pytest.mark.asyncio -async def test_same_request_id(wait_for_event, url, setup_network_test, fetch): +async def test_same_request_id(wait_for_event, wait_for_future_safe, url, setup_network_test, fetch): network_events = await setup_network_test( events=[ "network.beforeRequestSent", @@ -74,7 +74,7 @@ async def test_same_request_id(wait_for_event, url, setup_network_test, fetch): text_url = url(PAGE_EMPTY_TEXT) on_response_completed = wait_for_event("network.responseCompleted") await fetch(text_url) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(before_request_sent_events) == 1 assert len(response_started_events) == 1 @@ -97,19 +97,17 @@ async def test_same_request_id(wait_for_event, url, setup_network_test, fetch): ) assert ( - before_request_sent_events[0]["request"]["request"] - == response_started_events[0]["request"]["request"] + before_request_sent_events[0]["request"]["request"] == response_started_events[0]["request"]["request"] ) assert ( - before_request_sent_events[0]["request"]["request"] - == response_completed_events[0]["request"]["request"] + before_request_sent_events[0]["request"]["request"] == response_completed_events[0]["request"]["request"] ) @pytest.mark.asyncio async def test_subscribe_to_one_context( - bidi_session, top_context, wait_for_event, url, fetch, setup_network_test + bidi_session, top_context, wait_for_event, wait_for_future_safe, url, fetch, setup_network_test ): other_context = await bidi_session.browsing_context.create(type_hint="tab") await bidi_session.browsing_context.navigate( @@ -131,7 +129,7 @@ async def test_subscribe_to_one_context( text_url = url(PAGE_EMPTY_TEXT) on_response_completed = wait_for_event("network.responseCompleted") await fetch(text_url, context=top_context) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(network_events["network.beforeRequestSent"]) == 1 assert len(network_events["network.responseStarted"]) == 1 diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/conftest.py b/tests/wpt/tests/webdriver/tests/bidi/network/conftest.py index 9f74cc67cc6..668ffacc989 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/conftest.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/conftest.py @@ -17,6 +17,7 @@ async def add_intercept(bidi_session): ensure the intercept is removed at the end of the test.""" intercepts = [] + async def add_intercept(phases, url_patterns): nonlocal intercepts intercept = await bidi_session.network.add_intercept( @@ -76,7 +77,7 @@ def fetch(bidi_session, top_context, configuration): @pytest_asyncio.fixture async def setup_network_test( - bidi_session, subscribe_events, wait_for_event, top_context, url + bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, top_context, url ): """Navigate the current top level context to the provided url and subscribe to network.beforeRequestSent. @@ -102,7 +103,7 @@ async def setup_network_test( url=test_url, wait="complete", ) - await on_response_completed + await wait_for_future_safe(on_response_completed) await bidi_session.session.unsubscribe( events=[RESPONSE_COMPLETED_EVENT], contexts=[top_context["context"]] ) diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/fail_request/invalid.py b/tests/wpt/tests/webdriver/tests/bidi/network/fail_request/invalid.py index 29b653c0923..afbb44bd325 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/fail_request/invalid.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/fail_request/invalid.py @@ -19,7 +19,8 @@ async def test_params_request_invalid_value(bidi_session, value): async def test_params_request_no_such_request(bidi_session, setup_network_test, - wait_for_event, fetch, url): + wait_for_event, wait_for_future_safe, + fetch, url): await setup_network_test(events=[ "network.responseCompleted", ]) @@ -28,7 +29,7 @@ async def test_params_request_no_such_request(bidi_session, setup_network_test, text_url = url(PAGE_EMPTY_TEXT) await fetch(text_url) - response_completed_event = await on_response_completed + response_completed_event = await wait_for_future_safe(on_response_completed) request = response_completed_event["request"]["request"] with pytest.raises(error.NoSuchRequestException): diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/remove_intercept/remove_intercept.py b/tests/wpt/tests/webdriver/tests/bidi/network/remove_intercept/remove_intercept.py index 527fb47636b..3f205c38210 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/remove_intercept/remove_intercept.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/remove_intercept/remove_intercept.py @@ -1,7 +1,6 @@ # META: timeout=long import pytest -from webdriver.bidi.modules.script import ScriptEvaluateResultException from .. import ( assert_before_request_sent_event, @@ -19,7 +18,7 @@ PAGE_OTHER_TEXT = "/webdriver/tests/bidi/network/support/other.txt" "responseStarted", ]) async def test_remove_intercept( - bidi_session, wait_for_event, url, setup_network_test, add_intercept, fetch, top_context, wait_for_future_safe, phase + bidi_session, wait_for_event, url, setup_network_test, add_intercept, subscribe_events, top_context, wait_for_future_safe, phase ): network_events = await setup_network_test( events=[ @@ -40,10 +39,18 @@ async def test_remove_intercept( on_network_event = wait_for_event(f"network.{phase}") - # Request to top_context should be blocked and throw a ScriptEvaluateResultException - # from the AbortController. - with pytest.raises(ScriptEvaluateResultException): - await fetch(text_url) + await subscribe_events(events=["browsingContext.load"], contexts=[top_context["context"]]) + + browsing_context_load_events = [] + + async def on_browsing_context_load_event(method, data): + browsing_context_load_events.append(data) + + remove_listener = bidi_session.add_event_listener("browsingContext.load", on_browsing_context_load_event) + + # Request to top_context should be blocked. + # TODO(https://github.com/w3c/webdriver-bidi/issues/188): Use a timeout argument when available. + await bidi_session.browsing_context.navigate(context=top_context["context"], url=text_url, wait="complete") await wait_for_future_safe(on_network_event) @@ -72,7 +79,7 @@ async def test_remove_intercept( # The next request should not be blocked on_response_completed = wait_for_event("network.responseCompleted") await bidi_session.browsing_context.navigate(context=top_context["context"], url=text_url, wait="complete") - await on_response_completed + await wait_for_future_safe(on_response_completed) # Assert the network events have the expected interception properties assert len(before_request_sent_events) == 2 @@ -88,6 +95,9 @@ async def test_remove_intercept( assert len(response_completed_events) == 1 assert_response_event(response_completed_events[0], is_blocked=False) + assert len(browsing_context_load_events) == 0 + remove_listener() + @pytest.mark.asyncio async def test_return_value(bidi_session, add_intercept): diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed.py b/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed.py index 4518200fd31..513bfc31f74 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed.py @@ -17,7 +17,7 @@ RESPONSE_COMPLETED_EVENT = "network.responseCompleted" @pytest.mark.asyncio -async def test_subscribe_status(bidi_session, subscribe_events, top_context, wait_for_event, url, fetch): +async def test_subscribe_status(bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe, url, fetch): await subscribe_events(events=[RESPONSE_COMPLETED_EVENT]) # Track all received network.responseCompleted events in the events array @@ -37,7 +37,7 @@ async def test_subscribe_status(bidi_session, subscribe_events, top_context, wai url=html_url, wait="complete", ) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 1 expected_request = {"method": "GET", "url": html_url} @@ -58,7 +58,7 @@ async def test_subscribe_status(bidi_session, subscribe_events, top_context, wai text_url = url(PAGE_EMPTY_TEXT) on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT) await fetch(text_url) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 2 expected_request = {"method": "GET", "url": text_url} @@ -89,7 +89,7 @@ async def test_subscribe_status(bidi_session, subscribe_events, top_context, wai @pytest.mark.asyncio async def test_load_page_twice( - bidi_session, top_context, wait_for_event, url, setup_network_test + bidi_session, top_context, wait_for_event, wait_for_future_safe, url, setup_network_test ): html_url = url(PAGE_EMPTY_HTML) @@ -102,7 +102,7 @@ async def test_load_page_twice( url=html_url, wait="complete", ) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 1 expected_request = {"method": "GET", "url": html_url} @@ -129,7 +129,7 @@ async def test_load_page_twice( ) @pytest.mark.asyncio async def test_response_status( - wait_for_event, url, fetch, setup_network_test, status, status_text + wait_for_event, wait_for_future_safe, url, fetch, setup_network_test, status, status_text ): status_url = url( f"/webdriver/tests/support/http_handlers/status.py?status={status}&nocache={RESPONSE_COMPLETED_EVENT}" @@ -140,7 +140,7 @@ async def test_response_status( on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT) await fetch(status_url) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 1 expected_request = {"method": "GET", "url": status_url} @@ -161,7 +161,7 @@ async def test_response_status( @pytest.mark.asyncio -async def test_response_headers(wait_for_event, url, fetch, setup_network_test): +async def test_response_headers(wait_for_event, wait_for_future_safe, url, fetch, setup_network_test): headers_url = url( "/webdriver/tests/support/http_handlers/headers.py?header=foo:bar&header=baz:biz" ) @@ -171,7 +171,7 @@ async def test_response_headers(wait_for_event, url, fetch, setup_network_test): on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT) await fetch(headers_url, method="GET") - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 1 @@ -208,14 +208,14 @@ async def test_response_headers(wait_for_event, url, fetch, setup_network_test): ) @pytest.mark.asyncio async def test_response_mime_type_file( - url, wait_for_event, fetch, setup_network_test, page_url, mime_type + url, wait_for_event, wait_for_future_safe, fetch, setup_network_test, page_url, mime_type ): network_events = await setup_network_test(events=[RESPONSE_COMPLETED_EVENT]) events = network_events[RESPONSE_COMPLETED_EVENT] on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT) await fetch(url(page_url), method="GET") - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 1 diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed_cached.py b/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed_cached.py index ea1366cb967..1b6f79f0356 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed_cached.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed_cached.py @@ -11,6 +11,7 @@ PAGE_EMPTY_TEXT = "/webdriver/tests/bidi/network/support/empty.txt" @pytest.mark.asyncio async def test_cached( wait_for_event, + wait_for_future_safe, url, fetch, setup_network_test, @@ -27,7 +28,7 @@ async def test_cached( ) on_response_completed = wait_for_event("network.responseCompleted") await fetch(cached_url) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 1 expected_request = {"method": "GET", "url": cached_url} @@ -47,7 +48,7 @@ async def test_cached( on_response_completed = wait_for_event("network.responseCompleted") await fetch(cached_url) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 2 @@ -140,7 +141,7 @@ async def test_cached_redirect( @pytest.mark.asyncio async def test_cached_revalidate( - bidi_session, wait_for_event, url, fetch, setup_network_test + wait_for_event, wait_for_future_safe, url, fetch, setup_network_test ): network_events = await setup_network_test( events=[ @@ -154,7 +155,7 @@ async def test_cached_revalidate( ) on_response_completed = wait_for_event("network.responseCompleted") await fetch(revalidate_url) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 1 expected_request = {"method": "GET", "url": revalidate_url} @@ -174,7 +175,7 @@ async def test_cached_revalidate( # Note that we pass a specific header so that the must-revalidate.py handler # can decide to return a 304 without having to use another URL. await fetch(revalidate_url, headers={"return-304": "true"}) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 2 diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed_status.py b/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed_status.py index c3e4761bbee..7d9e0865764 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed_status.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/response_completed/response_completed_status.py @@ -22,7 +22,7 @@ RESPONSE_COMPLETED_EVENT = "network.responseCompleted" ) @pytest.mark.asyncio async def test_response_status( - wait_for_event, url, fetch, setup_network_test, status, status_text + wait_for_event, wait_for_future_safe, url, fetch, setup_network_test, status, status_text ): status_url = url( f"/webdriver/tests/support/http_handlers/status.py?status={status}&nocache={RESPONSE_COMPLETED_EVENT}" @@ -33,7 +33,7 @@ async def test_response_status( on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT) await fetch(status_url) - await on_response_completed + await wait_for_future_safe(on_response_completed) assert len(events) == 1 expected_request = {"method": "GET", "url": status_url} diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/response_started/response_started.py b/tests/wpt/tests/webdriver/tests/bidi/network/response_started/response_started.py index 41f4853fa1d..4025be429b9 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/response_started/response_started.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/response_started/response_started.py @@ -16,7 +16,7 @@ RESPONSE_STARTED_EVENT = "network.responseStarted" @pytest.mark.asyncio -async def test_subscribe_status(bidi_session, subscribe_events, top_context, wait_for_event, url, fetch): +async def test_subscribe_status(bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe, url, fetch): await subscribe_events(events=[RESPONSE_STARTED_EVENT]) await bidi_session.browsing_context.navigate( @@ -36,7 +36,7 @@ async def test_subscribe_status(bidi_session, subscribe_events, top_context, wai text_url = url(PAGE_EMPTY_TEXT) on_response_started = wait_for_event(RESPONSE_STARTED_EVENT) await fetch(text_url) - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 1 expected_request = {"method": "GET", "url": text_url} @@ -67,7 +67,7 @@ async def test_subscribe_status(bidi_session, subscribe_events, top_context, wai @pytest.mark.asyncio async def test_load_page_twice( - bidi_session, top_context, wait_for_event, url, setup_network_test + bidi_session, top_context, wait_for_event, wait_for_future_safe, url, setup_network_test ): html_url = url(PAGE_EMPTY_HTML) @@ -80,7 +80,7 @@ async def test_load_page_twice( url=html_url, wait="complete", ) - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 1 expected_request = {"method": "GET", "url": html_url} @@ -107,7 +107,7 @@ async def test_load_page_twice( ) @pytest.mark.asyncio async def test_response_status( - wait_for_event, url, fetch, setup_network_test, status, status_text + wait_for_event, wait_for_future_safe, url, fetch, setup_network_test, status, status_text ): status_url = url( f"/webdriver/tests/support/http_handlers/status.py?status={status}&nocache={RESPONSE_STARTED_EVENT}" @@ -118,7 +118,7 @@ async def test_response_status( on_response_started = wait_for_event(RESPONSE_STARTED_EVENT) await fetch(status_url) - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 1 expected_request = {"method": "GET", "url": status_url} @@ -139,7 +139,7 @@ async def test_response_status( @pytest.mark.asyncio -async def test_response_headers(wait_for_event, url, fetch, setup_network_test): +async def test_response_headers(wait_for_event, wait_for_future_safe, url, fetch, setup_network_test): headers_url = url( "/webdriver/tests/support/http_handlers/headers.py?header=foo:bar&header=baz:biz" ) @@ -149,7 +149,7 @@ async def test_response_headers(wait_for_event, url, fetch, setup_network_test): on_response_started = wait_for_event(RESPONSE_STARTED_EVENT) await fetch(headers_url, method="GET") - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 1 @@ -186,14 +186,14 @@ async def test_response_headers(wait_for_event, url, fetch, setup_network_test): ) @pytest.mark.asyncio async def test_response_mime_type_file( - url, wait_for_event, fetch, setup_network_test, page_url, mime_type + url, wait_for_event, wait_for_future_safe, fetch, setup_network_test, page_url, mime_type ): network_events = await setup_network_test(events=[RESPONSE_STARTED_EVENT]) events = network_events[RESPONSE_STARTED_EVENT] on_response_started = wait_for_event(RESPONSE_STARTED_EVENT) await fetch(url(page_url), method="GET") - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 1 @@ -209,10 +209,10 @@ async def test_response_mime_type_file( @pytest.mark.asyncio async def test_www_authenticate( - bidi_session, url, fetch, new_tab, wait_for_event, setup_network_test + bidi_session, url, fetch, new_tab, wait_for_event, wait_for_future_safe, setup_network_test ): auth_url = url( - f"/webdriver/tests/support/http_handlers/authentication.py?realm=testrealm" + "/webdriver/tests/support/http_handlers/authentication.py?realm=testrealm" ) network_events = await setup_network_test(events=[RESPONSE_STARTED_EVENT]) @@ -225,7 +225,7 @@ async def test_www_authenticate( # authentication prompt on test teardown. asyncio.ensure_future(fetch(auth_url, context=new_tab, method="GET")) - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 1 diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/response_started/response_started_cached.py b/tests/wpt/tests/webdriver/tests/bidi/network/response_started/response_started_cached.py index 6e0a7431c6b..64907a7d484 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/response_started/response_started_cached.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/response_started/response_started_cached.py @@ -11,6 +11,7 @@ PAGE_EMPTY_TEXT = "/webdriver/tests/bidi/network/support/empty.txt" @pytest.mark.asyncio async def test_cached( wait_for_event, + wait_for_future_safe, url, fetch, setup_network_test, @@ -27,7 +28,7 @@ async def test_cached( ) on_response_started = wait_for_event("network.responseStarted") await fetch(cached_url) - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 1 expected_request = {"method": "GET", "url": cached_url} @@ -47,7 +48,7 @@ async def test_cached( on_response_started = wait_for_event("network.responseStarted") await fetch(cached_url) - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 2 @@ -148,7 +149,7 @@ async def test_cached_redirect( ) @pytest.mark.asyncio async def test_cached_revalidate( - wait_for_event, url, fetch, setup_network_test, method + wait_for_event, wait_for_future_safe, url, fetch, setup_network_test, method ): network_events = await setup_network_test( events=[ @@ -162,7 +163,7 @@ async def test_cached_revalidate( ) on_response_started = wait_for_event("network.responseStarted") await fetch(revalidate_url, method=method) - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 1 expected_request = {"method": method, "url": revalidate_url} @@ -182,7 +183,7 @@ async def test_cached_revalidate( # Note that we pass a specific header so that the must-revalidate.py handler # can decide to return a 304 without having to use another URL. await fetch(revalidate_url, method=method, headers={"return-304": "true"}) - await on_response_started + await wait_for_future_safe(on_response_started) assert len(events) == 2 diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/add_preload_script/add_preload_script.py b/tests/wpt/tests/webdriver/tests/bidi/script/add_preload_script/add_preload_script.py index 98c01554ee0..cf5e77fac44 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/add_preload_script/add_preload_script.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/add_preload_script/add_preload_script.py @@ -125,10 +125,10 @@ async def test_add_preload_script_in_iframe( @pytest.mark.asyncio async def test_add_preload_script_with_error( - bidi_session, add_preload_script, subscribe_events, inline, new_tab, wait_for_event + bidi_session, add_preload_script, subscribe_events, inline, new_tab, wait_for_event, wait_for_future_safe ): await add_preload_script( - function_declaration=f"() => {{ throw Error('error in preload script') }}" + function_declaration="() => {{ throw Error('error in preload script') }}" ) await subscribe_events(events=["browsingContext.load", "log.entryAdded"]) @@ -138,10 +138,10 @@ async def test_add_preload_script_with_error( url = inline("
foo
") await bidi_session.browsing_context.navigate(context=new_tab["context"], url=url) - error_event = await on_entry + error_event = await wait_for_future_safe(on_entry) # Make sure that page is loaded - await on_load + await wait_for_future_safe(on_load) # Make sure that exception from preloaded script was reported assert error_event["level"] == "error" diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/add_preload_script/arguments.py b/tests/wpt/tests/webdriver/tests/bidi/script/add_preload_script/arguments.py index 81f90368279..32f50b69918 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/add_preload_script/arguments.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/add_preload_script/arguments.py @@ -64,6 +64,7 @@ async def test_channel( bidi_session, subscribe_events, wait_for_event, + wait_for_future_safe, add_preload_script, channel, expected_data, @@ -77,7 +78,7 @@ async def test_channel( ) new_tab = await bidi_session.browsing_context.create(type_hint="tab") - event_data = await on_script_message + event_data = await wait_for_future_safe(on_script_message) recursive_compare( { @@ -93,7 +94,7 @@ async def test_channel( async def test_channel_with_multiple_arguments( - bidi_session, subscribe_events, wait_for_event, add_preload_script + bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, add_preload_script ): await subscribe_events(["script.message"]) @@ -104,7 +105,7 @@ async def test_channel_with_multiple_arguments( ) new_tab = await bidi_session.browsing_context.create(type_hint="tab") - event_data = await on_script_message + event_data = await wait_for_future_safe(on_script_message) recursive_compare( { @@ -123,6 +124,7 @@ async def test_mutation_observer( bidi_session, subscribe_events, wait_for_event, + wait_for_future_safe, new_tab, inline, add_preload_script, @@ -157,7 +159,7 @@ async def test_mutation_observer( target=ContextTarget(new_tab["context"]), ) - event_data = await on_script_message + event_data = await wait_for_future_safe(on_script_message) recursive_compare( { diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/arguments.py b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/arguments.py index b1b188187ba..6d824befedc 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/arguments.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/arguments.py @@ -10,12 +10,10 @@ async def test_default_arguments(bidi_session, top_context): result = await bidi_session.script.call_function( function_declaration="(...args) => args", await_promise=False, - target=ContextTarget(top_context["context"])) + target=ContextTarget(top_context["context"]), + ) - recursive_compare({ - "type": "array", - "value": [] - }, result) + recursive_compare({"type": "array", "value": []}, result) @pytest.mark.asyncio @@ -44,44 +42,44 @@ async def test_primitive_value(bidi_session, top_context, argument, expected): @pytest.mark.parametrize( "argument, expected_type", [ - ({ - "type": "array", - "value": [ - {"type": "string", "value": "foobar"}, - ], - }, - "Array" - ), - ({"type": "date", "value": "2022-05-31T13:47:29.000Z"}, - "Date" - ), - ({ - "type": "map", - "value": [ - ["foobar", {"type": "string", "value": "foobar"}], - ], - }, - "Map" - ), - ({ - "type": "object", - "value": [ - ["foobar", {"type": "string", "value": "foobar"}], - ], - }, - "Object" - ), - ({"type": "regexp", "value": {"pattern": "foo", "flags": "g"}}, - "RegExp" - ), - ({ - "type": "set", - "value": [ - {"type": "string", "value": "foobar"}, - ], - }, - "Set" - ) + ( + { + "type": "array", + "value": [ + {"type": "string", "value": "foobar"}, + ], + }, + "Array", + ), + ({"type": "date", "value": "2022-05-31T13:47:29.000Z"}, "Date"), + ( + { + "type": "map", + "value": [ + ["foobar", {"type": "string", "value": "foobar"}], + ], + }, + "Map", + ), + ( + { + "type": "object", + "value": [ + ["foobar", {"type": "string", "value": "foobar"}], + ], + }, + "Object", + ), + ({"type": "regexp", "value": {"pattern": "foo", "flags": "g"}}, "RegExp"), + ( + { + "type": "set", + "value": [ + {"type": "string", "value": "foobar"}, + ], + }, + "Set", + ), ], ) async def test_local_value(bidi_session, top_context, argument, expected_type): diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/await_promise.py b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/await_promise.py index 1711b0be62d..70ca469c118 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/await_promise.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/await_promise.py @@ -1,8 +1,7 @@ import pytest -from webdriver.bidi.modules.script import ContextTarget, ScriptEvaluateResultException - from ... import recursive_compare +from webdriver.bidi.modules.script import ContextTarget @pytest.mark.asyncio diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/channel.py b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/channel.py index 730f16a13aa..5bd92a4bfbe 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/channel.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/channel.py @@ -61,7 +61,7 @@ from ... import any_string, recursive_compare ids=["default", "with serializationOptions", "with ownership"], ) async def test_channel( - bidi_session, top_context, subscribe_events, wait_for_event, channel, expected_data + bidi_session, top_context, subscribe_events, wait_for_event, wait_for_future_safe, channel, expected_data ): await subscribe_events(["script.message"]) @@ -73,7 +73,7 @@ async def test_channel( await_promise=False, target=ContextTarget(top_context["context"]), ) - event_data = await on_script_message + event_data = await wait_for_future_safe(on_script_message) recursive_compare( { @@ -90,7 +90,7 @@ async def test_channel( @pytest.mark.asyncio async def test_channel_with_multiple_arguments( - bidi_session, top_context, subscribe_events, wait_for_event + bidi_session, top_context, subscribe_events, wait_for_event, wait_for_future_safe ): await subscribe_events(["script.message"]) @@ -103,7 +103,7 @@ async def test_channel_with_multiple_arguments( target=ContextTarget(top_context["context"]), ) - event_data = await on_script_message + event_data = await wait_for_future_safe(on_script_message) recursive_compare( { @@ -184,6 +184,7 @@ async def test_channel_and_nonchannel_arguments( bidi_session, top_context, wait_for_event, + wait_for_future_safe, subscribe_events, ): await subscribe_events(["script.message"]) @@ -201,7 +202,7 @@ async def test_channel_and_nonchannel_arguments( await_promise=False, target=ContextTarget(top_context["context"]), ) - event_data = await on_script_message + event_data = await wait_for_future_safe(on_script_message) recursive_compare( { diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/remote_values.py b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/remote_values.py index eda31bb4bee..ae8e55d7746 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/remote_values.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/remote_values.py @@ -39,3 +39,134 @@ async def test_remote_value_promise(bidi_session, top_context, await_promise): assert result == {"type": "number", "value": 42} else: assert result == {"type": "promise"} + + +@pytest.mark.asyncio +@pytest.mark.parametrize("await_promise", [True, False]) +async def test_window_context_top_level(bidi_session, top_context, + await_promise): + function_declaration = "() => window" + if await_promise: + function_declaration = "async" + function_declaration + + result = await bidi_session.script.call_function( + function_declaration=function_declaration, + await_promise=await_promise, + target=ContextTarget(top_context["context"]), + ) + + recursive_compare( + { + "type": "window", + "value": { + "context": top_context["context"] + } + }, result) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("await_promise", [True, False]) +async def test_window_context_iframe_window(bidi_session, top_context, + test_page_same_origin_frame, + await_promise): + + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=test_page_same_origin_frame, + wait="complete", + ) + + all_contexts = await bidi_session.browsing_context.get_tree() + iframe_context = all_contexts[0]["children"][0] + + function_declaration = "() => window" + if await_promise: + function_declaration = "async" + function_declaration + + result = await bidi_session.script.call_function( + function_declaration=function_declaration, + await_promise=await_promise, + target=ContextTarget(iframe_context["context"]), + ) + + recursive_compare( + { + "type": "window", + "value": { + "context": iframe_context["context"] + } + }, result) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("await_promise", [True, False]) +async def test_window_context_iframe_content_window( + bidi_session, top_context, test_page_same_origin_frame, await_promise): + + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=test_page_same_origin_frame, + wait="complete", + ) + + all_contexts = await bidi_session.browsing_context.get_tree() + iframe_context = all_contexts[0]["children"][0] + + # This is equivalent to `document.getElementsByTagName("iframe")[0].contentWindow` + function_declaration = "() => window.frames[0]" + if await_promise: + function_declaration = "async" + function_declaration + + result = await bidi_session.script.call_function( + function_declaration=function_declaration, + await_promise=await_promise, + target=ContextTarget(top_context["context"]), + ) + + recursive_compare( + { + "type": "window", + "value": { + "context": iframe_context["context"] + } + }, result) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("await_promise", [True, False]) +@pytest.mark.parametrize("domain", ["", "alt"], + ids=["same_origin", "cross_origin"]) +async def test_window_context_same_id_after_navigation(bidi_session, + top_context, inline, + await_promise, domain): + + defaultOrigin = inline(f"{domain}") + await bidi_session.browsing_context.navigate( + context=top_context["context"], url=defaultOrigin, wait="complete") + + url = inline(f"{domain}", domain=domain) + + function_declaration = "() => window" + if await_promise: + function_declaration = "async" + function_declaration + + result = await bidi_session.script.call_function( + function_declaration=function_declaration, + await_promise=await_promise, + target=ContextTarget(top_context["context"]), + ) + + original_context_id = result['value']['context'] + + await bidi_session.browsing_context.navigate( + context=top_context["context"], url=url, wait="complete") + + result = await bidi_session.script.call_function( + function_declaration=function_declaration, + await_promise=await_promise, + target=ContextTarget(top_context["context"]), + ) + + navigated_context_id = result['value']['context'] + + assert navigated_context_id == original_context_id diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/this.py b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/this.py index c4f7bf06223..2893bb037ac 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/this.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/this.py @@ -89,7 +89,7 @@ async def test_remote_value_deserialization( @pytest.mark.asyncio @pytest.mark.parametrize( "channel, expected_data", - [ + [ ( {"type": "channel", "value": {"channel": "channel_name"}}, {"type": "object", "value": [["foo", {"type": "string", "value": "bar"}]]}, @@ -121,7 +121,8 @@ async def test_remote_value_deserialization( ids=["default", "with serializationOptions", "with ownership"], ) async def test_channel( - bidi_session, top_context, subscribe_events, wait_for_event, channel, expected_data + bidi_session, top_context, subscribe_events, wait_for_event, + wait_for_future_safe, channel, expected_data ): await subscribe_events(["script.message"]) @@ -133,7 +134,7 @@ async def test_channel( target=ContextTarget(top_context["context"]), this=channel, ) - event_data = await on_entry_added + event_data = await wait_for_future_safe(on_entry_added) recursive_compare( { diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/user_activation.py b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/user_activation.py index 786fb43954f..3c1b039981d 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/user_activation.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/user_activation.py @@ -7,37 +7,36 @@ from webdriver.bidi.modules.script import ContextTarget @pytest.mark.parametrize("user_activation", [True, False]) async def test_userActivation(bidi_session, top_context, user_activation): # Consume any previously set activation. - await bidi_session.script.evaluate( - expression="""window.open();""", - target=ContextTarget(top_context["context"]), - await_promise=False) + await bidi_session.script.evaluate(expression="""window.open();""", + target=ContextTarget( + top_context["context"]), + await_promise=False) result = await bidi_session.script.call_function( - function_declaration="() => navigator.userActivation.isActive && navigator.userActivation.hasBeenActive", + function_declaration= + "() => navigator.userActivation.isActive && navigator.userActivation.hasBeenActive", target=ContextTarget(top_context["context"]), await_promise=True, user_activation=user_activation) - assert result == { - "type": "boolean", - "value": user_activation} + assert result == {"type": "boolean", "value": user_activation} @pytest.mark.asyncio @pytest.mark.parametrize("user_activation", [True, False]) async def test_userActivation_copy(bidi_session, top_context, user_activation): # Consume any previously set activation. - await bidi_session.script.evaluate( - expression="""window.open();""", - target=ContextTarget(top_context["context"]), - await_promise=False) + await bidi_session.script.evaluate(expression="""window.open();""", + target=ContextTarget( + top_context["context"]), + await_promise=False) result = await bidi_session.script.call_function( - function_declaration="() => document.body.appendChild(document.createTextNode('test')) && document.execCommand('selectAll') && document.execCommand('copy')", + function_declaration= + "() => document.body.appendChild(document.createTextNode('test')) && " + + "document.execCommand('selectAll') && document.execCommand('copy')", target=ContextTarget(top_context["context"]), await_promise=True, user_activation=user_activation) - assert result == { - "type": "boolean", - "value": user_activation} + assert result == {"type": "boolean", "value": user_activation} diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/classic_interop/window_reference.py b/tests/wpt/tests/webdriver/tests/bidi/script/classic_interop/window_reference.py index ef0b12c6814..1588303be01 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/classic_interop/window_reference.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/classic_interop/window_reference.py @@ -26,7 +26,7 @@ async def test_web_window_reference_created_in_classic( assert window.id == contexts[1]["context"] result = await bidi_session.script.evaluate( - expression=f"window.foo", + expression="window.foo", target=ContextTarget(window.id), await_promise=False, ) @@ -54,7 +54,7 @@ async def test_web_frame_reference_created_in_classic( assert frame.id == contexts[1]["children"][0]["context"] result = await bidi_session.script.evaluate( - expression=f"window.bar", + expression="window.bar", target=ContextTarget(frame.id), await_promise=False, ) diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/disown/invalid_tentative.py b/tests/wpt/tests/webdriver/tests/bidi/script/disown/invalid_tentative.py index 730e2f575f9..5078166dfde 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/disown/invalid_tentative.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/disown/invalid_tentative.py @@ -19,13 +19,16 @@ async def test_params_target_invalid_value(bidi_session, top_context): with pytest.raises(error.InvalidArgumentException): await bidi_session.script.disown( handles=[], - target={"context": top_context["context"], "realm": result["realm"]}, + target={ + "context": top_context["context"], + "realm": result["realm"] + }, ) with pytest.raises(error.InvalidArgumentException): await bidi_session.script.disown( handles=[], - target={"sandbox": "foo", "realm": result["realm"]}, + target={"sandbox": "foo", "realm": result["realm"]}, ) with pytest.raises(error.InvalidArgumentException): diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/remote_values.py b/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/remote_values.py index 9e6a16a59c2..d62f09e5df9 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/remote_values.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/remote_values.py @@ -15,3 +15,124 @@ async def test_remote_values(bidi_session, top_context, expression, expected): ) recursive_compare(expected, result) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("await_promise", [True, False]) +async def test_window_context_top_level(bidi_session, top_context, await_promise): + result = await bidi_session.script.evaluate( + expression="window", + target=ContextTarget(top_context["context"]), + await_promise=await_promise, + serialization_options=SerializationOptions(max_object_depth=1), + ) + + recursive_compare( + { + "type": "window", + "value": { + "context": top_context["context"] + } + }, result) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("await_promise", [True, False]) +async def test_window_context_iframe_window( + bidi_session, top_context, test_page_same_origin_frame, await_promise): + + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=test_page_same_origin_frame, + wait="complete", + ) + + all_contexts = await bidi_session.browsing_context.get_tree() + iframe_context = all_contexts[0]["children"][0] + + result = await bidi_session.script.evaluate( + expression="window", + target=ContextTarget(iframe_context["context"]), + await_promise=await_promise, + serialization_options=SerializationOptions(max_object_depth=1), + ) + + recursive_compare( + { + "type": "window", + "value": { + "context": iframe_context["context"] + } + }, result) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("await_promise", [True, False]) +async def test_window_context_iframe_content_window( + bidi_session, top_context, test_page_same_origin_frame, await_promise): + + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=test_page_same_origin_frame, + wait="complete", + ) + + all_contexts = await bidi_session.browsing_context.get_tree() + iframe_context = all_contexts[0]["children"][0] + + # This is equivalent to `document.getElementsByTagName("iframe")[0].conten + result = await bidi_session.script.evaluate( + expression="window.frames[0]", + target=ContextTarget(top_context["context"]), + await_promise=await_promise, + ) + + recursive_compare( + { + "type": "window", + "value": { + "context": iframe_context["context"] + } + }, result) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("domain", ["", "alt"], + ids=["same_origin", "cross_origin"]) +@pytest.mark.parametrize("await_promise", [True, False]) +async def test_window_context_same_id_after_navigation(bidi_session, + top_context, + inline, + domain, + await_promise): + + defaultOrigin = inline(f"{domain}") + await bidi_session.browsing_context.navigate( + context=top_context["context"], url=defaultOrigin, wait="complete") + + url = inline(f"{domain}", domain=domain) + + result = await bidi_session.script.evaluate( + expression="window", + target=ContextTarget(top_context["context"]), + await_promise=await_promise, + serialization_options=SerializationOptions(max_object_depth=1), + ) + + original_context = result['value']['context'] + + await bidi_session.browsing_context.navigate( + context=top_context["context"], + url=url, + wait="complete") + + result = await bidi_session.script.evaluate( + expression="window", + target=ContextTarget(top_context["context"]), + await_promise=await_promise, + serialization_options=SerializationOptions(max_object_depth=1), + ) + + navigated_context_id = result['value']['context'] + + assert navigated_context_id == original_context diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/user_activation.py b/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/user_activation.py index 4ca558435d7..cc1f27985e3 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/user_activation.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/user_activation.py @@ -7,37 +7,35 @@ from webdriver.bidi.modules.script import ContextTarget @pytest.mark.parametrize("user_activation", [True, False]) async def test_userActivation(bidi_session, top_context, user_activation): # Consume any previously set activation. - await bidi_session.script.evaluate( - expression="""window.open();""", - target=ContextTarget(top_context["context"]), - await_promise=False) + await bidi_session.script.evaluate(expression="""window.open();""", + target=ContextTarget( + top_context["context"]), + await_promise=False) result = await bidi_session.script.evaluate( - expression="navigator.userActivation.isActive && navigator.userActivation.hasBeenActive", + expression= + "navigator.userActivation.isActive && navigator.userActivation.hasBeenActive", target=ContextTarget(top_context["context"]), await_promise=True, user_activation=user_activation) - assert result == { - "type": "boolean", - "value": user_activation} + assert result == {"type": "boolean", "value": user_activation} @pytest.mark.asyncio @pytest.mark.parametrize("user_activation", [True, False]) async def test_userActivation_copy(bidi_session, top_context, user_activation): # Consume any previously set activation. - await bidi_session.script.evaluate( - expression="""window.open();""", - target=ContextTarget(top_context["context"]), - await_promise=False) + await bidi_session.script.evaluate(expression="""window.open();""", + target=ContextTarget( + top_context["context"]), + await_promise=False) result = await bidi_session.script.evaluate( - expression="document.body.appendChild(document.createTextNode('test')) && document.execCommand('selectAll') && document.execCommand('copy')", + expression= + "document.body.appendChild(document.createTextNode('test')) && document.execCommand('selectAll') && document.execCommand('copy')", target=ContextTarget(top_context["context"]), await_promise=True, user_activation=user_activation) - assert result == { - "type": "boolean", - "value": user_activation} + assert result == {"type": "boolean", "value": user_activation} diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/message/message.py b/tests/wpt/tests/webdriver/tests/bidi/script/message/message.py index 4270dcc292d..bd5c9a111f5 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/message/message.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/message/message.py @@ -34,7 +34,7 @@ async def test_unsubscribe(bidi_session, top_context): remove_listener() -async def test_subscribe(bidi_session, subscribe_events, top_context, wait_for_event): +async def test_subscribe(bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe): await subscribe_events(events=[MESSAGE_EVENT]) on_script_message = wait_for_event(MESSAGE_EVENT) @@ -45,7 +45,7 @@ async def test_subscribe(bidi_session, subscribe_events, top_context, wait_for_e await_promise=False, target=ContextTarget(top_context["context"]), ) - event = await on_script_message + event = await wait_for_future_safe(on_script_message) assert event == { "channel": "channel_name", diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/realm_created/realm_created.py b/tests/wpt/tests/webdriver/tests/bidi/script/realm_created/realm_created.py index 2a86adecb18..25fbbfc9f61 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/realm_created/realm_created.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/realm_created/realm_created.py @@ -100,7 +100,7 @@ async def test_reload(bidi_session, subscribe_events, new_tab, inline): @pytest.mark.parametrize("method", ["evaluate", "call_function"]) async def test_sandbox( - bidi_session, subscribe_events, new_tab, wait_for_event, test_origin, method + bidi_session, subscribe_events, new_tab, wait_for_event, wait_for_future_safe, test_origin, method ): await bidi_session.browsing_context.navigate( context=new_tab["context"], url=test_origin, wait="complete" @@ -114,7 +114,7 @@ async def test_sandbox( bidi_session, new_tab["context"], sandbox_name, method ) - event = await on_realm_created + event = await wait_for_future_safe(on_realm_created) assert event == { "context": new_tab["context"], @@ -191,7 +191,7 @@ async def test_subscribe_to_one_context( @pytest.mark.parametrize("method", ["evaluate", "call_function"]) async def test_script_when_realm_is_created( - bidi_session, subscribe_events, new_tab, wait_for_event, inline, method + bidi_session, subscribe_events, new_tab, wait_for_event,wait_for_future_safe, inline, method ): await bidi_session.browsing_context.navigate( context=new_tab["context"], url=inline("
foo
"), wait="complete" @@ -202,7 +202,7 @@ async def test_script_when_realm_is_created( await bidi_session.browsing_context.reload(context=new_tab["context"]) - realm_info = await on_realm_created + realm_info = await wait_for_future_safe(on_realm_created) # Validate that it's possible to execute the script # as soon as a realm is created. diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/realm_destroyed/realm_destroyed.py b/tests/wpt/tests/webdriver/tests/bidi/script/realm_destroyed/realm_destroyed.py index e3f4dc0af01..15309f7aba0 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/realm_destroyed/realm_destroyed.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/realm_destroyed/realm_destroyed.py @@ -30,7 +30,7 @@ async def test_unsubscribe(bidi_session): @pytest.mark.parametrize("type_hint", ["window", "tab"]) -async def test_close_context(bidi_session, subscribe_events, wait_for_event, type_hint): +async def test_close_context(bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, type_hint): new_context = await bidi_session.browsing_context.create(type_hint=type_hint) await subscribe_events(events=[REALM_DESTROYED_EVENT]) @@ -40,13 +40,13 @@ async def test_close_context(bidi_session, subscribe_events, wait_for_event, typ await bidi_session.browsing_context.close(context=new_context["context"]) - event = await on_realm_destroyed + event = await wait_for_future_safe(on_realm_destroyed) assert event == {"realm": result[0]["realm"]} async def test_navigate( - bidi_session, subscribe_events, wait_for_event, inline, new_tab + bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, inline, new_tab ): await subscribe_events(events=[REALM_DESTROYED_EVENT]) @@ -58,13 +58,13 @@ async def test_navigate( context=new_tab["context"], url=inline("
foo
"), wait="complete" ) - event = await on_realm_destroyed + event = await wait_for_future_safe(on_realm_destroyed) assert event == {"realm": result[0]["realm"]} async def test_reload_context( - bidi_session, subscribe_events, wait_for_event, top_context + bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, top_context ): await subscribe_events(events=[REALM_DESTROYED_EVENT]) @@ -74,7 +74,7 @@ async def test_reload_context( await bidi_session.browsing_context.reload(context=top_context["context"]) - event = await on_realm_destroyed + event = await wait_for_future_safe(on_realm_destroyed) assert event == {"realm": result[0]["realm"]} @@ -134,7 +134,7 @@ async def test_subscribe_after_sandbox_creation( @pytest.mark.parametrize("domain", ["", "alt"], ids=["same_origin", "cross_origin"]) async def test_iframe( - bidi_session, subscribe_events, top_context, inline, wait_for_event, domain + bidi_session, subscribe_events, top_context, inline, wait_for_event, wait_for_future_safe, domain ): frame_url = inline("
foo
") url = inline(f"", domain=domain) @@ -155,7 +155,7 @@ async def test_iframe( context=frame_context, url=inline("
foo
"), wait="complete" ) - event = await on_realm_destroyed + event = await wait_for_future_safe(on_realm_destroyed) assert event == {"realm": result[0]["realm"]} diff --git a/tests/wpt/tests/webdriver/tests/bidi/session/subscribe/contexts.py b/tests/wpt/tests/webdriver/tests/bidi/session/subscribe/contexts.py index 215393603ea..990c210396c 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/session/subscribe/contexts.py +++ b/tests/wpt/tests/webdriver/tests/bidi/session/subscribe/contexts.py @@ -9,7 +9,7 @@ from ... import create_console_api_message, recursive_compare @pytest.mark.asyncio async def test_subscribe_to_one_context( - bidi_session, subscribe_events, top_context, new_tab, wait_for_event + bidi_session, subscribe_events, top_context, new_tab, wait_for_event, wait_for_future_safe ): # Subscribe for log events to a specific context await subscribe_events(events=["log.entryAdded"], contexts=[top_context["context"]]) @@ -30,7 +30,7 @@ async def test_subscribe_to_one_context( # Trigger another console event in the observed context on_entry_added = wait_for_event("log.entryAdded") expected_text = await create_console_api_message(bidi_session, top_context, "text2") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 1 recursive_compare( @@ -45,7 +45,7 @@ async def test_subscribe_to_one_context( @pytest.mark.asyncio async def test_subscribe_to_one_context_twice( - bidi_session, subscribe_events, top_context, wait_for_event + bidi_session, subscribe_events, top_context, wait_for_event, wait_for_future_safe ): # Subscribe twice for log events to a specific context await subscribe_events(events=["log.entryAdded"], contexts=[top_context["context"]]) @@ -62,7 +62,7 @@ async def test_subscribe_to_one_context_twice( # Trigger a console event in the observed context on_entry_added = wait_for_event("log.entryAdded") expected_text = await create_console_api_message(bidi_session, top_context, "text2") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 1 recursive_compare( @@ -79,7 +79,7 @@ async def test_subscribe_to_one_context_twice( @pytest.mark.asyncio async def test_subscribe_to_one_context_and_then_to_all( - bidi_session, subscribe_events, top_context, new_tab, wait_for_event + bidi_session, subscribe_events, top_context, new_tab, wait_for_event, wait_for_future_safe ): # Subscribe for log events to a specific context await subscribe_events(events=["log.entryAdded"], contexts=[top_context["context"]]) @@ -102,7 +102,7 @@ async def test_subscribe_to_one_context_and_then_to_all( # Trigger another console event in the observed context on_entry_added = wait_for_event("log.entryAdded") expected_text = await create_console_api_message(bidi_session, top_context, "text2") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 1 recursive_compare( @@ -128,7 +128,7 @@ async def test_subscribe_to_one_context_and_then_to_all( # Trigger again events in each context expected_text = await create_console_api_message(bidi_session, new_tab, "text3") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 2 recursive_compare( @@ -139,7 +139,7 @@ async def test_subscribe_to_one_context_and_then_to_all( ) expected_text = await create_console_api_message(bidi_session, top_context, "text4") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 3 recursive_compare( @@ -154,7 +154,7 @@ async def test_subscribe_to_one_context_and_then_to_all( @pytest.mark.asyncio async def test_subscribe_to_all_context_and_then_to_one_again( - bidi_session, subscribe_events, top_context, new_tab, wait_for_event + bidi_session, subscribe_events, top_context, new_tab, wait_for_event, wait_for_future_safe ): # Subscribe to all contexts await subscribe_events(events=["log.entryAdded"]) @@ -172,7 +172,7 @@ async def test_subscribe_to_all_context_and_then_to_one_again( # Trigger console event in the context to which we tried to subscribe twice on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message(bidi_session, top_context, "text1") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Make sure we received only one event assert len(events) == 1 @@ -184,7 +184,7 @@ async def test_subscribe_to_all_context_and_then_to_one_again( async def test_subscribe_to_top_context_with_iframes( bidi_session, subscribe_events, - wait_for_event, + wait_for_event, wait_for_future_safe, top_context, test_page_multiple_frames, ): @@ -212,7 +212,7 @@ async def test_subscribe_to_top_context_with_iframes( # Trigger console event in the first iframe on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message(bidi_session, frame_1, "text1") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Make sure we received the event assert len(events) == 1 @@ -220,7 +220,7 @@ async def test_subscribe_to_top_context_with_iframes( # Trigger console event in the second iframe on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message(bidi_session, frame_2, "text2") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Make sure we received the second event as well assert len(events) == 2 @@ -232,7 +232,7 @@ async def test_subscribe_to_top_context_with_iframes( async def test_subscribe_to_child_context( bidi_session, subscribe_events, - wait_for_event, + wait_for_event, wait_for_future_safe, top_context, test_page_multiple_frames, ): @@ -260,7 +260,7 @@ async def test_subscribe_to_child_context( # Trigger console event in the top context on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message(bidi_session, top_context, "text1") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Make sure we received the event assert len(events) == 1 @@ -268,7 +268,7 @@ async def test_subscribe_to_child_context( # Trigger console event in the second iframe on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message(bidi_session, frame_2, "text2") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Make sure we received the second event as well assert len(events) == 2 diff --git a/tests/wpt/tests/webdriver/tests/bidi/session/subscribe/events.py b/tests/wpt/tests/webdriver/tests/bidi/session/subscribe/events.py index 2953aafe03f..f9d5d6bc21b 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/session/subscribe/events.py +++ b/tests/wpt/tests/webdriver/tests/bidi/session/subscribe/events.py @@ -5,7 +5,7 @@ import pytest @pytest.mark.asyncio -async def test_subscribe_to_module(bidi_session, subscribe_events, wait_for_event): +async def test_subscribe_to_module(bidi_session, subscribe_events, wait_for_event, wait_for_future_safe): # Subscribe to all browsing context events await subscribe_events(events=["browsingContext"]) @@ -28,7 +28,7 @@ async def test_subscribe_to_module(bidi_session, subscribe_events, wait_for_even # Wait for the last event on_entry_added = wait_for_event("browsingContext.load") await bidi_session.browsing_context.create(type_hint="tab") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 3 @@ -39,7 +39,7 @@ async def test_subscribe_to_module(bidi_session, subscribe_events, wait_for_even @pytest.mark.asyncio async def test_subscribe_to_one_event_and_then_to_module( - bidi_session, subscribe_events, wait_for_event + bidi_session, subscribe_events, wait_for_event, wait_for_future_safe ): # Subscribe to one event await subscribe_events(events=["browsingContext.contextCreated"]) @@ -56,7 +56,7 @@ async def test_subscribe_to_one_event_and_then_to_module( on_entry_added = wait_for_event("browsingContext.contextCreated") await bidi_session.browsing_context.create(type_hint="tab") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 1 assert "browsingContext.contextCreated" in events @@ -77,7 +77,7 @@ async def test_subscribe_to_one_event_and_then_to_module( # Wait for the last event on_entry_added = wait_for_event("browsingContext.load") await bidi_session.browsing_context.create(type_hint="tab") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Make sure we didn't receive duplicates assert len(events) == 3 @@ -89,7 +89,7 @@ async def test_subscribe_to_one_event_and_then_to_module( @pytest.mark.asyncio async def test_subscribe_to_module_and_then_to_one_event_again( - bidi_session, subscribe_events, wait_for_event + bidi_session, subscribe_events, wait_for_event, wait_for_future_safe ): # Subscribe to all browsing context events await subscribe_events(events=["browsingContext"]) @@ -113,7 +113,7 @@ async def test_subscribe_to_module_and_then_to_one_event_again( # Wait for the last event on_entry_added = wait_for_event("browsingContext.load") await bidi_session.browsing_context.create(type_hint="tab") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 3 @@ -126,7 +126,7 @@ async def test_subscribe_to_module_and_then_to_one_event_again( # Wait for the last event on_entry_added = wait_for_event("browsingContext.load") await bidi_session.browsing_context.create(type_hint="tab") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Make sure we didn't receive duplicates assert len(events) == 3 diff --git a/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/contexts.py b/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/contexts.py index 4a34b2dca15..84259a5bf25 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/contexts.py +++ b/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/contexts.py @@ -9,7 +9,7 @@ from ... import create_console_api_message, recursive_compare @pytest.mark.asyncio async def test_unsubscribe_from_one_context( - bidi_session, top_context, new_tab, wait_for_event + bidi_session, top_context, new_tab, wait_for_event, wait_for_future_safe ): # Subscribe for log events to multiple contexts await bidi_session.session.subscribe( @@ -35,7 +35,7 @@ async def test_unsubscribe_from_one_context( # Trigger another console event in the still observed context on_entry_added = wait_for_event("log.entryAdded") expected_text = await create_console_api_message(bidi_session, new_tab, "text2") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 1 recursive_compare( diff --git a/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/events.py b/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/events.py index f2394415b34..bd7d0648470 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/events.py +++ b/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/events.py @@ -42,7 +42,7 @@ async def test_unsubscribe_from_module(bidi_session): @pytest.mark.asyncio async def test_subscribe_to_module_unsubscribe_from_one_event( - bidi_session, wait_for_event + bidi_session, wait_for_event, wait_for_future_safe ): await bidi_session.session.subscribe(events=["browsingContext"]) @@ -68,7 +68,7 @@ async def test_subscribe_to_module_unsubscribe_from_one_event( # Wait for the last event on_entry_added = wait_for_event("browsingContext.load") await bidi_session.browsing_context.create(type_hint="tab") - await on_entry_added + await wait_for_future_safe(on_entry_added) # Make sure we didn't receive browsingContext.domContentLoaded event assert len(events) == 2 diff --git a/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/invalid.py b/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/invalid.py index e6f3050da31..9039f27e47c 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/invalid.py +++ b/tests/wpt/tests/webdriver/tests/bidi/session/unsubscribe/invalid.py @@ -40,7 +40,7 @@ async def test_params_events_value_invalid_event_name(send_blocking_command, val @pytest.mark.asyncio async def test_params_events_value_valid_and_invalid_event_name( - bidi_session, subscribe_events, send_blocking_command, wait_for_event, top_context + bidi_session, subscribe_events, send_blocking_command, wait_for_event, wait_for_future_safe, top_context ): # Subscribe to a valid event await subscribe_events(events=["log.entryAdded"]) @@ -64,7 +64,7 @@ async def test_params_events_value_valid_and_invalid_event_name( on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message(bidi_session, top_context, "text1") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 1 @@ -137,7 +137,7 @@ async def test_params_contexts_value_invalid_value(send_blocking_command): @pytest.mark.asyncio async def test_params_contexts_value_valid_and_invalid_value( - bidi_session, subscribe_events, send_blocking_command, wait_for_event, top_context + bidi_session, subscribe_events, send_blocking_command, wait_for_event, wait_for_future_safe, top_context ): # Subscribe to a valid context await subscribe_events(events=["log.entryAdded"], contexts=[top_context["context"]]) @@ -162,7 +162,7 @@ async def test_params_contexts_value_valid_and_invalid_value( on_entry_added = wait_for_event("log.entryAdded") await create_console_api_message(bidi_session, top_context, "text1") - await on_entry_added + await wait_for_future_safe(on_entry_added) assert len(events) == 1 diff --git a/tests/wpt/tests/webdriver/tests/classic/close_window/close.py b/tests/wpt/tests/webdriver/tests/classic/close_window/close.py index 7b382fa9bbc..680f471839c 100644 --- a/tests/wpt/tests/webdriver/tests/classic/close_window/close.py +++ b/tests/wpt/tests/webdriver/tests/classic/close_window/close.py @@ -84,7 +84,7 @@ def test_close_last_browsing_context(session): def test_element_usage_after_closing_browsing_context(session, inline): session.url = inline("

foo") - a = session.find.css("p", all=False) + session.find.css("p", all=False) first = session.window_handle second = session.new_window(type_hint="tab") diff --git a/tests/wpt/tests/webdriver/tests/classic/delete_all_cookies/user_prompts.py b/tests/wpt/tests/webdriver/tests/classic/delete_all_cookies/user_prompts.py index dca4f3c8bf6..03f34d9f6f9 100644 --- a/tests/wpt/tests/webdriver/tests/classic/delete_all_cookies/user_prompts.py +++ b/tests/wpt/tests/webdriver/tests/classic/delete_all_cookies/user_prompts.py @@ -2,8 +2,6 @@ import pytest -from webdriver.error import NoSuchCookieException - from tests.support.asserts import assert_dialog_handled, assert_error, assert_success diff --git a/tests/wpt/tests/webdriver/tests/classic/element_click/center_point.py b/tests/wpt/tests/webdriver/tests/classic/element_click/center_point.py index eb5cc19f14f..86b54a2d42f 100644 --- a/tests/wpt/tests/webdriver/tests/classic/element_click/center_point.py +++ b/tests/wpt/tests/webdriver/tests/classic/element_click/center_point.py @@ -1,6 +1,6 @@ import pytest -from tests.support.asserts import assert_error, assert_success +from tests.support.asserts import assert_success from tests.support.helpers import center_point diff --git a/tests/wpt/tests/webdriver/tests/classic/element_click/events.py b/tests/wpt/tests/webdriver/tests/classic/element_click/events.py index 5e80b52e879..e6900f2d299 100644 --- a/tests/wpt/tests/webdriver/tests/classic/element_click/events.py +++ b/tests/wpt/tests/webdriver/tests/classic/element_click/events.py @@ -1,4 +1,3 @@ -from webdriver import WebElement from tests.support.asserts import assert_success from tests.support.helpers import filter_dict diff --git a/tests/wpt/tests/webdriver/tests/classic/element_click/file_upload.py b/tests/wpt/tests/webdriver/tests/classic/element_click/file_upload.py index 73832d0f85a..50e30085e18 100644 --- a/tests/wpt/tests/webdriver/tests/classic/element_click/file_upload.py +++ b/tests/wpt/tests/webdriver/tests/classic/element_click/file_upload.py @@ -1,4 +1,4 @@ -from tests.support.asserts import assert_error, assert_success +from tests.support.asserts import assert_error def element_click(session, element): @@ -8,7 +8,7 @@ def element_click(session, element): element_id=element.id)) -def test_file_upload_state(session,inline): +def test_file_upload_state(session, inline): session.url = inline("") element = session.find.css("input", all=False) diff --git a/tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py b/tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py index fa35b7ae6e3..7616c069632 100644 --- a/tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py +++ b/tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py @@ -133,7 +133,7 @@ def test_link_from_nested_context_with_target(session, inline, iframe, target): session.url = inline(iframe("click".format(target_page, target))) frame = session.find.css("iframe", all=False) session.switch_frame(frame) - element = session.find.css("a".format(target), all=False) + element = session.find.css("a", all=False) orig_handles = session.handles diff --git a/tests/wpt/tests/webdriver/tests/classic/element_click/scroll_into_view.py b/tests/wpt/tests/webdriver/tests/classic/element_click/scroll_into_view.py index c2dc6485286..591847e8816 100644 --- a/tests/wpt/tests/webdriver/tests/classic/element_click/scroll_into_view.py +++ b/tests/wpt/tests/webdriver/tests/classic/element_click/scroll_into_view.py @@ -1,6 +1,6 @@ import pytest -from tests.support.asserts import assert_error, assert_success +from tests.support.asserts import assert_success from tests.support.helpers import center_point diff --git a/tests/wpt/tests/webdriver/tests/classic/element_click/shadow_dom.py b/tests/wpt/tests/webdriver/tests/classic/element_click/shadow_dom.py index 18768a60b29..6aad49d5c9d 100644 --- a/tests/wpt/tests/webdriver/tests/classic/element_click/shadow_dom.py +++ b/tests/wpt/tests/webdriver/tests/classic/element_click/shadow_dom.py @@ -1,12 +1,11 @@ import pytest -from tests.support.asserts import assert_error, assert_success +from tests.support.asserts import assert_success def element_click(session, element): return session.transport.send( "POST", "session/{session_id}/element/{element_id}/click".format( - session_id=session.session_id, - element_id=element.id)) + session_id=session.session_id, element_id=element.id)) @pytest.mark.parametrize("click_on", ["host_element", "checkbox_element"]) @@ -16,38 +15,46 @@ def test_shadow_element_click(session, get_test_page, click_on): host_element = session.find.css("custom-element", all=False) checkbox_element = session.execute_script(""" return arguments[0].shadowRoot.querySelector("input") - """, args=(host_element,)) + """, + args=(host_element, )) is_pre_checked = session.execute_script(""" return arguments[0].checked - """, args=(checkbox_element,)) - assert is_pre_checked == False + """, + args=(checkbox_element, )) + assert is_pre_checked is False response = element_click(session, locals()[click_on]) assert_success(response) is_post_checked = session.execute_script(""" return arguments[0].checked - """, args=(checkbox_element,)) - assert is_post_checked == True + """, + args=(checkbox_element, )) + assert is_post_checked is True -@pytest.mark.parametrize("click_on", ["outer_element", "inner_element", "checkbox"]) +@pytest.mark.parametrize("click_on", + ["outer_element", "inner_element", "checkbox"]) def test_nested_shadow_element_click(session, get_test_page, click_on): session.url = get_test_page(nested_shadow_dom=True) outer_element = session.find.css("custom-element", all=False) inner_element = session.execute_script(""" return arguments[0].shadowRoot.querySelector("inner-custom-element") - """, args=(outer_element,)) + """, + args=(outer_element, )) checkbox = session.execute_script(""" return arguments[0].shadowRoot.querySelector("input") - """, args=(inner_element,)) + """, + args=(inner_element, )) - is_pre_checked = session.execute_script("return arguments[0].checked", args=(checkbox,)) - assert is_pre_checked == False + is_pre_checked = session.execute_script("return arguments[0].checked", + args=(checkbox, )) + assert is_pre_checked is False click_response = element_click(session, locals()[click_on]) assert_success(click_response) - is_post_checked = session.execute_script("return arguments[0].checked", args=(checkbox,)) - assert is_post_checked == True + is_post_checked = session.execute_script("return arguments[0].checked", + args=(checkbox, )) + assert is_post_checked is True diff --git a/tests/wpt/tests/webdriver/tests/classic/execute_async_script/execute_async.py b/tests/wpt/tests/webdriver/tests/classic/execute_async_script/execute_async.py index 3c8cc6210d4..cdef3230cb8 100644 --- a/tests/wpt/tests/webdriver/tests/classic/execute_async_script/execute_async.py +++ b/tests/wpt/tests/webdriver/tests/classic/execute_async_script/execute_async.py @@ -1,6 +1,5 @@ import pytest -from webdriver import WebElement from webdriver.error import NoSuchAlertException from webdriver.transport import Response diff --git a/tests/wpt/tests/webdriver/tests/classic/execute_async_script/objects.py b/tests/wpt/tests/webdriver/tests/classic/execute_async_script/objects.py index edcf06505aa..2957429b01d 100644 --- a/tests/wpt/tests/webdriver/tests/classic/execute_async_script/objects.py +++ b/tests/wpt/tests/webdriver/tests/classic/execute_async_script/objects.py @@ -46,4 +46,4 @@ def test_object_to_json_exception(session): } }); """) - value = assert_error(response, "javascript error") + assert_error(response, "javascript error") diff --git a/tests/wpt/tests/webdriver/tests/classic/execute_script/execute.py b/tests/wpt/tests/webdriver/tests/classic/execute_script/execute.py index 15ac1d0132a..9c3c699bd2f 100644 --- a/tests/wpt/tests/webdriver/tests/classic/execute_script/execute.py +++ b/tests/wpt/tests/webdriver/tests/classic/execute_script/execute.py @@ -1,6 +1,5 @@ import pytest -from webdriver import WebElement from webdriver.error import NoSuchAlertException from webdriver.transport import Response diff --git a/tests/wpt/tests/webdriver/tests/classic/execute_script/objects.py b/tests/wpt/tests/webdriver/tests/classic/execute_script/objects.py index e254fe275e2..6447bce079e 100644 --- a/tests/wpt/tests/webdriver/tests/classic/execute_script/objects.py +++ b/tests/wpt/tests/webdriver/tests/classic/execute_script/objects.py @@ -46,4 +46,4 @@ def test_object_to_json_exception(session): } }; """) - value = assert_error(response, "javascript error") + assert_error(response, "javascript error") diff --git a/tests/wpt/tests/webdriver/tests/classic/find_element_from_shadow_root/find.py b/tests/wpt/tests/webdriver/tests/classic/find_element_from_shadow_root/find.py index c658152ee69..1b4e739419b 100644 --- a/tests/wpt/tests/webdriver/tests/classic/find_element_from_shadow_root/find.py +++ b/tests/wpt/tests/webdriver/tests/classic/find_element_from_shadow_root/find.py @@ -194,7 +194,7 @@ def test_find_element_link_text(session, get_test_page, document, value): expected = session.execute_script(""" return arguments[0].shadowRoot.querySelectorAll('a')[0] - """, args=(host,)) + """, args=(host,)) response = find_element(session, shadow_root.id, "link text", value) value = assert_success(response) diff --git a/tests/wpt/tests/webdriver/tests/classic/find_elements_from_shadow_root/find.py b/tests/wpt/tests/webdriver/tests/classic/find_elements_from_shadow_root/find.py index 188fff29212..1e977f2f214 100644 --- a/tests/wpt/tests/webdriver/tests/classic/find_elements_from_shadow_root/find.py +++ b/tests/wpt/tests/webdriver/tests/classic/find_elements_from_shadow_root/find.py @@ -149,7 +149,7 @@ def test_find_elements_equivalence(session, get_test_page): host = session.find.css("custom-element", all=False) shadow_root = host.shadow_root - expected = session.execute_script(""" + session.execute_script(""" return arguments[0].shadowRoot.querySelector('input') """, args=(host,)) diff --git a/tests/wpt/tests/webdriver/tests/classic/get_computed_label/get.py b/tests/wpt/tests/webdriver/tests/classic/get_computed_label/get.py index e023b79cea5..c22bae5b507 100644 --- a/tests/wpt/tests/webdriver/tests/classic/get_computed_label/get.py +++ b/tests/wpt/tests/webdriver/tests/classic/get_computed_label/get.py @@ -1,7 +1,6 @@ import pytest from webdriver import WebElement -from webdriver.error import NoSuchAlertException from tests.support.asserts import assert_error, assert_success diff --git a/tests/wpt/tests/webdriver/tests/classic/get_computed_role/get.py b/tests/wpt/tests/webdriver/tests/classic/get_computed_role/get.py index 1b8489675ce..0990eecb90c 100644 --- a/tests/wpt/tests/webdriver/tests/classic/get_computed_role/get.py +++ b/tests/wpt/tests/webdriver/tests/classic/get_computed_role/get.py @@ -1,7 +1,6 @@ import pytest from webdriver import WebElement -from webdriver.error import NoSuchAlertException from tests.support.asserts import assert_error, assert_success diff --git a/tests/wpt/tests/webdriver/tests/classic/get_current_url/get.py b/tests/wpt/tests/webdriver/tests/classic/get_current_url/get.py index baeab0960b6..5819804f23e 100644 --- a/tests/wpt/tests/webdriver/tests/classic/get_current_url/get.py +++ b/tests/wpt/tests/webdriver/tests/classic/get_current_url/get.py @@ -1,6 +1,5 @@ import pytest -from tests.support import platform_name from tests.support.asserts import assert_error, assert_success diff --git a/tests/wpt/tests/webdriver/tests/classic/get_element_property/get.py b/tests/wpt/tests/webdriver/tests/classic/get_element_property/get.py index 12d48a3abb5..fe354b4f2c2 100644 --- a/tests/wpt/tests/webdriver/tests/classic/get_element_property/get.py +++ b/tests/wpt/tests/webdriver/tests/classic/get_element_property/get.py @@ -2,7 +2,7 @@ import pytest from webdriver import WebElement, WebFrame, ShadowRoot, WebWindow -from tests.support.asserts import assert_error, assert_same_element, assert_success +from tests.support.asserts import assert_error, assert_success def get_element_property(session, element_id, prop): diff --git a/tests/wpt/tests/webdriver/tests/classic/get_element_rect/__init__.py b/tests/wpt/tests/webdriver/tests/classic/get_element_rect/__init__.py index 8b137891791..e69de29bb2d 100644 --- a/tests/wpt/tests/webdriver/tests/classic/get_element_rect/__init__.py +++ b/tests/wpt/tests/webdriver/tests/classic/get_element_rect/__init__.py @@ -1 +0,0 @@ - diff --git a/tests/wpt/tests/webdriver/tests/classic/get_named_cookie/user_prompts.py b/tests/wpt/tests/webdriver/tests/classic/get_named_cookie/user_prompts.py index 3ef52a58a41..f1669d6c998 100644 --- a/tests/wpt/tests/webdriver/tests/classic/get_named_cookie/user_prompts.py +++ b/tests/wpt/tests/webdriver/tests/classic/get_named_cookie/user_prompts.py @@ -2,8 +2,6 @@ import pytest -from webdriver.error import NoSuchCookieException - from tests.support.asserts import assert_dialog_handled, assert_error, assert_success diff --git a/tests/wpt/tests/webdriver/tests/classic/get_window_handle/get.py b/tests/wpt/tests/webdriver/tests/classic/get_window_handle/get.py index 7d25dff09a5..922915f2dc4 100644 --- a/tests/wpt/tests/webdriver/tests/classic/get_window_handle/get.py +++ b/tests/wpt/tests/webdriver/tests/classic/get_window_handle/get.py @@ -1,5 +1,3 @@ -import pytest - from tests.support.asserts import assert_error, assert_success diff --git a/tests/wpt/tests/webdriver/tests/classic/maximize_window/stress.py b/tests/wpt/tests/webdriver/tests/classic/maximize_window/stress.py index 4527c64a288..986f6346e90 100644 --- a/tests/wpt/tests/webdriver/tests/classic/maximize_window/stress.py +++ b/tests/wpt/tests/webdriver/tests/classic/maximize_window/stress.py @@ -5,7 +5,6 @@ import time import pytest from tests.support.asserts import assert_success -from tests.support.helpers import document_hidden def maximize_window(session): diff --git a/tests/wpt/tests/webdriver/tests/classic/new_session/conftest.py b/tests/wpt/tests/webdriver/tests/classic/new_session/conftest.py index d67fdba449d..b6179aa90e7 100644 --- a/tests/wpt/tests/webdriver/tests/classic/new_session/conftest.py +++ b/tests/wpt/tests/webdriver/tests/classic/new_session/conftest.py @@ -7,16 +7,16 @@ def product(a, b): return [(a, item) for item in b] -def flatten(l): - return [item for x in l for item in x] +def flatten(a): + return [item for x in a for item in x] @pytest.fixture(name="add_browser_capabilities") def fixture_add_browser_capabilities(configuration): - def add_browser_capabilities(capabilities): # Make sure there aren't keys in common. - assert not set(configuration["capabilities"]).intersection(set(capabilities)) + assert not set(configuration["capabilities"]).intersection( + set(capabilities)) result = dict(configuration["capabilities"]) result.update(capabilities) @@ -27,16 +27,17 @@ def fixture_add_browser_capabilities(configuration): @pytest.fixture(name="configuration") def fixture_configuration(configuration): - """Remove "acceptInsecureCerts" from capabilities if it exists. + """Remove "acceptInsecureCerts" from capabilities if it exists. Some browser configurations add acceptInsecureCerts capability by default. Remove it during new_session tests to avoid interference. """ - if "acceptInsecureCerts" in configuration["capabilities"]: - configuration = dict(configuration) - del configuration["capabilities"]["acceptInsecureCerts"] - return configuration + if "acceptInsecureCerts" in configuration["capabilities"]: + configuration = dict(configuration) + del configuration["capabilities"]["acceptInsecureCerts"] + return configuration + @pytest.fixture(name="new_session") def fixture_new_session(request, configuration, current_session): @@ -52,7 +53,9 @@ def fixture_new_session(request, configuration, current_session): custom_session = {} transport = HTTPWireProtocol( - configuration["host"], configuration["port"], url_prefix="/", + configuration["host"], + configuration["port"], + url_prefix="/", ) def _delete_session(session_id): diff --git a/tests/wpt/tests/webdriver/tests/classic/perform_actions/key_shortcuts.py b/tests/wpt/tests/webdriver/tests/classic/perform_actions/key_shortcuts.py index a5e15156967..0e92e2f206d 100644 --- a/tests/wpt/tests/webdriver/tests/classic/perform_actions/key_shortcuts.py +++ b/tests/wpt/tests/webdriver/tests/classic/perform_actions/key_shortcuts.py @@ -45,5 +45,3 @@ def test_mod_a_mod_x_deletes_all_text(session, key_reporter, key_chain, modifier .key_up("x") \ .perform() assert get_keys(key_reporter) == "" - - diff --git a/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_modifier_click.py b/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_modifier_click.py index 803113cceb0..d1817e8fade 100644 --- a/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_modifier_click.py +++ b/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_modifier_click.py @@ -6,12 +6,12 @@ from tests.support.keys import Keys @pytest.mark.parametrize("modifier, prop", [ - (Keys.ALT, "altKey"), - (Keys.R_ALT, "altKey"), - (Keys.META, "metaKey"), - (Keys.R_META, "metaKey"), - (Keys.SHIFT, "shiftKey"), - (Keys.R_SHIFT, "shiftKey"), + (Keys.ALT, "altKey"), + (Keys.R_ALT, "altKey"), + (Keys.META, "metaKey"), + (Keys.R_META, "metaKey"), + (Keys.SHIFT, "shiftKey"), + (Keys.R_SHIFT, "shiftKey"), ]) def test_modifier_click(session, test_actions_page, key_chain, mouse_chain, modifier, prop): key_chain \ diff --git a/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_mouse.py b/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_mouse.py index 6ccb7c404e0..914e9f65608 100644 --- a/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_mouse.py +++ b/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_mouse.py @@ -112,8 +112,8 @@ def test_middle_click(session, test_actions_page, mouse_chain): assert len(events) == 3 expected = [ - {"type": "mousedown", "button": 1, "buttons": 4}, - {"type": "mouseup", "button": 1, "buttons": 0}, + {"type": "mousedown", "button": 1, "buttons": 4}, + {"type": "mouseup", "button": 1, "buttons": 0}, ] filtered_events = [filter_dict(e, expected[0]) for e in events] mousedown_mouseup_events = [ diff --git a/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_pause_dblclick.py b/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_pause_dblclick.py index 209de727a6c..fd14d083447 100644 --- a/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_pause_dblclick.py +++ b/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_pause_dblclick.py @@ -9,48 +9,48 @@ _DBLCLICK_INTERVAL = 640 def test_dblclick_with_pause_after_second_pointerdown(session, test_actions_page, mouse_chain): - outer = session.find.css("#outer", all=False) - center = get_inview_center(outer.rect, get_viewport_rect(session)) - mouse_chain \ - .pointer_move(int(center["x"]), int(center["y"])) \ - .click() \ - .pointer_down() \ - .pause(_DBLCLICK_INTERVAL + 10) \ - .pointer_up() \ - .perform() - events = get_events(session) - expected = [ - {"type": "mousedown", "button": 0}, - {"type": "mouseup", "button": 0}, - {"type": "click", "button": 0}, - {"type": "mousedown", "button": 0}, - {"type": "mouseup", "button": 0}, - {"type": "click", "button": 0}, - {"type": "dblclick", "button": 0}, - ] - assert len(events) == 8 - filtered_events = [filter_dict(e, expected[0]) for e in events] - assert expected == filtered_events[1:] + outer = session.find.css("#outer", all=False) + center = get_inview_center(outer.rect, get_viewport_rect(session)) + mouse_chain \ + .pointer_move(int(center["x"]), int(center["y"])) \ + .click() \ + .pointer_down() \ + .pause(_DBLCLICK_INTERVAL + 10) \ + .pointer_up() \ + .perform() + events = get_events(session) + expected = [ + {"type": "mousedown", "button": 0}, + {"type": "mouseup", "button": 0}, + {"type": "click", "button": 0}, + {"type": "mousedown", "button": 0}, + {"type": "mouseup", "button": 0}, + {"type": "click", "button": 0}, + {"type": "dblclick", "button": 0}, + ] + assert len(events) == 8 + filtered_events = [filter_dict(e, expected[0]) for e in events] + assert expected == filtered_events[1:] def test_no_dblclick(session, test_actions_page, mouse_chain): - outer = session.find.css("#outer", all=False) - center = get_inview_center(outer.rect, get_viewport_rect(session)) - mouse_chain \ - .pointer_move(int(center["x"]), int(center["y"])) \ - .click() \ - .pause(_DBLCLICK_INTERVAL + 10) \ - .click() \ - .perform() - events = get_events(session) - expected = [ - {"type": "mousedown", "button": 0}, - {"type": "mouseup", "button": 0}, - {"type": "click", "button": 0}, - {"type": "mousedown", "button": 0}, - {"type": "mouseup", "button": 0}, - {"type": "click", "button": 0}, - ] - assert len(events) == 7 - filtered_events = [filter_dict(e, expected[0]) for e in events] - assert expected == filtered_events[1:] + outer = session.find.css("#outer", all=False) + center = get_inview_center(outer.rect, get_viewport_rect(session)) + mouse_chain \ + .pointer_move(int(center["x"]), int(center["y"])) \ + .click() \ + .pause(_DBLCLICK_INTERVAL + 10) \ + .click() \ + .perform() + events = get_events(session) + expected = [ + {"type": "mousedown", "button": 0}, + {"type": "mouseup", "button": 0}, + {"type": "click", "button": 0}, + {"type": "mousedown", "button": 0}, + {"type": "mouseup", "button": 0}, + {"type": "click", "button": 0}, + ] + assert len(events) == 7 + filtered_events = [filter_dict(e, expected[0]) for e in events] + assert expected == filtered_events[1:] diff --git a/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_tripleclick.py b/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_tripleclick.py index b45709da3cb..eccfa672408 100644 --- a/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_tripleclick.py +++ b/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_tripleclick.py @@ -1,9 +1,5 @@ import math -from tests.classic.perform_actions.support.refine import get_events -from tests.support.asserts import assert_move_to_coordinates -from tests.support.helpers import filter_dict - lots_of_text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor "\ "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud "\ "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." diff --git a/tests/wpt/tests/webdriver/tests/classic/perform_actions/support/refine.py b/tests/wpt/tests/webdriver/tests/classic/perform_actions/support/refine.py index 35c962b9ecb..a8fcb1f3b6f 100644 --- a/tests/wpt/tests/webdriver/tests/classic/perform_actions/support/refine.py +++ b/tests/wpt/tests/webdriver/tests/classic/perform_actions/support/refine.py @@ -8,7 +8,7 @@ def get_events(session): if "key" in e and e["key"].startswith(u"U+"): key = e["key"] hex_suffix = key[key.index("+") + 1:] - e["key"] = unichr(int(hex_suffix, 16)) + e["key"] = chr(int(hex_suffix, 16)) # WebKit sets code as 'Unidentified' for unidentified key codes, but # tests expect ''. diff --git a/tests/wpt/tests/webdriver/tests/classic/permissions/set.py b/tests/wpt/tests/webdriver/tests/classic/permissions/set.py index 4a042f5f18f..740b93d40e0 100644 --- a/tests/wpt/tests/webdriver/tests/classic/permissions/set.py +++ b/tests/wpt/tests/webdriver/tests/classic/permissions/set.py @@ -1,6 +1,7 @@ from tests.support.asserts import assert_error, assert_success import pytest + def query(session, name): script = """ var done = arguments[0]; @@ -14,30 +15,64 @@ def query(session, name): return session.transport.send( "POST", "/session/{session_id}/execute/async".format(**vars(session)), - {"script": script, "args": []}) + { + "script": script, + "args": [] + }) + # > 1. Let parameters be the parameters argument, converted to an IDL value of # > type PermissionSetParameters. If this throws an exception, return a # > WebDriver error with WebDriver error code invalid argument. -@pytest.mark.parametrize("parameters", [ - #{ "descriptor": { "name": "geolocation" }, "state": "granted" } - { "descriptor": { "name": 23 }, "state": "granted" }, - { "descriptor": { }, "state": "granted" }, - { "descriptor": { "name": "geolocation" }, "state": "Granted" }, - { "descriptor": 23, "state": "granted" }, - { "descriptor": "geolocation", "state": "granted" }, - { "descriptor": [ { "name": "geolocation" } ], "state": "granted" }, - [ { "descriptor": { "name": "geolocation" }, "state": "granted" } ], -]) +@pytest.mark.parametrize( + "parameters", + [ + #{ "descriptor": { "name": "geolocation" }, "state": "granted" } + { + "descriptor": { + "name": 23 + }, + "state": "granted" + }, + { + "descriptor": {}, + "state": "granted" + }, + { + "descriptor": { + "name": "geolocation" + }, + "state": "Granted" + }, + { + "descriptor": 23, + "state": "granted" + }, + { + "descriptor": "geolocation", + "state": "granted" + }, + { + "descriptor": [{ + "name": "geolocation" + }], + "state": "granted" + }, + [{ + "descriptor": { + "name": "geolocation" + }, + "state": "granted" + }], + ]) def test_invalid_parameters(session, url, parameters): session.url = url("/common/blank.html", protocol="https") response = session.transport.send( - "POST", - "/session/{session_id}/permissions".format(**vars(session)), - parameters - ) + "POST", "/session/{session_id}/permissions".format(**vars(session)), + parameters) assert_error(response, "invalid argument") + # > 6. If settings is a non-secure context and rootDesc.name isn't allowed in # > non-secure contexts, return a WebDriver error with WebDriver error code # > invalid argument. @@ -45,20 +80,23 @@ def test_invalid_parameters(session, url, parameters): def test_non_secure_context(session, url, state): session.url = url("/common/blank.html", protocol="http") response = session.transport.send( - "POST", "/session/{session_id}/permissions".format(**vars(session)), - { "descriptor": { "name": "push" }, "state": state } - ) + "POST", "/session/{session_id}/permissions".format(**vars(session)), { + "descriptor": { + "name": "push" + }, + "state": state + }) assert_error(response, "invalid argument") + @pytest.mark.parametrize("state", ["granted", "denied", "prompt"]) def test_set_to_state(session, url, state): session.url = url("/common/blank.html", protocol="https") - parameters = { "descriptor": { "name": "geolocation" }, "state": state } + parameters = {"descriptor": {"name": "geolocation"}, "state": state} response = session.transport.send( "POST", "/session/{session_id}/permissions".format(**vars(session)), - parameters - ) + parameters) try: assert_success(response) @@ -69,7 +107,7 @@ def test_set_to_state(session, url, state): assert_error(response, "invalid argument") return - assert response.body.get("value") == None + assert response.body.get("value") is None response = query(session, "geolocation") diff --git a/tests/wpt/tests/webdriver/tests/classic/release_actions/support/refine.py b/tests/wpt/tests/webdriver/tests/classic/release_actions/support/refine.py index d4052097493..6e2f4574f8e 100644 --- a/tests/wpt/tests/webdriver/tests/classic/release_actions/support/refine.py +++ b/tests/wpt/tests/webdriver/tests/classic/release_actions/support/refine.py @@ -8,7 +8,7 @@ def get_events(session): if "key" in e and e["key"].startswith(u"U+"): key = e["key"] hex_suffix = key[key.index("+") + 1:] - e["key"] = unichr(int(hex_suffix, 16)) + e["key"] = chr(int(hex_suffix, 16)) return events diff --git a/tests/wpt/tests/webdriver/tests/classic/switch_to_parent_frame/switch.py b/tests/wpt/tests/webdriver/tests/classic/switch_to_parent_frame/switch.py index b6c500bcd84..f777d6a7677 100644 --- a/tests/wpt/tests/webdriver/tests/classic/switch_to_parent_frame/switch.py +++ b/tests/wpt/tests/webdriver/tests/classic/switch_to_parent_frame/switch.py @@ -2,7 +2,7 @@ import pytest from webdriver import NoSuchElementException, NoSuchWindowException -from tests.support.asserts import assert_error, assert_success, errors +from tests.support.asserts import assert_error, assert_success from tests.support.sync import Poll diff --git a/tests/wpt/tests/webdriver/tests/support/asserts.py b/tests/wpt/tests/webdriver/tests/support/asserts.py index 9d31ff7b124..b87a7eb46cf 100644 --- a/tests/wpt/tests/webdriver/tests/support/asserts.py +++ b/tests/wpt/tests/webdriver/tests/support/asserts.py @@ -223,7 +223,7 @@ def assert_png(screenshot): Returns the bytestring for the PNG, if the assert passes """ - if type(screenshot) == str: + if type(screenshot) is str: image = decodebytes(screenshot.encode()) else: image = screenshot diff --git a/tests/wpt/tests/webdriver/tests/support/fixtures_bidi.py b/tests/wpt/tests/webdriver/tests/support/fixtures_bidi.py index b42c12519ae..c073997215e 100644 --- a/tests/wpt/tests/webdriver/tests/support/fixtures_bidi.py +++ b/tests/wpt/tests/webdriver/tests/support/fixtures_bidi.py @@ -110,7 +110,7 @@ def wait_for_future_safe(configuration): async def wait_for_future_safe(future: Coroutine, timeout: float = 2.0): try: - await asyncio.wait_for( + return await asyncio.wait_for( asyncio.shield(future), timeout=timeout * configuration["timeout_multiplier"], ) diff --git a/tests/wpt/tests/webdriver/tests/support/fixtures_http.py b/tests/wpt/tests/webdriver/tests/support/fixtures_http.py index 1533dca2bd9..dd714f5e7c4 100644 --- a/tests/wpt/tests/webdriver/tests/support/fixtures_http.py +++ b/tests/wpt/tests/webdriver/tests/support/fixtures_http.py @@ -203,7 +203,7 @@ def render_pdf_to_png_http(current_session, url): assert 0 <= index < len(result) image_string = result[index] - image_string_without_data_type = image_string[image_string.find(",") + 1 :] + image_string_without_data_type = image_string[image_string.find(",") + 1:] return base64.b64decode(image_string_without_data_type) @@ -228,7 +228,7 @@ def compare_png_http(current_session, url): current_session.url = url("/webdriver/tests/support/html/render.html") result = current_session.execute_async_script( - f"""const callback = arguments[arguments.length - 1]; callback(compare(arguments[0], arguments[1], arguments[2], arguments[3]))""", + "const callback = arguments[arguments.length - 1]; callback(compare(arguments[0], arguments[1], arguments[2], arguments[3]))", args=[base64.encodebytes(img1).decode(), base64.encodebytes(img2).decode(), width, height], ) diff --git a/tests/wpt/tests/webdriver/tests/support/inline.py b/tests/wpt/tests/webdriver/tests/support/inline.py index 26f0491d1a8..ef1054c93d7 100644 --- a/tests/wpt/tests/webdriver/tests/support/inline.py +++ b/tests/wpt/tests/webdriver/tests/support/inline.py @@ -29,7 +29,7 @@ MIME_TYPES = { def build_inline(build_url, src, doctype: str = "html", mime: Optional[str] = None, charset: Optional[str] = None, - parameters = None, **kwargs): + parameters=None, **kwargs): if mime is None: mime = MIME_TYPES[doctype] if charset is None: diff --git a/tests/wpt/tests/webdriver/tests/support/keys.py b/tests/wpt/tests/webdriver/tests/support/keys.py index 4771f4d255c..b7b7598b65f 100644 --- a/tests/wpt/tests/webdriver/tests/support/keys.py +++ b/tests/wpt/tests/webdriver/tests/support/keys.py @@ -105,7 +105,7 @@ class Keys(object): R_DELETE = u"\uE05D" -ALL_KEYS = getmembers(Keys, lambda x: type(x) == str) +ALL_KEYS = getmembers(Keys, lambda x: type(x) is str) ALL_EVENTS = OrderedDict( [ diff --git a/tests/wpt/tests/webidl/ecmascript-binding/legacy-platform-object/DefineOwnProperty.html b/tests/wpt/tests/webidl/ecmascript-binding/legacy-platform-object/DefineOwnProperty.html index ad32f6f89f5..bd7ba19c1a9 100644 --- a/tests/wpt/tests/webidl/ecmascript-binding/legacy-platform-object/DefineOwnProperty.html +++ b/tests/wpt/tests/webidl/ecmascript-binding/legacy-platform-object/DefineOwnProperty.html @@ -86,4 +86,80 @@ test(function() { {value: option0, writable: true, enumerable: true, configurable: true}); }, "Test [[DefineOwnProperty]] with indexed property setter support."); + +test(function() { + let dataList = document.createElement("datalist"); + let option0 = document.createElement("option"); + option0.id = "foo"; + dataList.append(option0); + // HTMLCollection supports a named property getter but not a setter. + let htmlCollection = dataList.options; + // Confirm the test settings. + assert_equals(htmlCollection.length, 1); + // HTMLCollection is marked LegacyUnenumerableNamedProperties so enumerable + // is false. + assert_prop_desc_equals(htmlCollection, "foo", + {value: option0, writable: false, enumerable: false, + configurable: true}); + assert_prop_desc_equals(htmlCollection, "bar", undefined); + // Actual test + assert_throws_js(TypeError, () => + Object.defineProperty(htmlCollection, "foo", + {value: true, writable: true})); + assert_throws_js(TypeError, () => + Object.defineProperty(htmlCollection, "foo", {get: () => {}})); + assert_throws_js(TypeError, () => + Object.defineProperty(htmlCollection, "foo", {set: () => {}})); + let option1 = document.createElement("option"); + option1.id = "bar"; + Object.defineProperty(htmlCollection, "bar", + {value: option1, writable: true}); + assert_equals(htmlCollection["foo"], option0); + assert_equals(htmlCollection["bar"], option1); + htmlCollection["foo"] = document.documentElement; + htmlCollection["baz"] = document.documentElement; + assert_equals(htmlCollection["foo"], option0); + assert_equals(htmlCollection["baz"], document.documentElement); + assert_throws_js(TypeError, () => { + "use strict"; + htmlCollection["foo"] = document.documentElement; + }); + // Nothing must change after all for supported property names. + assert_prop_desc_equals(htmlCollection, "foo", + {value: option0, writable: false, enumerable: false, + configurable: true}); +}, "Test [[DefineOwnProperty]] with no named property setter support."); + +test(function() { + let element = document.createElement("div"); + // DOMStringMap supports a named property setter. + let domStringMap = element.dataset; + // Confirm the test settings. + assert_prop_desc_equals(domStringMap, "foo", undefined); + // Try to define an accessor property with non supported property name. + assert_throws_js(TypeError, () => + Object.defineProperty(domStringMap, "foo", {get: () => {}})); + assert_throws_js(TypeError, () => + Object.defineProperty(domStringMap, "foo", {set: () => {}})); + assert_prop_desc_equals(domStringMap, "foo", undefined); + // writable, enumerable, configurable will be ignored. + Object.defineProperty(domStringMap, "foo", + {value: "foo content", writable: false, + enumerable: false, configurable: false}); + assert_prop_desc_equals(domStringMap, "foo", + {value: "foo content", writable: true, + enumerable: true, configurable: true}); + domStringMap["bar"] = "bar content"; + assert_prop_desc_equals(domStringMap, "bar", + {value: "bar content", writable: true, + enumerable: true, configurable: true}); + // Try to define an accessor property with a supported property name. + assert_throws_js(TypeError, () => + Object.defineProperty(domStringMap, "foo", {get: () => {}})); + assert_throws_js(TypeError, () => + Object.defineProperty(domStringMap, "foo", {set: () => {}})); + assert_prop_desc_equals(domStringMap, "foo", + {value: "foo content", writable: true, + enumerable: true, configurable: true}); +}, "Test [[DefineOwnProperty]] with named property setter support."); diff --git a/tests/wpt/tests/webnn/idlharness.https.any.js b/tests/wpt/tests/webnn/idlharness.https.any.js index 016422f3a3f..65e21d5a1dc 100644 --- a/tests/wpt/tests/webnn/idlharness.https.any.js +++ b/tests/wpt/tests/webnn/idlharness.https.any.js @@ -41,8 +41,8 @@ idl_test( } self.builder = new MLGraphBuilder(self.context); - self.input = builder.input('input', {type: 'float32', dimensions: [1, 1, 5, 5]}); - self.filter = builder.constant({type: 'float32', dimensions: [1, 1, 3, 3]}, new Float32Array(9).fill(1)); + self.input = builder.input('input', {dataType: 'float32', dimensions: [1, 1, 5, 5]}); + self.filter = builder.constant({dataType: 'float32', dimensions: [1, 1, 3, 3]}, new Float32Array(9).fill(1)); self.relu = builder.relu(); self.output = builder.conv2d(input, filter, {activation: relu, inputLayout: "nchw"}); diff --git a/tests/wpt/tests/webnn/resources/test_data/pow.json b/tests/wpt/tests/webnn/resources/test_data/pow.json index b35a96233d0..a097c21d9ef 100644 --- a/tests/wpt/tests/webnn/resources/test_data/pow.json +++ b/tests/wpt/tests/webnn/resources/test_data/pow.json @@ -481,7 +481,7 @@ } }, { - "name": "pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor", + "name": "pow (square) float32 4D base tensor and broadcastable 0D integer exponent scalar", "inputs": { "a": { "shape": [2, 2, 2, 3], @@ -514,7 +514,7 @@ "type": "float32" }, "b": { - "shape": [1], + "shape": [], "data": [2], // square "type": "float32", "constant": true @@ -553,7 +553,7 @@ } }, { - "name": "pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor", + "name": "pow (sqrt) float32 4D positive base tensor and broadcastable 0D integer exponent scalar", "inputs": { "a": { "shape": [2, 2, 2, 3], @@ -586,7 +586,7 @@ "type": "float32" }, "b": { - "shape": [1], + "shape": [], "data": [0.5], // sqrt "type": "float32", "constant": true 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 00c55ded519..e5ebb2aba39 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 @@ -6,37 +6,37 @@ "input": { "shape": [24], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } }, "expected": { "name": "output", - "data": 90.59076690673828, + "data": 10.39477825164795, "type": "float32" } }, @@ -46,37 +46,37 @@ "input": { "shape": [24], "data": [ - -38.42346567796924, - -16.384904409140333, - -46.629634356968474, - -45.81843819006337, - -95.61458783306942, - -90.64578309257007, - -6.279945972307587, - -24.546370226192565, - -82.15882762280646, - -76.8746037170462, - -44.181029848800904, - -97.35032678020788, - -75.52388056554437, - -97.984203822517, - -97.46591756173142, - -85.89237745468532, - -27.34196668605746, - -76.80293743058324, - -93.91905595799426, - -25.62251637659385, - -36.49762778486478, - -96.2163796024006, - -33.56049055386055, - -94.06451375473459 + -4.025670276125137, + -9.44434807349057, + -3.1193981742372, + -5.943697868896303, + -0.37018045102283637, + -4.3971262954406605, + -6.6059682563332744, + -5.534277354031625, + -7.361471172291552, + -1.9987547534811796, + -9.093968158437377, + -8.693618799659165, + -8.416788434713155, + -1.010741070662755, + -9.814584506221344, + -9.725259665431539, + -9.157071010493805, + -0.0016988189527857855, + -9.963414768875285, + -5.991659641614526, + -6.180599892028498, + -1.2336505614624649, + -0.44234340543470196, + -6.990072309054243 ], "type": "float32" } }, "expected": { "name": "output", - "data": -6.279904842376709, + "data": 1.1666961908340454, "type": "float32" } }, @@ -86,37 +86,37 @@ "input": { "shape": [24], "data": [ - 34, - 45, + 1, 5, - 45, - 97, - 11, - 83, - 84, - 17, - 17, - 11, - 20, - 59, - 97, - 44, - 90, - 80, - 59, - 86, - 91, - 33, - 84, - 27, - 27 + 7, + 5, + 7, + 5, + 4, + 2, + 1, + 5, + 8, + 2, + 4, + 1, + 4, + 5, + 4, + 8, + 6, + 2, + 7, + 7, + 8, + 5 ], "type": "float32" } }, "expected": { "name": "output", - "data": 97.69485473632812, + "data": 9.607237815856934, "type": "float32" } }, @@ -126,37 +126,37 @@ "input": { "shape": [24], "data": [ - -91, - -77, + -6, + -3, + -5, + -1, + -9, + -5, + -1, -2, - -34, - -77, - -38, - -92, - -45, - -54, - -11, - -64, - -76, - -53, - -19, - -41, - -83, - -21, - -34, - -73, - -33, -10, - -71, - -82, - -26 + -1, + -5, + -7, + -7, + -3, + -10, + -10, + -8, + -6, + -2, + -6, + -1, + -9, + -5, + -2 ], "type": "float32" } }, "expected": { "name": "output", - "data": -1.999541163444519, + "data": 0.7001367211341858, "type": "float32" } }, @@ -166,37 +166,37 @@ "input": { "shape": [4, 6], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } }, "expected": { "name": "output", - "data": 90.59076690673828, + "data": 10.39477825164795, "type": "float32" } }, @@ -206,37 +206,37 @@ "input": { "shape": [2, 3, 4], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } }, "expected": { "name": "output", - "data": 90.59076690673828, + "data": 10.39477825164795, "type": "float32" } }, @@ -246,37 +246,37 @@ "input": { "shape": [2, 2, 2, 3], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } }, "expected": { "name": "output", - "data": 90.59076690673828, + "data": 10.39477825164795, "type": "float32" } }, @@ -286,37 +286,37 @@ "input": { "shape": [2, 1, 4, 1, 3], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } }, "expected": { "name": "output", - "data": 90.59076690673828, + "data": 10.39477825164795, "type": "float32" } }, @@ -326,30 +326,30 @@ "input": { "shape": [2, 3, 4], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } @@ -361,12 +361,12 @@ "name": "output", "shape": [2, 3], "data": [ - 68.81230926513672, - 90.56975555419922, - 86.6993637084961, - 81.53412628173828, - 64.85645294189453, - 82.32090759277344 + 8.55212688446045, + 3.985233783721924, + 5.52872896194458, + 9.081488609313965, + 6.996237754821777, + 9.759706497192383 ], "type": "float32" } @@ -377,30 +377,30 @@ "input": { "shape": [2, 2, 2, 3], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } @@ -412,12 +412,12 @@ "name": "output", "shape": [2, 3], "data": [ - 81.53375244140625, - 86.180908203125, - 73.63322448730469, - 75.71652221679688, - 90.55726623535156, - 86.7118148803711 + 4.66951847076416, + 9.08117961883545, + 8.533217430114746, + 9.270560264587402, + 6.450263977050781, + 8.917200088500977 ], "type": "float32" } @@ -428,30 +428,30 @@ "input": { "shape": [2, 3, 4], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } @@ -461,7 +461,7 @@ }, "expected": { "name": "output", - "data": 90.59076690673828, + "data": 10.39477825164795, "type": "float32" } }, @@ -471,30 +471,30 @@ "input": { "shape": [2, 3, 4], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } @@ -506,7 +506,7 @@ "name": "output", "shape": [1, 1, 1], "data": [ - 90.59076690673828 + 10.39477825164795 ], "type": "float32" } @@ -517,30 +517,30 @@ "input": { "shape": [2, 2, 2, 3], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } @@ -550,7 +550,7 @@ }, "expected": { "name": "output", - "data": 90.59076690673828, + "data": 10.39477825164795, "type": "float32" } }, @@ -560,30 +560,30 @@ "input": { "shape": [2, 2, 2, 3], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } @@ -595,7 +595,7 @@ "name": "output", "shape": [1, 1, 1, 1], "data": [ - 90.59076690673828 + 10.39477825164795 ], "type": "float32" } @@ -606,30 +606,30 @@ "input": { "shape": [2, 2, 2, 3], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } @@ -641,10 +641,10 @@ "name": "output", "shape": [2, 2], "data": [ - 90.57815551757812, - 86.18093872070312, - 73.63323211669922, - 82.69600677490234 + 8.563796997070312, + 5.500619411468506, + 9.753945350646973, + 9.20864486694336 ], "type": "float32" } @@ -655,30 +655,30 @@ "input": { "shape": [2, 2, 2, 3], "data": [ - 66.1870735698, - 68.69164623929768, - 15.529598361334717, - 65.62419160755422, - 86.18090584091544, - 7.382064010955736, - 1.6365860724411263, - 90.55726458445135, - 86.69934561770543, - 75.7165191675748, - 67.0074429215978, - 9.943717120210827, - 25.779723516449636, - 60.15386290165083, - 73.63322249161153, - 81.53375339603328, - 64.85643136289283, - 54.04977784193004, - 33.380943217138224, - 32.50357565109678, - 61.30902295453489, - 56.95015629977242, - 35.37182024244998, - 82.32090594141081 + 0.7974132976078829, + 5.046889970229296, + 8.520371090961714, + 1.4063042363728728, + 0.11882661415275164, + 0.285854490277071, + 1.9325640291685864, + 3.7939957856803797, + 2.6040233063490925, + 4.937509735746763, + 4.571482286709769, + 0.7865120436262685, + 0.21018670996660216, + 9.063042370844672, + 4.099809553408898, + 4.596248815627706, + 0.2549232349678032, + 1.1594801326588255, + 6.802876838759606, + 5.23432518570901, + 8.914905562420849, + 9.166799240859705, + 5.71750713886038, + 0.3255050658627967 ], "type": "float32" } @@ -690,10 +690,10 @@ "name": "output", "shape": [1, 2, 2, 1], "data": [ - 90.57815551757812, - 86.18093872070312, - 73.63323211669922, - 82.69600677490234 + 8.563796997070312, + 5.500619411468506, + 9.753945350646973, + 9.20864486694336 ], "type": "float32" } diff --git a/tests/wpt/tests/webnn/resources/utils.js b/tests/wpt/tests/webnn/resources/utils.js index 41da4165910..5f9d5c93a41 100644 --- a/tests/wpt/tests/webnn/resources/utils.js +++ b/tests/wpt/tests/webnn/resources/utils.js @@ -2,7 +2,7 @@ const ExecutionArray = ['sync', 'async']; -// https://webmachinelearning.github.io/webnn/#enumdef-mloperandtype +// https://webmachinelearning.github.io/webnn/#enumdef-mloperanddatatype const TypedArrayDict = { float32: Float32Array, int32: Int32Array, @@ -349,7 +349,7 @@ const getPrecisonTolerance = (operationName, metricType, resources) => { * @param {Number} value * @param {String} dataType - A data type string, like "float32", "float16", * more types, please see: - * https://webmachinelearning.github.io/webnn/#enumdef-mloperandtype + * https://webmachinelearning.github.io/webnn/#enumdef-mloperanddatatype * @return {Number} A 64-bit signed integer. */ const getBitwise = (value, dataType) => { @@ -375,7 +375,7 @@ const getBitwise = (value, dataType) => { * @param {Number} nulp - A BigInt value indicates acceptable ULP distance. * @param {String} dataType - A data type string, value: "float32", * more types, please see: - * https://webmachinelearning.github.io/webnn/#enumdef-mloperandtype + * https://webmachinelearning.github.io/webnn/#enumdef-mloperanddatatype * @param {String} description - Description of the condition being tested. */ const assert_array_approx_equals_ulp = (actual, expected, nulp, dataType, description) => { @@ -408,7 +408,7 @@ const assert_array_approx_equals_ulp = (actual, expected, nulp, dataType, descri * @param {Number} tolerance * @param {String} operandType - An operand type string, value: "float32", * more types, please see: - * https://webmachinelearning.github.io/webnn/#enumdef-mloperandtype + * https://webmachinelearning.github.io/webnn/#enumdef-mloperanddatatype * @param {String} metricType - Value: 'ULP', 'ATOL' */ const doAssert = (operationName, actual, expected, tolerance, operandType, metricType) => { @@ -465,7 +465,7 @@ const checkResults = (operationName, namedOutputOperands, outputs, resources) => */ const createConstantOperand = (builder, resources) => { const bufferView = new TypedArrayDict[resources.type](resources.data); - return builder.constant({type: resources.type, dimensions: resources.shape}, bufferView); + return builder.constant({dataType: resources.type, type: resources.type, dimensions: resources.shape}, bufferView); }; /** @@ -478,7 +478,7 @@ const createConstantOperand = (builder, resources) => { const createSingleInputOperand = (builder, resources, inputOperandName) => { inputOperandName = inputOperandName ? inputOperandName : Object.keys(resources.inputs)[0]; const inputResources = resources.inputs[inputOperandName]; - return builder.input(inputOperandName, {type: inputResources.type, dimensions: inputResources.shape}); + return builder.input(inputOperandName, {dataType: inputResources.type, type: inputResources.type, dimensions: inputResources.shape}); }; /** @@ -525,7 +525,7 @@ const buildOperationWithSingleInput = (operationName, builder, resources) => { * @param {Object} resources - Resources used for building a graph * @returns {MLNamedOperands} */ -const buildOperationWithTwoInputs= (operationName, builder, resources) => { +const buildOperationWithTwoInputs = (operationName, builder, resources) => { // For example: MLOperand matmul(MLOperand a, MLOperand b); const namedOutputOperand = {}; const [inputOperandA, inputOperandB] = createMultiInputOperands(builder, resources); @@ -561,7 +561,7 @@ const buildConcat = (operationName, builder, resources) => { const namedOutputOperand = {}; const inputOperands = []; for (let input of resources.inputs) { - inputOperands.push(builder.input(input.name, {type: input.type, dimensions: input.shape})); + inputOperands.push(builder.input(input.name, {dataType: input.type, type: input.type, dimensions: input.shape})); } // invoke builder.concat() namedOutputOperand[resources.expected.name] = builder[operationName](inputOperands, resources.axis); @@ -583,7 +583,7 @@ const buildConvTranspose2d = (operationName, builder, resources) => { return namedOutputOperand; }; -const buildConv2d= (operationName, builder, resources) => { +const buildConv2d = (operationName, builder, resources) => { // MLOperand conv2d(MLOperand input, MLOperand filter, optional MLConv2dOptions options = {}); const namedOutputOperand = {}; const [inputOperand, filterOperand] = createMultiInputOperands(builder, resources); @@ -598,7 +598,7 @@ const buildConv2d= (operationName, builder, resources) => { return namedOutputOperand; }; -const buildGemm= (operationName, builder, resources) => { +const buildGemm = (operationName, builder, resources) => { // MLOperand gemm(MLOperand a, MLOperand b, optional MLGemmOptions options = {}); const namedOutputOperand = {}; const [inputOperandA, inputOperandB] = createMultiInputOperands(builder, resources); diff --git a/tests/wpt/tests/webrtc/RTCConfiguration-rtcpMuxPolicy.html b/tests/wpt/tests/webrtc/RTCConfiguration-rtcpMuxPolicy.html index 48e772fb519..120db20e1ae 100644 --- a/tests/wpt/tests/webrtc/RTCConfiguration-rtcpMuxPolicy.html +++ b/tests/wpt/tests/webrtc/RTCConfiguration-rtcpMuxPolicy.html @@ -114,6 +114,14 @@ }, `setConfiguration({ rtcpMuxPolicy: 'require' }) with initial rtcpMuxPolicy negotiate should throw InvalidModificationError`); + test(() => { + let pc; + pc = new RTCPeerConnection({ rtcpMuxPolicy: 'require' }); + // default rtcpMuxPolicy is 'require', so this is allowed + pc.setConfiguration({}); + assert_equals(pc.getConfiguration().rtcpMuxPolicy, 'require'); + }, `setConfiguration({}) with initial rtcpMuxPolicy require should leave rtcpMuxPolicy to require`); + test(() => { let pc; try { diff --git a/tests/wpt/tests/webrtc/RTCConfiguration-validation.html b/tests/wpt/tests/webrtc/RTCConfiguration-validation.html new file mode 100644 index 00000000000..851ed8d81b1 --- /dev/null +++ b/tests/wpt/tests/webrtc/RTCConfiguration-validation.html @@ -0,0 +1,20 @@ + + +RTCConfiguration validation + + + + + diff --git a/tests/wpt/tests/webrtc/RTCPeerConnection-GC.https.html b/tests/wpt/tests/webrtc/RTCPeerConnection-GC.https.html index 76ae3087e4b..cd9c33224ef 100644 --- a/tests/wpt/tests/webrtc/RTCPeerConnection-GC.https.html +++ b/tests/wpt/tests/webrtc/RTCPeerConnection-GC.https.html @@ -21,8 +21,11 @@ promise_test(async t => { ctx.fillStyle = "blue"; const drawCanvas = () => { ctx.fillRect(0, 0, canvas.width, canvas.height); + t.step_timeout(drawCanvas, 50); }; + drawCanvas(); + let pc1 = new RTCPeerConnection(); let pc2 = new RTCPeerConnection(); @@ -32,6 +35,7 @@ promise_test(async t => { const destVideo = document.createElement('video'); destVideo.autoplay = true; + destVideo.muted = true; const onVideoChange = async () => { const start = performance.now(); const width = destVideo.videoWidth; @@ -41,10 +45,9 @@ promise_test(async t => { if (performance.now() - start > 5000) { throw new Error("Timeout waiting for video size change"); } - drawCanvas(); await Promise.race([ resizeEvent, - new Promise(r => requestAnimationFrame(r)), + new Promise(r => t.step_timeout(r, 50)), ]); } }; @@ -69,7 +72,7 @@ promise_test(async t => { destVideo.srcObject = new MediaStream([(await haveTrackEvent).track]); // Wait for video on the other side. - await onVideoChange(); + await destVideo.play(); const color = getVideoSignal(destVideo); assert_not_equals(color, 0); diff --git a/tests/wpt/tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html b/tests/wpt/tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html index 099fba8eaf7..b1280080382 100644 --- a/tests/wpt/tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html +++ b/tests/wpt/tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html @@ -109,6 +109,7 @@ const mandatory = { "bytesSent", "bytesReceived", "totalRoundTripTime", + "responsesReceived", "currentRoundTripTime" ], RTCIceCandidateStats: [ diff --git a/tests/wpt/tests/webrtc/protocol/crypto-suite.https.html b/tests/wpt/tests/webrtc/protocol/crypto-suite.https.html index f13f221b88d..2c8b1f6491d 100644 --- a/tests/wpt/tests/webrtc/protocol/crypto-suite.https.html +++ b/tests/wpt/tests/webrtc/protocol/crypto-suite.https.html @@ -33,15 +33,10 @@ const acceptableSrtpCiphersuites = new Set([ 'AES_CM_128_HMAC_SHA1_80', ]); -const acceptableTlsGroups = new Set([ - 'P-256', -]); - const acceptableValues = { 'tlsVersion': acceptableTlsVersions, 'dtlsCipher': acceptableDtlsCiphersuites, 'srtpCipher': acceptableSrtpCiphersuites, - 'tlsGroup': acceptableTlsGroups, }; function verifyStat(name, transportStats) { diff --git a/tests/wpt/tests/websockets/handlers/sleep_10_v13_wsh.py b/tests/wpt/tests/websockets/handlers/sleep_10_v13_wsh.py index b0f1ddeb9ad..bdef2f2afdd 100755 --- a/tests/wpt/tests/websockets/handlers/sleep_10_v13_wsh.py +++ b/tests/wpt/tests/websockets/handlers/sleep_10_v13_wsh.py @@ -4,16 +4,7 @@ import sys, urllib, time from mod_pywebsocket import msgutil def web_socket_do_extra_handshake(request): - request.connection.write(b'x') - time.sleep(2) - request.connection.write(b'x') - time.sleep(2) - request.connection.write(b'x') - time.sleep(2) - request.connection.write(b'x') - time.sleep(2) - request.connection.write(b'x') - time.sleep(2) + time.sleep(10) return def web_socket_transfer_data(request): diff --git a/tests/wpt/tests/workers/WorkerNavigator_userAgentData.https.html b/tests/wpt/tests/workers/WorkerNavigator_userAgentData.https.html index 0a0d4ca6c03..8c22d8f8672 100644 --- a/tests/wpt/tests/workers/WorkerNavigator_userAgentData.https.html +++ b/tests/wpt/tests/workers/WorkerNavigator_userAgentData.https.html @@ -39,7 +39,7 @@ assert_equals(e.data.platformVersion, highEntropyValues.platformVersion); assert_equals(e.data.uaFullVersion, highEntropyValues.uaFullVersion); assert_equals(e.data.wow64, highEntropyValues.wow64); - assert_equals(e.data.formFactor, highEntropyValues.formFactor); + assert_equals(e.data.formFactor.join(','), highEntropyValues.formFactor.join(',')); assert_equals(e.data.NavigatorUADataExposed, true); // Architecture should be one of two permitted values. diff --git a/tests/wpt/webgl/meta-legacy-layout/conformance/reading/read-pixels-test.html.ini b/tests/wpt/webgl/meta-legacy-layout/conformance/reading/read-pixels-test.html.ini index 05acbdae111..9571dd686f7 100644 --- a/tests/wpt/webgl/meta-legacy-layout/conformance/reading/read-pixels-test.html.ini +++ b/tests/wpt/webgl/meta-legacy-layout/conformance/reading/read-pixels-test.html.ini @@ -1,6 +1,5 @@ [read-pixels-test.html] bug: https://github.com/servo/servo/issues/12859 - expected: TIMEOUT [WebGL test #49: getError expected: INVALID_OPERATION. Was INVALID_ENUM : Should not be able to read as ALPHA / UNSIGNED_BYTE] expected: FAIL @@ -60,6 +59,3 @@ [WebGL test #39: getError expected: INVALID_ENUM. Was INVALID_OPERATION : Should not be able to read as UNSIGNED_SHORT] expected: FAIL - - [Overall test] - expected: NOTRUN