diff --git a/tests/wpt/metadata-layout-2020/FileAPI/url/url-charset.window.js.ini b/tests/wpt/metadata-layout-2020/FileAPI/url/url-charset.window.js.ini new file mode 100644 index 00000000000..7248ba77bd5 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/FileAPI/url/url-charset.window.js.ini @@ -0,0 +1,5 @@ +[url-charset.window.html] + expected: TIMEOUT + [Blob charset should override any auto-detected charset.] + expected: TIMEOUT + diff --git a/tests/wpt/metadata-layout-2020/bluetooth/device/watchAdvertisements/service-and-manufacturer-data-filtered-from-event.https.window.js.ini b/tests/wpt/metadata-layout-2020/bluetooth/device/watchAdvertisements/service-and-manufacturer-data-filtered-from-event.https.window.js.ini new file mode 100644 index 00000000000..fab1ef3e365 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/bluetooth/device/watchAdvertisements/service-and-manufacturer-data-filtered-from-event.https.window.js.ini @@ -0,0 +1,4 @@ +[service-and-manufacturer-data-filtered-from-event.https.window.html] + [Service and Manufacturer that were not granted with requestDevice() are filtered from the advertisement event.] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-iframe-subresource.tentative.html.ini b/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-iframe-subresource.tentative.html.ini new file mode 100644 index 00000000000..f633e1a05cf --- /dev/null +++ b/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-iframe-subresource.tentative.html.ini @@ -0,0 +1,4 @@ +[schemeful-iframe-subresource.tentative.html] + [SameSite cookies with intervening cross-scheme iframe and subresources] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-navigation.tentative.html.ini b/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-navigation.tentative.html.ini new file mode 100644 index 00000000000..f2b0051bd90 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-navigation.tentative.html.ini @@ -0,0 +1,8 @@ +[schemeful-navigation.tentative.html] + expected: TIMEOUT + [Navigate cross-scheme] + expected: NOTRUN + + [Navigate same-scheme] + expected: TIMEOUT + diff --git a/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-subresource.tentative.html.ini b/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-subresource.tentative.html.ini new file mode 100644 index 00000000000..84db651b6ad --- /dev/null +++ b/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-subresource.tentative.html.ini @@ -0,0 +1,8 @@ +[schemeful-subresource.tentative.html] + expected: TIMEOUT + [Cross-scheme subresources cannot sent lax/strict cookies] + expected: NOTRUN + + [Same-scheme subresources can send lax/strict cookies] + expected: TIMEOUT + diff --git a/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-websockets.sub.tentative.html.ini b/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-websockets.sub.tentative.html.ini new file mode 100644 index 00000000000..eb79022906f --- /dev/null +++ b/tests/wpt/metadata-layout-2020/cookies/schemeful-same-site/schemeful-websockets.sub.tentative.html.ini @@ -0,0 +1,4 @@ +[schemeful-websockets.sub.tentative.html] + [Cross-scheme WebSockets are cross-site] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-003.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-003.html.ini new file mode 100644 index 00000000000..f29da48a2a0 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-003.html.ini @@ -0,0 +1,4 @@ +[hit-test-floats-003.html] + [Miss float below something else] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini deleted file mode 100644 index baa9f1a7541..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[hit-test-floats-005.html] - [Miss clipped float] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/css-flexbox/table-as-item-specified-width.html.ini b/tests/wpt/metadata-layout-2020/css/css-flexbox/table-as-item-specified-width.html.ini new file mode 100644 index 00000000000..469b0231377 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-flexbox/table-as-item-specified-width.html.ini @@ -0,0 +1,2 @@ +[table-as-item-specified-width.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-fonts/ascent-descent-override.html.ini b/tests/wpt/metadata-layout-2020/css/css-fonts/ascent-descent-override.html.ini new file mode 100644 index 00000000000..ae53302eebb --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-fonts/ascent-descent-override.html.ini @@ -0,0 +1,2 @@ +[ascent-descent-override.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-fonts/line-gap-override.html.ini b/tests/wpt/metadata-layout-2020/css/css-fonts/line-gap-override.html.ini new file mode 100644 index 00000000000..78582d2b664 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-fonts/line-gap-override.html.ini @@ -0,0 +1,2 @@ +[line-gap-override.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-012.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-012.html.ini new file mode 100644 index 00000000000..337b5c8d604 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-012.html.ini @@ -0,0 +1,2 @@ +[white-space-pre-wrap-trailing-spaces-012.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-014.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-014.html.ini new file mode 100644 index 00000000000..de0803bc79d --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-014.html.ini @@ -0,0 +1,2 @@ +[white-space-pre-wrap-trailing-spaces-014.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-015.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-015.html.ini new file mode 100644 index 00000000000..4d79bd0c544 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-015.html.ini @@ -0,0 +1,2 @@ +[white-space-pre-wrap-trailing-spaces-015.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPoint-001.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPoint-001.html.ini deleted file mode 100644 index e38782d8c85..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPoint-001.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[elementFromPoint-001.html] - [CSSOM View - 5 - extensions to the Document interface] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini index 3bd0a5266dd..239c35135e4 100644 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini +++ b/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini @@ -1,85 +1,7 @@ [offsetTopLeft-border-box.html] - [container: 11] - expected: FAIL - - [container: 10] - expected: FAIL - - [container: 13] - expected: FAIL - - [container: 12] - expected: FAIL - - [container: 15] - expected: FAIL - - [container: 14] - expected: FAIL - - [container: 17] - expected: FAIL - - [container: 16] - expected: FAIL - - [container: 19] - expected: FAIL - - [container: 18] - expected: FAIL - - [container: 9] - expected: FAIL - - [container: 8] - expected: FAIL - [container: 1] expected: FAIL [container: 0] expected: FAIL - [container: 3] - expected: FAIL - - [container: 2] - expected: FAIL - - [container: 5] - expected: FAIL - - [container: 4] - expected: FAIL - - [container: 7] - expected: FAIL - - [container: 6] - expected: FAIL - - [container: 20] - expected: FAIL - - [container: 21] - expected: FAIL - - [container: 22] - expected: FAIL - - [container: 23] - expected: FAIL - - [container: 24] - expected: FAIL - - [container: 25] - expected: FAIL - - [container: 26] - expected: FAIL - - [container: 27] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html.ini b/tests/wpt/metadata-layout-2020/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html.ini index 104fc27d96b..99cec16c4ae 100644 --- a/tests/wpt/metadata-layout-2020/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html.ini +++ b/tests/wpt/metadata-layout-2020/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html.ini @@ -1,5 +1,4 @@ [CSSStyleSheet-constructable-disallow-import.tentative.html] - expected: ERROR [@import rules are not parsed in CSSStyleSheet.replaceSync] expected: FAIL @@ -10,5 +9,5 @@ expected: FAIL [@import rules should not trigger any loads.] - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata/css/selectors/parsing/is.html.ini b/tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-is.html.ini similarity index 96% rename from tests/wpt/metadata/css/selectors/parsing/is.html.ini rename to tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-is.html.ini index 941fc56bf74..effe1a09629 100644 --- a/tests/wpt/metadata/css/selectors/parsing/is.html.ini +++ b/tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-is.html.ini @@ -1,4 +1,4 @@ -[is.html] +[parse-is.html] [":is(#a)" should be a valid selector] expected: FAIL diff --git a/tests/wpt/metadata/css/selectors/parsing/where.html.ini b/tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-where.html.ini similarity index 96% rename from tests/wpt/metadata/css/selectors/parsing/where.html.ini rename to tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-where.html.ini index 188d18b9618..b5ffbae6945 100644 --- a/tests/wpt/metadata/css/selectors/parsing/where.html.ini +++ b/tests/wpt/metadata-layout-2020/css/selectors/parsing/parse-where.html.ini @@ -1,4 +1,4 @@ -[where.html] +[parse-where.html] [":where(#a)" should be a valid selector] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/selectors/query/query-is.html.ini b/tests/wpt/metadata-layout-2020/css/selectors/query/query-is.html.ini new file mode 100644 index 00000000000..3dea30f295f --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/selectors/query/query-is.html.ini @@ -0,0 +1,19 @@ +[query-is.html] + [Selector '.a :is(:where(:where(.b ~ .c)))" should find the expected elements] + expected: FAIL + + [Selector '.a+:is(.b+.f, :is(.c>.e, .g))" should find the expected elements] + expected: FAIL + + [Selector '.b + :is(.c + .c + .c, .b + .c:not(span), .b + .c + .e) ~ .h" should find the expected elements] + expected: FAIL + + [Selector '.a :is(.b, .c)" should find the expected elements] + expected: FAIL + + [Selector '.a :is(.e+.f, .g>.b, .h)" should find the expected elements] + expected: FAIL + + [Selector '.a :is(.c#d, .e)" should find the expected elements] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/selectors/query/query-where.html.ini b/tests/wpt/metadata-layout-2020/css/selectors/query/query-where.html.ini new file mode 100644 index 00000000000..4c72d25b187 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/selectors/query/query-where.html.ini @@ -0,0 +1,19 @@ +[query-where.html] + [Selector '.a+:where(.b+.f, :where(.c>.e, .g))" should find the expected elements] + expected: FAIL + + [Selector '.a :where(:is(:is(.b ~ .c)))" should find the expected elements] + expected: FAIL + + [Selector '.a :where(.e+.f, .g>.b, .h)" should find the expected elements] + expected: FAIL + + [Selector '.a :where(.c#d, .e)" should find the expected elements] + expected: FAIL + + [Selector '.b + :where(.c + .c + .c, .b + .c:not(span), .b + .c + .e) ~ .h" should find the expected elements] + expected: FAIL + + [Selector '.a :where(.b, .c)" should find the expected elements] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini index 116edd217dc..dd6224425f1 100644 --- a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini @@ -312,27 +312,21 @@ [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] expected: NOTRUN - [ + + diff --git a/tests/wpt/web-platform-tests/cookies/schemeful-same-site/schemeful-navigation.tentative.html b/tests/wpt/web-platform-tests/cookies/schemeful-same-site/schemeful-navigation.tentative.html new file mode 100644 index 00000000000..5ead2a54c7f --- /dev/null +++ b/tests/wpt/web-platform-tests/cookies/schemeful-same-site/schemeful-navigation.tentative.html @@ -0,0 +1,42 @@ + + + + + + + + diff --git a/tests/wpt/web-platform-tests/cookies/schemeful-same-site/schemeful-subresource.tentative.html b/tests/wpt/web-platform-tests/cookies/schemeful-same-site/schemeful-subresource.tentative.html new file mode 100644 index 00000000000..4ba9286c259 --- /dev/null +++ b/tests/wpt/web-platform-tests/cookies/schemeful-same-site/schemeful-subresource.tentative.html @@ -0,0 +1,49 @@ + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/cookies/schemeful-same-site/schemeful-websockets.sub.tentative.html b/tests/wpt/web-platform-tests/cookies/schemeful-same-site/schemeful-websockets.sub.tentative.html new file mode 100644 index 00000000000..8e7c073c997 --- /dev/null +++ b/tests/wpt/web-platform-tests/cookies/schemeful-same-site/schemeful-websockets.sub.tentative.html @@ -0,0 +1,42 @@ + + + + + + + + + +
+ + + diff --git a/tests/wpt/web-platform-tests/css/css-contain/contain-crash.html b/tests/wpt/web-platform-tests/css/css-contain/contain-crash.html new file mode 100644 index 00000000000..373e004c050 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-contain/contain-crash.html @@ -0,0 +1,12 @@ + + + +
+
+ + diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width-2.html b/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width-2.html new file mode 100644 index 00000000000..f04f9e58f7a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width-2.html @@ -0,0 +1,18 @@ + +table is flex item + + + + + + +

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

+ +
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width-3.html b/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width-3.html new file mode 100644 index 00000000000..a13a94f56f6 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width-3.html @@ -0,0 +1,20 @@ + +table is flex item + + + + + + +

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

+ + + +
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width.html b/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width.html index 3a676babde0..83f0511031e 100644 --- a/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width.html +++ b/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-fixed-min-width.html @@ -3,8 +3,12 @@ + + +

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

+
diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-specified-width.html b/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-specified-width.html new file mode 100644 index 00000000000..a4b370eb254 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-flexbox/table-as-item-specified-width.html @@ -0,0 +1,15 @@ + +table is flex item + + + + + + +

Test passes if there is a filled green square.

+ + + +
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-fonts/ascent-descent-override-ref.html b/tests/wpt/web-platform-tests/css/css-fonts/ascent-descent-override-ref.html new file mode 100644 index 00000000000..eeddd2ed86a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-fonts/ascent-descent-override-ref.html @@ -0,0 +1,47 @@ + + +Tests the ascent-override and descent-override descriptors of @font-face + +
+ +
diff --git a/tests/wpt/web-platform-tests/css/css-fonts/ascent-descent-override.html b/tests/wpt/web-platform-tests/css/css-fonts/ascent-descent-override.html new file mode 100644 index 00000000000..baa04703615 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-fonts/ascent-descent-override.html @@ -0,0 +1,43 @@ + + + + + +Tests the ascent-override and descent-override descriptors of @font-face + +
+ X +
diff --git a/tests/wpt/web-platform-tests/css/css-fonts/line-gap-override-ref.html b/tests/wpt/web-platform-tests/css/css-fonts/line-gap-override-ref.html new file mode 100644 index 00000000000..4afa061e833 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-fonts/line-gap-override-ref.html @@ -0,0 +1,26 @@ + + +Tests the ascent-override and descent-override descriptors of @font-face + +
+ + +
diff --git a/tests/wpt/web-platform-tests/css/css-fonts/line-gap-override.html b/tests/wpt/web-platform-tests/css/css-fonts/line-gap-override.html new file mode 100644 index 00000000000..d622fb48ac3 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-fonts/line-gap-override.html @@ -0,0 +1,26 @@ + + + + + +Tests the line-gap-override descriptor of @font-face + + +
+ X
+ X +
diff --git a/tests/wpt/web-platform-tests/css/css-fonts/metrics-override-normal-keyword-ref.html b/tests/wpt/web-platform-tests/css/css-fonts/metrics-override-normal-keyword-ref.html new file mode 100644 index 00000000000..3a8e89ed80c --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-fonts/metrics-override-normal-keyword-ref.html @@ -0,0 +1,12 @@ + + + + + +Tests the 'normal' keyword on descriptors ascent-override, descent-override and line-gap-override + +
Test
Test
+ +
Test
Test
+ +
Test
Test
diff --git a/tests/wpt/web-platform-tests/css/css-fonts/metrics-override-normal-keyword.html b/tests/wpt/web-platform-tests/css/css-fonts/metrics-override-normal-keyword.html new file mode 100644 index 00000000000..cf8c711ef27 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-fonts/metrics-override-normal-keyword.html @@ -0,0 +1,34 @@ + + + + + +Tests the 'normal' keyword on descriptors ascent-override, descent-override and line-gap-override + + +
Test
Test
+ +
Test
Test
+ +
Test
Test
diff --git a/tests/wpt/web-platform-tests/css/css-fonts/variations/font-parse-numeric-stretch-style-weight.html b/tests/wpt/web-platform-tests/css/css-fonts/variations/font-parse-numeric-stretch-style-weight.html index 95fbb9c6994..19c0ded19e0 100644 --- a/tests/wpt/web-platform-tests/css/css-fonts/variations/font-parse-numeric-stretch-style-weight.html +++ b/tests/wpt/web-platform-tests/css/css-fonts/variations/font-parse-numeric-stretch-style-weight.html @@ -1,11 +1,9 @@ - - - - - - + + + + + + + +
+ +
+ diff --git a/tests/wpt/web-platform-tests/css/css-text/altering-dom-crash.html b/tests/wpt/web-platform-tests/css/css-text/altering-dom-crash.html new file mode 100644 index 00000000000..227956e7a31 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/altering-dom-crash.html @@ -0,0 +1,18 @@ + +CSS Text Test: Altering the DOM generates empty text elements that cause line-breaking to crash + + + + x
+ + + diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-012-ref.html b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-012-ref.html new file mode 100644 index 00000000000..c4751fa5eae --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-012-ref.html @@ -0,0 +1,15 @@ + + +CSS test Reference + + + + +

This test passes if the line is broken after the 2nd white space, which hangs (blue). +

XX X
X
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-013-ref.html b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-013-ref.html new file mode 100644 index 00000000000..af1f6bf268b --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-013-ref.html @@ -0,0 +1,13 @@ + + + +CSS test Reference + + + +

This test passes if the line is after the white space, which hangs (blue). + +

ああ
X
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-014-ref.html b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-014-ref.html new file mode 100644 index 00000000000..29f69dc1421 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-014-ref.html @@ -0,0 +1,15 @@ + + +CSS test Reference + + + + +

This test passes if the line is broken after the 2nd white space, which hangs (blue). +

XX X
XXXX
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-015-ref.html b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-015-ref.html new file mode 100644 index 00000000000..ffcabadeb32 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-015-ref.html @@ -0,0 +1,15 @@ + + +CSS test Reference + + + + +

This test passes if the line is broken after the 2nd white space, which hangs (blue). +

XX XX
X
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-012-ref.html b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-012-ref.html new file mode 100644 index 00000000000..fc485c42b17 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-012-ref.html @@ -0,0 +1,15 @@ + + +CSS test Reference + + + + +

This test passes if the line is broken after the 2nd white space, which hangs (blue). +

XX X
X
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-013-ref.html b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-013-ref.html new file mode 100644 index 00000000000..ca5032540b2 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-013-ref.html @@ -0,0 +1,13 @@ + + + +CSS test Reference + + + +

This test passes if the line is after the white space, which hangs (blue). + +

ああ
X
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-014-ref.html b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-014-ref.html new file mode 100644 index 00000000000..0df3b9f7389 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-014-ref.html @@ -0,0 +1,15 @@ + + +CSS test Reference + + + + +

This test passes if the line is broken after the 2nd white space, which hangs (blue). +

XX X
XXXX
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-015-ref.html b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-015-ref.html new file mode 100644 index 00000000000..0faae57a3e7 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-pre-wrap-trailing-spaces-alt-015-ref.html @@ -0,0 +1,15 @@ + + +CSS test Reference + + + + +

This test passes if the line is broken after the 2nd white space, which hangs (blue). +

XX XX
X
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-wrap-after-nowrap-001-ref.html b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-wrap-after-nowrap-001-ref.html index 80b2260cbbe..71e1c82465c 100644 --- a/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-wrap-after-nowrap-001-ref.html +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/reference/white-space-wrap-after-nowrap-001-ref.html @@ -24,7 +24,5 @@ div {


-

-

diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-012.html b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-012.html new file mode 100644 index 00000000000..4235cf6e2cb --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-012.html @@ -0,0 +1,25 @@ + + +CSS Text test: hanging trailing spaces with white-space:pre-wrap + + + + + + + + + + + + +

This test passes if the line is broken after the 2nd white space, which hangs (blue). +

XX X X
+ diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-013.html b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-013.html new file mode 100644 index 00000000000..df4818c69c6 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-013.html @@ -0,0 +1,25 @@ + + + +CSS Text test: hanging trailing spaces with white-space:pre-wrap + + + + + + + + + + + +

This test passes if the line is after the white space, which hangs (blue). + +

ああ X
+ diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-014.html b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-014.html new file mode 100644 index 00000000000..02e776b82e6 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-014.html @@ -0,0 +1,26 @@ + + +CSS Text test: hanging trailing spaces with white-space:pre-wrap + + + + + + + + + + + + +

This test passes if the line is broken after the 2nd white space, which hangs (blue). +

XX X XXXX
+ diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-015.html b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-015.html new file mode 100644 index 00000000000..326dcb143e7 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-015.html @@ -0,0 +1,25 @@ + + +CSS Text test: hanging trailing spaces with white-space:pre-wrap + + + + + + + + + + + + +

This test passes if the line is broken after the 2nd white space, which hangs (blue). +

XX XX X
+ diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-wrap-after-nowrap-001.html b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-wrap-after-nowrap-001.html index a484f1cf916..5947c289e87 100644 --- a/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-wrap-after-nowrap-001.html +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-wrap-after-nowrap-001.html @@ -35,7 +35,5 @@ div {
-
-
diff --git a/tests/wpt/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/logical.html b/tests/wpt/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/logical.html index e8085b02787..c068edf751c 100644 --- a/tests/wpt/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/logical.html +++ b/tests/wpt/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/logical.html @@ -1,6 +1,6 @@ -margin properties +logical margin, inset, padding & border properties @@ -13,9 +13,15 @@ diff --git a/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html b/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html index 05b73944d66..d49a084fbe5 100644 --- a/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html +++ b/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html @@ -21,7 +21,7 @@ test(() => { assert_throws_dom("SyntaxError", () => { (new CSSStyleSheet).insertRule(import_text) }); }, 'Inserting an @import rule through insertRule on a constructed stylesheet throws an exception'); -async_test(async t => { +promise_test(async t => { const importUrl = "support/constructable-import.css"; const sheet = new CSSStyleSheet(); @@ -32,17 +32,19 @@ async_test(async t => { const timeAfterImportsInvoked = performance.now(); let link = document.createElement("link"); + t.add_cleanup(() => { link.remove(); }); link.rel = "stylesheet"; link.href = importUrl; - link.addEventListener("error", t.unreached_func("Load shouldn't fail")); - link.addEventListener("load", t.step_func_done(event => { - let entries = window.performance.getEntriesByType('resource').filter(entry => entry.name.includes(importUrl)); - assert_equals(entries.length, 1, "There should be only one entry for the import URL"); - assert_greater_than_equal(entries[0].startTime, timeAfterImportsInvoked, "The entry's start time should be after all throws"); - link.remove(); - })); - document.body.appendChild(link); + await new Promise((resolve, reject) => { + link.addEventListener("load", resolve); + link.addEventListener("error", reject); + document.body.appendChild(link); + }); + + let entries = window.performance.getEntriesByType('resource').filter(entry => entry.name.includes(importUrl)); + assert_equals(entries.length, 1, "There should be only one entry for the import URL"); + assert_greater_than_equal(entries[0].startTime, timeAfterImportsInvoked, "The entry's start time should be after all throws"); }, "@import rules should not trigger any loads.") promise_test(() => { diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/attribute.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-attribute.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/attribute.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-attribute.html diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/child.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-child.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/child.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-child.html diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/class.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-class.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/class.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-class.html diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/descendant.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-descendant.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/descendant.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-descendant.html diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/id.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-id.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/id.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-id.html diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/is.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-is.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/is.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-is.html diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/not.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-not.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/not.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-not.html diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/sibling.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-sibling.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/sibling.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-sibling.html diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/universal.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-universal.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/universal.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-universal.html diff --git a/tests/wpt/web-platform-tests/css/selectors/parsing/where.html b/tests/wpt/web-platform-tests/css/selectors/parsing/parse-where.html similarity index 100% rename from tests/wpt/web-platform-tests/css/selectors/parsing/where.html rename to tests/wpt/web-platform-tests/css/selectors/parsing/parse-where.html diff --git a/tests/wpt/web-platform-tests/css/selectors/query/query-is.html b/tests/wpt/web-platform-tests/css/selectors/query/query-is.html new file mode 100644 index 00000000000..918eaee7019 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/selectors/query/query-is.html @@ -0,0 +1,57 @@ + + + + + Selectors Level 4: query using :is() + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + diff --git a/tests/wpt/web-platform-tests/css/selectors/query/query-where.html b/tests/wpt/web-platform-tests/css/selectors/query/query-where.html new file mode 100644 index 00000000000..b7cf5e1b204 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/selectors/query/query-where.html @@ -0,0 +1,57 @@ + + + + + Selectors Level 4: query using :where() + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + diff --git a/tests/wpt/web-platform-tests/css/support/query-testcommon.js b/tests/wpt/web-platform-tests/css/support/query-testcommon.js new file mode 100644 index 00000000000..73246e17e87 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/support/query-testcommon.js @@ -0,0 +1,18 @@ +'use strict'; + +function test_query_selector(parentNode, selector, expected) { + if (!Array.isArray(expected)) + expected = [ expected ]; + + test(function(){ + const elementList = parentNode.querySelectorAll(selector); + assert_equals(elementList.length, expected.length); + + for (let i = 0; i < elementList.length; ++i) { + if (typeof expected[i] === 'string') + assert_equals(elementList[i].id, expected[i]); + else + assert_equals(elementList[i], expected[i]); + } + }, "Selector '" + selector + '" should find the expected elements'); +} diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-report-only.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-report-only.tentative.html deleted file mode 100644 index 03fa5b68a3e..00000000000 --- a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-report-only.tentative.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - Test for font-display-late-swap feature policy set to report-only - - - - - - -

- Tests if the correct number of violation reports are generated and each report corresponds to this feature. - 4 reports should be created out of the 6 options below (reports for all except for 'fallback' and 'optional'). -

- - - - - - - - - -
not-setautoblockswapfallbackoptional
- - - \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-reporting.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-reporting.tentative.html deleted file mode 100644 index db871d19f7e..00000000000 --- a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-reporting.tentative.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - Test for font-display-late-swap feature policy set to reporting - - - - - - -

- Tests if the correct number of violation reports are generated and each report corresponds to this feature. - 4 reports should be created out of the 6 options below (reports for all except for 'fallback' and 'optional'). -

- - - - - - - - - -
not-setautoblockswapfallbackoptional
- - - \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-01.tentative-ref.html b/tests/wpt/web-platform-tests/document-policy/font-display/override-to-optional.tentative-ref.html similarity index 100% rename from tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-01.tentative-ref.html rename to tests/wpt/web-platform-tests/document-policy/font-display/override-to-optional.tentative-ref.html diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-01.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/override-to-optional.tentative.html similarity index 95% rename from tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-01.tentative.html rename to tests/wpt/web-platform-tests/document-policy/font-display/override-to-optional.tentative.html index cad4c18015c..26927bb8c66 100644 --- a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-01.tentative.html +++ b/tests/wpt/web-platform-tests/document-policy/font-display/override-to-optional.tentative.html @@ -2,7 +2,7 @@ Test for no-font-display-late-swap document policy behavior - +

Tests if font-display is set to optional for each option except for when it is set to fallback

diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-01.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/override-to-optional.tentative.html.headers similarity index 100% rename from tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-01.tentative.html.headers rename to tests/wpt/web-platform-tests/document-policy/font-display/override-to-optional.tentative.html.headers diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-auto.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-auto.tentative.html new file mode 100644 index 00000000000..9eea350de43 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-auto.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'auto' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-report-only.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-auto.tentative.html.headers similarity index 100% rename from tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-report-only.tentative.html.headers rename to tests/wpt/web-platform-tests/document-policy/font-display/report-only-auto.tentative.html.headers diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-blank.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-blank.tentative.html new file mode 100644 index 00000000000..628dbccb4dd --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-blank.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value empty + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-blank.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-blank.tentative.html.headers new file mode 100644 index 00000000000..15091272777 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-blank.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy-Report-Only: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-block.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-block.tentative.html new file mode 100644 index 00000000000..a3836953176 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-block.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'block' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-block.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-block.tentative.html.headers new file mode 100644 index 00000000000..15091272777 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-block.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy-Report-Only: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-fallback.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-fallback.tentative.html new file mode 100644 index 00000000000..a03015e47dd --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-fallback.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'fallback' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-fallback.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-fallback.tentative.html.headers new file mode 100644 index 00000000000..15091272777 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-fallback.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy-Report-Only: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-optional.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-optional.tentative.html new file mode 100644 index 00000000000..2a4673f1533 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-optional.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'optional' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-optional.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-optional.tentative.html.headers new file mode 100644 index 00000000000..15091272777 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-optional.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy-Report-Only: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-swap.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-swap.tentative.html new file mode 100644 index 00000000000..ad1f437f8cc --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-swap.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'swap' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/report-only-swap.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-swap.tentative.html.headers new file mode 100644 index 00000000000..15091272777 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/report-only-swap.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy-Report-Only: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-auto.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-auto.tentative.html new file mode 100644 index 00000000000..01857dd90e3 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-auto.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'auto' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-reporting.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-auto.tentative.html.headers similarity index 100% rename from tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-reporting.tentative.html.headers rename to tests/wpt/web-platform-tests/document-policy/font-display/reporting-auto.tentative.html.headers diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-blank.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-blank.tentative.html new file mode 100644 index 00000000000..6521ae131ad --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-blank.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value empty + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-blank.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-blank.tentative.html.headers new file mode 100644 index 00000000000..273ca3564df --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-blank.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-block.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-block.tentative.html new file mode 100644 index 00000000000..60403c67a4b --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-block.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'block' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-block.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-block.tentative.html.headers new file mode 100644 index 00000000000..273ca3564df --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-block.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-fallback.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-fallback.tentative.html new file mode 100644 index 00000000000..a03015e47dd --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-fallback.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'fallback' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-fallback.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-fallback.tentative.html.headers new file mode 100644 index 00000000000..273ca3564df --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-fallback.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-optional.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-optional.tentative.html new file mode 100644 index 00000000000..2a4673f1533 --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-optional.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'optional' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-optional.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-optional.tentative.html.headers new file mode 100644 index 00000000000..273ca3564df --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-optional.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-swap.tentative.html b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-swap.tentative.html new file mode 100644 index 00000000000..53d823f178c --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-swap.tentative.html @@ -0,0 +1,9 @@ + +Test for font-display-late-swap document policy with font display value 'swap' + + + + + diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/reporting-swap.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-swap.tentative.html.headers new file mode 100644 index 00000000000..273ca3564df --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/reporting-swap.tentative.html.headers @@ -0,0 +1 @@ +Document-Policy: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/font-display/resources/font-display-reporting-helper.js b/tests/wpt/web-platform-tests/document-policy/font-display/resources/font-display-reporting-helper.js new file mode 100644 index 00000000000..f3c8a22b7ad --- /dev/null +++ b/tests/wpt/web-platform-tests/document-policy/font-display/resources/font-display-reporting-helper.js @@ -0,0 +1,81 @@ +function check_report_format(report, expected_url, expected_disposition) { + assert_equals(report.type, 'document-policy-violation'); + assert_equals(report.url, expected_url); + assert_equals(report.body.featureId, 'font-display-late-swap'); + assert_equals(report.body.disposition, expected_disposition); + assert_true('sourceFile' in report.body); + assert_true('lineNumber' in report.body); + assert_true('columnNumber' in report.body); +} + +function check_violation_report_format(report, expected_url) { + check_report_format(report, expected_url, 'enforce'); +} + +function check_report_only_report_format(report, expected_url) { + check_report_format(report, expected_url, 'report'); +} + +function makeFontFaceDeclaration(family, display) { + url = '/fonts/Ahem.ttf?pipe=trickle(d1)'; // Before the swap period is over + return `@font-face { font-family: ${family}; src: url("${url}"); font-display: ${display}; }`; +} + +/** + * Run font-display test with given parameters. + * + * A violation report is expected with fontDisplayValue set to + * ['', 'auto', 'block', 'swap'] + * + * No violation report is expected with fontDisplayValue set to + * ['fallback', 'optional'] + + * @param {String} fontDisplayValue + * @param {(Report, String) => () | undefined} format_check pass a callback to + * check report format if a violation report is expected. If no report is + * expected to be generated, leave this argument undefined. + */ +function runTest(fontDisplayValue, format_check) { + window.onload = () => { + const family = fontDisplayValue + '-face'; + const rule = makeFontFaceDeclaration(family, fontDisplayValue); + + const style = document.createElement('style'); + style.innerHTML = rule; + document.body.appendChild(style); + + const div = document.createElement('div'); + div.textContent = 'a'; + div.style.fontFamily = family + ', Arial'; + document.body.appendChild(div); + }; + + const t = async_test('font-display-late-swap Report Format'); + + new ReportingObserver( + t.step_func_done((reports, _) => { + assert_equals(reports.length, 1); + assert_true(!!format_check); + format_check(reports[0], document.location.href); + }), { + types: ['document-policy-violation'], + buffered: true + } + ).observe(); + + t.step_timeout(t.step_func_done(() => { + assert_false(!!format_check, 'Expected violation report but did not get one.'); + }), 400); // 400ms should be sufficient to observe the violation report. +} + +function testFontDisplayPolicyViolationGenerated(fontDisplayValue) { + runTest(fontDisplayValue, check_violation_report_format); +} + +function testFontDisplayPolicyReportOnlyGenerated(fontDisplayValue) { + runTest(fontDisplayValue, check_report_only_report_format); +} + +function testCompliantWithFontDisplayPolicy(fontDisplayValue) { + runTest(fontDisplayValue); +} \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/generic-sensor/resources/iframe_sensor_handler.html b/tests/wpt/web-platform-tests/generic-sensor/resources/iframe_sensor_handler.html index d516a40a249..16fcdc49b17 100644 --- a/tests/wpt/web-platform-tests/generic-sensor/resources/iframe_sensor_handler.html +++ b/tests/wpt/web-platform-tests/generic-sensor/resources/iframe_sensor_handler.html @@ -5,11 +5,8 @@ diff --git a/tests/wpt/web-platform-tests/html/browsers/windows/clear-window-name.https.html b/tests/wpt/web-platform-tests/html/browsers/windows/clear-window-name.https.html new file mode 100644 index 00000000000..1ddbb7f3111 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/windows/clear-window-name.https.html @@ -0,0 +1,114 @@ + + + + Clear window.name when cross-origin + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/browsers/windows/resources/restore-window-name-back.sub.html b/tests/wpt/web-platform-tests/html/browsers/windows/resources/restore-window-name-back.sub.html new file mode 100644 index 00000000000..ea2c3a92b48 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/windows/resources/restore-window-name-back.sub.html @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/html/browsers/windows/resources/restore-window-name.sub.html b/tests/wpt/web-platform-tests/html/browsers/windows/resources/restore-window-name.sub.html new file mode 100644 index 00000000000..a1e573a7c08 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/windows/resources/restore-window-name.sub.html @@ -0,0 +1,43 @@ + + + +popup helper for restore window.name test + + + +

Please first click the 'start test' link. And then, click the 'Verify Result' button to verify the result. You should get a PASS after clicking the button

+ start test
+ + Result: + + diff --git a/tests/wpt/web-platform-tests/html/browsers/windows/resources/window-name-stash.py b/tests/wpt/web-platform-tests/html/browsers/windows/resources/window-name-stash.py new file mode 100644 index 00000000000..411a4587bce --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/windows/resources/window-name-stash.py @@ -0,0 +1,13 @@ +def main(request, response): + key = request.GET.first(b"id") + if request.method == "POST": + value = request.GET.first(b"value") + request.server.stash.take(key) + request.server.stash.put(key, value) + return b"OK" + else: + value = request.server.stash.take(key) + if value is not None: + return value + else: + return b"NONE" diff --git a/tests/wpt/web-platform-tests/html/browsers/windows/resources/window-name.sub.html b/tests/wpt/web-platform-tests/html/browsers/windows/resources/window-name.sub.html new file mode 100644 index 00000000000..378f588e6b3 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/windows/resources/window-name.sub.html @@ -0,0 +1,53 @@ + +popup helper + diff --git a/tests/wpt/web-platform-tests/html/browsers/windows/restore-window-name-manual.https.html b/tests/wpt/web-platform-tests/html/browsers/windows/restore-window-name-manual.https.html new file mode 100644 index 00000000000..13e8381e313 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/windows/restore-window-name-manual.https.html @@ -0,0 +1,20 @@ + + + + Restore window.name when navigating back from a cross-origin + + + + + + +

Please click the following link and follow the instructions in the page for testing

+ run test + + diff --git a/tests/wpt/web-platform-tests/html/canvas/element/manual/context-attributes/canvas-with-padding.html b/tests/wpt/web-platform-tests/html/canvas/element/manual/context-attributes/canvas-with-padding.html new file mode 100644 index 00000000000..5a93ef680a6 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/canvas/element/manual/context-attributes/canvas-with-padding.html @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/html/canvas/element/manual/imagebitmap/canvas-ImageBitmap-close.html b/tests/wpt/web-platform-tests/html/canvas/element/manual/imagebitmap/canvas-ImageBitmap-close.html new file mode 100644 index 00000000000..fca82745289 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/canvas/element/manual/imagebitmap/canvas-ImageBitmap-close.html @@ -0,0 +1,89 @@ + + +

Tests that the close method of ImageBitmap does dispose the image data.

+ + + + diff --git a/tests/wpt/web-platform-tests/html/canvas/element/manual/imagebitmap/worker-onmessage-noop.js b/tests/wpt/web-platform-tests/html/canvas/element/manual/imagebitmap/worker-onmessage-noop.js new file mode 100644 index 00000000000..c0a352b4d9e --- /dev/null +++ b/tests/wpt/web-platform-tests/html/canvas/element/manual/imagebitmap/worker-onmessage-noop.js @@ -0,0 +1,3 @@ +self.onmessage = function(e) { +}; + diff --git a/tests/wpt/web-platform-tests/html/canvas/element/manual/the-canvas-state/2d.zero.size.canvas.html b/tests/wpt/web-platform-tests/html/canvas/element/manual/the-canvas-state/2d.zero.size.canvas.html new file mode 100644 index 00000000000..273e5c74845 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/canvas/element/manual/the-canvas-state/2d.zero.size.canvas.html @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro.https.html index fc7c192b6b6..7adca0ae67a 100644 --- a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro.https.html +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro.https.html @@ -1,6 +1,6 @@ COOP reports are to the opener when the opener used COOP-RO+COEP and then it - tries to access a cross-origin openee. + tries to access a same-origin openee. @@ -13,8 +13,7 @@ const directory = "/html/cross-origin-opener-policy/reporting"; const executor_path = directory + "/resources/executor.html?pipe="; -const same_origin = get_host_info().HTTPS_REMOTE_ORIGIN; -const cross_origin = get_host_info().HTTPS_REMOTE_ORIGIN; +const same_origin = get_host_info().HTTPS_ORIGIN; const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)'; promise_test(async t => { @@ -29,7 +28,7 @@ promise_test(async t => { opener_reportTo.coopReportOnlySameOriginHeader + coep_header + `&uuid=${opener_token}`; - // The "openee" window. This is cross origin with the "opener". + // The "openee" window. This is same origin with the "opener". const openee_report_token= token(); const openee_token = token(); const openee_url = same_origin + executor_path + `&uuid=${openee_token}`; diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro_cross-origin.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro_cross-origin.https.html new file mode 100644 index 00000000000..82316392410 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-openee_coop-ro_cross-origin.https.html @@ -0,0 +1,73 @@ + + COOP reports are to the opener when the opener used COOP-RO+COEP and then it + tries to access a cross-origin openee. + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-opener_coop-ro.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-opener_coop-ro.https.html index d7384e21195..264561a93a8 100644 --- a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-opener_coop-ro.https.html +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-opener_coop-ro.https.html @@ -1,6 +1,6 @@ COOP reports are sent when the openee used COOP-RO+COEP and then tries to - access its opener. + access its same-origin opener. @@ -13,7 +13,7 @@ const directory = "/html/cross-origin-opener-policy/reporting"; const executor_path = directory + "/resources/executor.html?pipe="; -const cross_origin = get_host_info().HTTPS_REMOTE_ORIGIN; +const same_origin = get_host_info().HTTPS_ORIGIN; const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)'; promise_test(async t => { @@ -21,7 +21,7 @@ promise_test(async t => { const openee_token = token(); const reportTo = reportToHeaders(report_token); - const openee_url = cross_origin + executor_path + + const openee_url = same_origin + executor_path + reportTo.header + reportTo.coopReportOnlySameOriginHeader + coep_header + `&uuid=${openee_token}`; const openee = window.open(openee_url); diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-opener_coop-ro_cross-origin.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-opener_coop-ro_cross-origin.https.html new file mode 100644 index 00000000000..8510334df16 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-opener_coop-ro_cross-origin.https.html @@ -0,0 +1,47 @@ + + COOP reports are sent when the openee used COOP-RO+COEP and then tries to + access its cross-origin opener. + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-other_coop-ro_cross-origin.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-other_coop-ro_cross-origin.https.html new file mode 100644 index 00000000000..4505c4c8282 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-from-coop-page-to-other_coop-ro_cross-origin.https.html @@ -0,0 +1,88 @@ + + One window accesses a second one. They are aren't related by an opener/openee + relationship. The first window has set + Cross-Origin-Opener-Policy-Report-Only:same-origin, so it receives a + "access-from-coop-page-to-other" report. + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-openee_coop-ro.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-openee_coop-ro.https.html index e54d5e3fe1c..dbd710662ba 100644 --- a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-openee_coop-ro.https.html +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-openee_coop-ro.https.html @@ -1,6 +1,6 @@ COOP reports are to the opener when the opener used COOP-RO+COEP and then its - cross-origin openee tries to access it. + same-origin openee tries to access it. @@ -13,8 +13,7 @@ const directory = "/html/cross-origin-opener-policy/reporting"; const executor_path = directory + "/resources/executor.html?pipe="; -const same_origin = get_host_info().HTTPS_REMOTE_ORIGIN; -const cross_origin = get_host_info().HTTPS_REMOTE_ORIGIN; +const same_origin = get_host_info().HTTPS_ORIGIN; const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)'; promise_test(async t => { @@ -29,7 +28,7 @@ promise_test(async t => { opener_reportTo.coopReportOnlySameOriginHeader + coep_header + `&uuid=${opener_token}`; - // The "openee" window. This is cross origin with the "opener". + // The "openee" window. This is same origin with the "opener". const openee_report_token= token(); const openee_token = token(); const openee_url = same_origin + executor_path + `&uuid=${openee_token}`; diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-openee_coop-ro_cross-origin.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-openee_coop-ro_cross-origin.https.html new file mode 100644 index 00000000000..9ee8589c16e --- /dev/null +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-openee_coop-ro_cross-origin.https.html @@ -0,0 +1,67 @@ + + COOP reports are to the opener when the opener used COOP-RO+COEP and then its + cross-origin openee tries to access it. + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-opener_coop-ro.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-opener_coop-ro.https.html index ef969738c33..41012fdb55a 100644 --- a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-opener_coop-ro.https.html +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-opener_coop-ro.https.html @@ -1,6 +1,6 @@ - COOP reports are sent when the openee used COOP-RO+COEP and then its opener - tries to access it. + COOP reports are sent when the openee used COOP-RO+COEP and then its + same-origin opener tries to access it. @@ -13,7 +13,7 @@ const directory = "/html/cross-origin-opener-policy/reporting"; const executor_path = directory + "/resources/executor.html?pipe="; -const cross_origin = get_host_info().HTTPS_REMOTE_ORIGIN; +const same_origin = get_host_info().HTTPS_ORIGIN; const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)'; promise_test(async t => { @@ -22,8 +22,8 @@ promise_test(async t => { const opener_token = token(); // The current test window. const reportTo = reportToHeaders(report_token); - const openee_url = cross_origin + executor_path + - reportTo.header + reportTo.coopReportOnlySameOriginHeader + coep_header + + const openee_url = same_origin + executor_path + reportTo.header + + reportTo.coopReportOnlySameOriginHeader + coep_header + `&uuid=${openee_token}`; const openee = window.open(openee_url); t.add_cleanup(() => send(openee_token, "window.close()")) diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-opener_coop-ro_cross-origin.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-opener_coop-ro_cross-origin.https.html new file mode 100644 index 00000000000..1712e153b6d --- /dev/null +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-opener_coop-ro_cross-origin.https.html @@ -0,0 +1,54 @@ + + COOP reports are sent when the openee used COOP-RO+COEP and then its + cross-origin opener tries to access it. + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-other_coop-ro_cross-origin.https.html b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-other_coop-ro_cross-origin.https.html new file mode 100644 index 00000000000..4cc49fc62a7 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/cross-origin-opener-policy/reporting/access-reporting/access-to-coop-page-from-other_coop-ro_cross-origin.https.html @@ -0,0 +1,76 @@ + + One window accesses a second one. They are aren't related by an opener/openee + relationship. The second window has set + Cross-Origin-Opener-Policy-Report-Only:same-origin, so it receives a + "access-to-coop-page-from-other" report. + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/form-controls/placeholder-opacity-default.tentative.html b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/form-controls/placeholder-opacity-default.tentative.html new file mode 100644 index 00000000000..39ad44cfc01 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/form-controls/placeholder-opacity-default.tentative.html @@ -0,0 +1,25 @@ + + + + + Placeholder Test: opacity default value + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-hover.html b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-hover.html index 461917a9a0d..170e3cc8749 100644 --- a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-hover.html +++ b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-hover.html @@ -9,6 +9,7 @@ legend:hover { background: lime; } +

Header

Legend
diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/historical.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/historical.html index 850a52f4649..0bc8b857b44 100644 --- a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/historical.html +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/historical.html @@ -13,4 +13,8 @@ function t(property) { // added in https://github.com/whatwg/html/commit/f6490f17f577fa3478791b29ad8c2b586418001f // removed in https://github.com/whatwg/html/commit/1490eba4dba5ab476f0981443a86c01acae01311 t('seamless'); + +// Added by https://github.com/whatwg/html/pull/2133 +// Removed by https://github.com/whatwg/html/pull/5915 +t('allowPaymentRequest'); diff --git a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-delayed.html b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-delayed.html index f9f9a1c0610..acdeab59ff4 100644 --- a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-delayed.html +++ b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-delayed.html @@ -10,16 +10,17 @@ async_test(t => { const iframe = document.createElement("iframe"); iframe.onerror = t.unreached_func("Error loading iframe"); + let onLoadWasCalled = false; iframe.onload = t.step_func(() => { + onLoadWasCalled = true; assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n"); // Don't call the event handler another time after document.write. iframe.onload = null; - onLoadWasCalled = true; }); document.addEventListener("documentWriteDone", t.step_func_done(() => { - assert_equals(iframe.onload, null); - assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n"); + assert_true(onLoadWasCalled, "onload must be called"); + assert_equals(iframe.contentDocument.body.textContent, "document.write body contents\n"); })); iframe.src = "module-delayed-iframe.html"; diff --git a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-dynamic-import.html b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-dynamic-import.html index 02c6b9cf8d2..5939968f053 100644 --- a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-dynamic-import.html +++ b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-dynamic-import.html @@ -8,14 +8,16 @@ async_test(t => { const iframe = document.createElement("iframe"); iframe.onerror = t.unreached_func("Error loading iframe"); + let onLoadWasCalled = false; iframe.onload = t.step_func(() => { - assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n"); - iframe.onload = null; onLoadWasCalled = true; + assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n"); + // Don't call the event handler another time after document.write. + iframe.onload = null; }); document.addEventListener("documentWriteDone", t.step_func_done(() => { - assert_true(onLoadWasCalled); + assert_true(onLoadWasCalled, "onload must be called"); assert_equals(iframe.contentDocument.body.textContent, "document.write body contents\n"); })); diff --git a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-static-import-delayed.html b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-static-import-delayed.html index 498d1012a07..a6e003907f6 100644 --- a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-static-import-delayed.html +++ b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-static-import-delayed.html @@ -8,16 +8,17 @@ async_test(t => { // Expose {test} in the iframe for using the step_timeout helper. document.test = t; const iframe = document.createElement("iframe"); - iframe.onerror = t.unreached_func("Error loading iframe"); + let onLoadWasCalled = false; iframe.onload = t.step_func(() => { - assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n"); - iframe.onload = null; onLoadWasCalled = true; + assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n"); + // Don't call the event handler another time after document.write. + iframe.onload = null; }); document.addEventListener("documentWriteDone", t.step_func_done(() => { - assert_true(onLoadWasCalled); + assert_true(onLoadWasCalled, "onload must be called"); assert_equals(iframe.contentDocument.body.textContent, "document.write body contents\n"); })); diff --git a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-static-import.html b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-static-import.html index d725854d866..3cae88047ee 100644 --- a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-static-import.html +++ b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/document-write/module-static-import.html @@ -6,15 +6,16 @@ + + + diff --git a/tests/wpt/web-platform-tests/lint.ignore b/tests/wpt/web-platform-tests/lint.ignore index d299867133c..de8d1175bc9 100644 --- a/tests/wpt/web-platform-tests/lint.ignore +++ b/tests/wpt/web-platform-tests/lint.ignore @@ -184,7 +184,7 @@ SET TIMEOUT: html/canvas/offscreen/the-offscreen-canvas/* SET TIMEOUT: html/canvas/offscreen/manual/the-offscreen-canvas/* SET TIMEOUT: old-tests/submission/Microsoft/history/history_000.htm SET TIMEOUT: paint-timing/resources/subframe-painting.html -SET TIMEOUT: payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html +SET TIMEOUT: payment-request/allowpayment/setting-allowpaymentrequest-timing.https.sub.html SET TIMEOUT: portals/resources/portals-adopt-predecessor-portal.html SET TIMEOUT: preload/single-download-preload.html SET TIMEOUT: resize-observer/resources/iframe.html @@ -301,7 +301,7 @@ SET TIMEOUT: css/css-fonts/font-display/font-display-change-ref.html SET TIMEOUT: css/css-fonts/font-display/font-display-feature-policy-01.tentative.html SET TIMEOUT: css/css-fonts/font-display/font-display-feature-policy-02.tentative.html SET TIMEOUT: css/css-fonts/font-display/font-display-preload.html -SET TIMEOUT: document-policy/font-display/font-display-document-policy-01.tentative.html +SET TIMEOUT: document-policy/font-display/override-to-optional.tentative.html SET TIMEOUT: feature-policy/experimental-features/resources/focus-without-user-activation-iframe-tentative.html SET TIMEOUT: html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html SET TIMEOUT: html/cross-origin-embedder-policy/resources/navigate-none.sub.html diff --git a/tests/wpt/web-platform-tests/mathml/presentation-markup/fractions/frac-1.html b/tests/wpt/web-platform-tests/mathml/presentation-markup/fractions/frac-1.html index 77ed4257127..d1ac170597e 100644 --- a/tests/wpt/web-platform-tests/mathml/presentation-markup/fractions/frac-1.html +++ b/tests/wpt/web-platform-tests/mathml/presentation-markup/fractions/frac-1.html @@ -10,8 +10,12 @@ + + + + + + + +
+

+ + + + + + + +

+

+ + + + + + +

+
+

+ + + + + + + +

+

+ + + + + + +

+
+

+ + + + + + + +

+
+

+ + + + + + + +

+ + diff --git a/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-single-char-and-children-ref.html b/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-single-char-and-children-ref.html new file mode 100644 index 00000000000..5a290283396 --- /dev/null +++ b/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-single-char-and-children-ref.html @@ -0,0 +1,24 @@ + + + + + <mo> with a single character and children (reference) + + + + +

There should be 5/18em horizontal gaps around the middle rectangles:

+

pXp

+

pXp

+

pXp

+

pXp

+

pXXp

+ +

There should be no horizontal gap around the middle rectangles:

+ +

pXp

+

pXp

+ + diff --git a/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-single-char-and-children.html b/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-single-char-and-children.html new file mode 100644 index 00000000000..79cb17447fc --- /dev/null +++ b/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-single-char-and-children.html @@ -0,0 +1,43 @@ + + + + + <mo> with a single character and children + + + + + + + +

There should be 5/18em horizontal gaps around the middle rectangles:

+

p(p

+

p(p

+

p(p

+

p(p

+

p|p

+ +

There should be no horizontal gap around the middle rectangles:

+ +

p(p

+

p(p

+ + + + + diff --git a/tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/underover-1.html b/tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/underover-1.html index 5b718707de9..ef5fa1e949b 100644 --- a/tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/underover-1.html +++ b/tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/underover-1.html @@ -8,8 +8,10 @@ + @@ -26,7 +28,7 @@ } setup({ explicit_done: true }); - window.addEventListener("load", runTests); + window.addEventListener("load", () => { document.fonts.ready.then(runTests); }); function runTests() { test(function() { @@ -85,13 +87,13 @@ test(function() { assert_true(MathMLFeatureDetection.has_mspace()); - var e = 3.2; + var e = 4; for (var i = 0; i <= 3; i++) { - assert_approx_equals(getBox("under" + i).height, getBox("under" + i + "base").height + getBox("under" + i + "under").height + e, e, "munder " + i + ": height is determined by the sum of heights of base and script plus some spacing."); - assert_approx_equals(getBox("over" + i).height, getBox("over" + i + "base").height + getBox("over" + i + "over").height + e, e, "mover " + i + ": height is determined by the sum of heights of base and script plus some spacing."); + assert_approx_equals(getBox("under" + i).height, getBox("under" + i + "base").height + getBox("under" + i + "under").height, e, "munder " + i + ": height is determined by the sum of heights of base and script plus some spacing."); + assert_approx_equals(getBox("over" + i).height, getBox("over" + i + "base").height + getBox("over" + i + "over").height, e, "mover " + i + ": height is determined by the sum of heights of base and script plus some spacing."); } for (var i = 0; i <= 5; i++) { - assert_approx_equals(getBox("underover" + i).height, getBox("underover" + i + "base").height + getBox("underover" + i + "under").height + getBox("underover" + i + "over").height + e, e, "munderover " + i + ": height is determined by the sum heights of base and scripts"); + assert_approx_equals(getBox("underover" + i).height, getBox("underover" + i + "base").height + getBox("underover" + i + "under").height + getBox("underover" + i + "over").height, e, "munderover " + i + ": height is determined by the sum heights of base and scripts"); } }, "Height of scripted elements"); diff --git a/tests/wpt/web-platform-tests/mediacapture-streams/GUM-empty-option-param.https.html b/tests/wpt/web-platform-tests/mediacapture-streams/GUM-empty-option-param.https.html index c7904cb4c7d..9f79a6dca6d 100644 --- a/tests/wpt/web-platform-tests/mediacapture-streams/GUM-empty-option-param.https.html +++ b/tests/wpt/web-platform-tests/mediacapture-streams/GUM-empty-option-param.https.html @@ -8,7 +8,7 @@

Description

This test checks that getUserMedia with no value in the -options parameter raises a NOT_SUPPORTED_ERR exception.

+options parameter raises a TypeError exception.

diff --git a/tests/wpt/web-platform-tests/mediacapture-streams/GUM-required-constraint-with-ideal-value.https.html b/tests/wpt/web-platform-tests/mediacapture-streams/GUM-required-constraint-with-ideal-value.https.html new file mode 100644 index 00000000000..705836f1e3c --- /dev/null +++ b/tests/wpt/web-platform-tests/mediacapture-streams/GUM-required-constraint-with-ideal-value.https.html @@ -0,0 +1,29 @@ + + + +Ideal value in required constraint in getUserMedia + + + + + + +

When prompted, accept to share your video stream.

+

Description

+

This test checks that setting a required constraint +with an ideal value in getUserMedia works

+
+ + + diff --git a/tests/wpt/web-platform-tests/mediacapture-streams/GUM-unknownkey-option-param.https.html b/tests/wpt/web-platform-tests/mediacapture-streams/GUM-unknownkey-option-param.https.html index b2792722201..965145a2b19 100644 --- a/tests/wpt/web-platform-tests/mediacapture-streams/GUM-unknownkey-option-param.https.html +++ b/tests/wpt/web-platform-tests/mediacapture-streams/GUM-unknownkey-option-param.https.html @@ -16,7 +16,7 @@ in the constraints parameter rejects with a TypeError.

- + - +
diff --git a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https.html b/tests/wpt/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-same-origin-bc-containers.https.html similarity index 91% rename from tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https.html rename to tests/wpt/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-same-origin-bc-containers.https.html index b100058cf92..e6675428b64 100644 --- a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https.html +++ b/tests/wpt/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-same-origin-bc-containers.https.html @@ -5,7 +5,7 @@
diff --git a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/basic.https.html b/tests/wpt/web-platform-tests/payment-request/allowpayment/basic.https.html similarity index 89% rename from tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/basic.https.html rename to tests/wpt/web-platform-tests/payment-request/allowpayment/basic.https.html index 80a6a2279d7..af2c8e16b4a 100644 --- a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/basic.https.html +++ b/tests/wpt/web-platform-tests/payment-request/allowpayment/basic.https.html @@ -2,7 +2,7 @@ PaymentRequest <iframe allowpaymentrequest> basic - + diff --git a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https.html b/tests/wpt/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https.html similarity index 91% rename from tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https.html rename to tests/wpt/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https.html index ea3773ba7b6..1c46525001d 100644 --- a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https.html +++ b/tests/wpt/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https.html @@ -5,7 +5,7 @@
diff --git a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub.html b/tests/wpt/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub.html similarity index 80% rename from tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub.html rename to tests/wpt/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub.html index 64baebb5024..1209f9d92f8 100644 --- a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub.html +++ b/tests/wpt/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub.html @@ -1,12 +1,12 @@ -PaymentRequest removing allowpaymentrequest after load and then navigating +PaymentRequest removing allow="payment" after load and then navigating
diff --git a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html b/tests/wpt/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest-timing.https.sub.html similarity index 80% rename from tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html rename to tests/wpt/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest-timing.https.sub.html index a741296d5da..f9962e4ffa4 100644 --- a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html +++ b/tests/wpt/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest-timing.https.sub.html @@ -1,20 +1,20 @@ -PaymentRequest setting allowpaymentrequest after document creation, before response +PaymentRequest setting allow="payment" after document creation, before response
diff --git a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub.html b/tests/wpt/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub.html similarity index 89% rename from tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub.html rename to tests/wpt/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub.html index c1d53a4bc26..22881cd8933 100644 --- a/tests/wpt/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub.html +++ b/tests/wpt/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub.html @@ -1,12 +1,12 @@ -PaymentRequest setting allowpaymentrequest after load and then navigating +PaymentRequest setting allow="payment" after load and then navigating
diff --git a/tests/wpt/web-platform-tests/reporting/disconnect.html b/tests/wpt/web-platform-tests/reporting/disconnect.html index 2dc5e8fd2de..12d33db8ff2 100644 --- a/tests/wpt/web-platform-tests/reporting/disconnect.html +++ b/tests/wpt/web-platform-tests/reporting/disconnect.html @@ -7,19 +7,20 @@ diff --git a/tests/wpt/web-platform-tests/reporting/path-absolute-endpoint.https.sub.html b/tests/wpt/web-platform-tests/reporting/path-absolute-endpoint.https.sub.html index 144fcb024e3..6abc5ee5a32 100644 --- a/tests/wpt/web-platform-tests/reporting/path-absolute-endpoint.https.sub.html +++ b/tests/wpt/web-platform-tests/reporting/path-absolute-endpoint.https.sub.html @@ -38,7 +38,7 @@ assert_equals(reports[0].body.sample, ""); assert_equals(reports[0].body.disposition, "enforce"); assert_equals(reports[0].body.statusCode, 0); - assert_equals(reports[0].body.lineNumber, 66); + assert_equals(reports[0].body.lineNumber, 61); assert_equals(reports[0].body.columnNumber, 0); }); @@ -51,17 +51,12 @@ onload='t.unreached_func("The image should not have loaded");' onerror='t.done();'> diff --git a/tests/wpt/web-platform-tests/resources/chromium/generic_sensor_mocks.js b/tests/wpt/web-platform-tests/resources/chromium/generic_sensor_mocks.js index fe2f70be34e..ac02c097fb2 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/generic_sensor_mocks.js +++ b/tests/wpt/web-platform-tests/resources/chromium/generic_sensor_mocks.js @@ -97,6 +97,14 @@ var GenericSensorTest = (() => { this.notifyOnReadingChange_ = notifyOnReadingChange; } + resume() { + this.startReading(); + } + + suspend() { + this.stopReading(); + } + // Mock functions // Resets mock Sensor state. @@ -168,6 +176,10 @@ var GenericSensorTest = (() => { assert_true(this.requestedFrequencies_.length > 0); return this.requestedFrequencies_[0]; } + + isReadingData() { + return this.sensorReadingTimerId_ != null; + } } // Class that mocks SensorProvider interface defined in diff --git a/tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js b/tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js index 4c5f68be9d5..aa94257e2a3 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js +++ b/tests/wpt/web-platform-tests/resources/chromium/nfc-mock.js @@ -118,33 +118,6 @@ function assertNDEFReaderOptionsEqual(provided, received) { } } -// Checks whether NDEFReaderOptions are matched with given message. -function matchesWatchOptions(message, options) { - // A message with no records is to notify that the tag is already formatted to - // support NDEF but does not contain a message yet. We always dispatch it for - // all options. - if (message.records.length == 0) - return true; - - for (let record of message.records) { - if (options.id != null && options.id !== record.id) { - continue; - } - if (options.recordType != null && - options.recordType !== record.recordType) { - continue; - } - if (options.mediaType != null && options.mediaType !== record.mediaType) { - continue; - } - - // Found one record matches, means the message matches. - return true; - } - - return false; -} - function createNDEFError(type) { return { error: type != null ? @@ -220,23 +193,21 @@ var WebNFCTest = (() => { this.client_ = client; } - async watch(options, id) { + async watch(id) { assert_true(id > 0); let error = this.getHWError(); if (error) { return error; } - this.watchers_.push({id: id, options: options}); + this.watchers_.push({id: id}); // Ignores reading if NFC operation is suspended // or the NFC tag does not expose NDEF technology. if (!this.operations_suspended_) { // Triggers onWatch if the new watcher matches existing messages. for (let message of this.reading_messages_) { - if (matchesWatchOptions(message, options)) { - this.client_.onWatch( - [id], fake_tag_serial_number, toMojoNDEFMessage(message)); - } + this.client_.onWatch( + [id], fake_tag_serial_number, toMojoNDEFMessage(message)); } } @@ -325,11 +296,9 @@ var WebNFCTest = (() => { return; // Triggers onWatch if the new message matches existing watchers. for (let watcher of this.watchers_) { - if (matchesWatchOptions(message, watcher.options)) { - this.client_.onWatch( - [watcher.id], fake_tag_serial_number, - toMojoNDEFMessage(message)); - } + this.client_.onWatch( + [watcher.id], fake_tag_serial_number, + toMojoNDEFMessage(message)); } } @@ -345,11 +314,9 @@ var WebNFCTest = (() => { // Resumes pending NFC reading. for (let watcher of this.watchers_) { for (let message of this.reading_messages_) { - if (matchesWatchOptions(message, watcher.options)) { - this.client_.onWatch( - [watcher.id], fake_tag_serial_number, - toMojoNDEFMessage(message)); - } + this.client_.onWatch( + [watcher.id], fake_tag_serial_number, + toMojoNDEFMessage(message)); } } // Resumes pending push operation. diff --git a/tests/wpt/web-platform-tests/resources/chromium/web-bluetooth-test.js b/tests/wpt/web-platform-tests/resources/chromium/web-bluetooth-test.js index b63658e2e75..aa4b80d2831 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/web-bluetooth-test.js +++ b/tests/wpt/web-platform-tests/resources/chromium/web-bluetooth-test.js @@ -38,10 +38,17 @@ function canonicalizeAndConvertToMojoUUID(uuids) { // Converts WebIDL a record to a map> to // use for Mojo, where the value for K is calculated using keyFn. -function convertToMojoMap(record, keyFn) { +function convertToMojoMap(record, keyFn, isNumberKey = false) { let map = new Map(); for (const [key, value] of Object.entries(record)) { let buffer = ArrayBuffer.isView(value) ? value.buffer : value; + if (isNumberKey) { + let numberKey = parseInt(key); + if (Number.isNaN(numberKey)) + throw `Map key ${key} is not a number`; + map.set(keyFn(numberKey), Array.from(new Uint8Array(buffer))); + continue; + } map.set(keyFn(key), Array.from(new Uint8Array(buffer))); } return map; @@ -211,15 +218,17 @@ class FakeCentral { // Convert manufacturerData from a record into a // map> for Mojo. if ('manufacturerData' in scanResult.scanRecord) { - clonedScanResult.scanRecord.manufacturerData = - convertToMojoMap(scanResult.scanRecord.manufacturerData, Number); + clonedScanResult.scanRecord.manufacturerData = convertToMojoMap( + scanResult.scanRecord.manufacturerData, Number, + true /* isNumberKey */); } // Convert serviceData from a record into a // map> for Mojo. if ('serviceData' in scanResult.scanRecord) { clonedScanResult.scanRecord.serviceData.serviceData = convertToMojoMap( - scanResult.scanRecord.serviceData, BluetoothUUID.getService); + scanResult.scanRecord.serviceData, BluetoothUUID.getService, + false /* isNumberKey */); } await this.fake_central_ptr_.simulateAdvertisementReceived( diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/navigation-timing.https.html b/tests/wpt/web-platform-tests/service-workers/service-worker/navigation-timing.https.html index 13b9ee475b1..6b51a5c2da2 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/navigation-timing.https.html +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/navigation-timing.https.html @@ -32,81 +32,45 @@ function navigate_in_frame(frame, url) { const worker_url = 'resources/navigation-timing-worker.js'; -promise_test(t => { +promise_test(async (t) => { const scope = 'resources/empty.html'; - let frame; + const registration = await service_worker_unregister_and_register(t, worker_url, scope); + t.add_cleanup(() => registration.unregister()); + await wait_for_state(t, registration.installing, 'activated'); + const frame = await with_iframe(scope); + t.add_cleanup(() => frame.remove()); - return service_worker_unregister_and_register(t, worker_url, scope) - .then(r => { - return wait_for_state(t, r.installing, 'activated'); - }) - .then(() => with_iframe(scope)) - .then(f => { - frame = f; - return navigate_in_frame(frame, 'resources/empty.html'); - }) - .then(timing => { - assert_greater_than(timing.workerStart, 0); - verify(timing); - }) - .catch(unreached_rejection(t)) - .then(() => { - if (frame) - frame.remove(); - return service_worker_unregister(t, scope); - }); + const timing = await navigate_in_frame(frame, scope); + assert_greater_than(timing.workerStart, 0); + verify(timing); }, 'Service worker controlled navigation timing'); -promise_test(t => { +promise_test(async (t) => { const scope = 'resources/empty.html?network-fallback'; - let frame; + const registration = await service_worker_unregister_and_register(t, worker_url, scope); + t.add_cleanup(() => registration.unregister()); + await wait_for_state(t, registration.installing, 'activated'); + const frame = await with_iframe(scope); + t.add_cleanup(() => frame.remove()); - return service_worker_unregister_and_register(t, worker_url, scope) - .then(r => { - return wait_for_state(t, r.installing, 'activated'); - }) - .then(() => with_iframe(scope)) - .then(f => { - frame = f; - return navigate_in_frame(frame, 'resources/empty.html?network-fallback'); - }) - .then(timing => { - verify(timing); - }) - .catch(unreached_rejection(t)) - .then(() => { - if (frame) - frame.remove(); - return service_worker_unregister(t, scope); - }); + const timing = await navigate_in_frame(frame, scope); + verify(timing); }, 'Service worker controlled navigation timing network fallback'); -promise_test(t => { +promise_test(async (t) => { const scope = 'resources/redirect.py?Redirect=empty.html'; - let frame; + const registration = await service_worker_unregister_and_register(t, worker_url, scope); + t.add_cleanup(() => registration.unregister()); + await wait_for_state(t, registration.installing, 'activated'); + const frame = await with_iframe(scope); + t.add_cleanup(() => frame.remove()); - return service_worker_unregister_and_register(t, worker_url, scope) - .then(r => { - return wait_for_state(t, r.installing, 'activated'); - }) - .then(() => with_iframe(scope)) - .then(f => { - frame = f; - return navigate_in_frame(frame, 'resources/redirect.py?Redirect=empty.html'); - }) - .then(timing => { - verify(timing); - // Additional checks for redirected navigation. - assert_true(timing.redirectStart <= timing.redirectEnd, - 'Expected redirectStart <= redirectEnd'); - assert_true(timing.redirectEnd <= timing.fetchStart, - 'Expected redirectEnd <= fetchStart'); - }) - .catch(unreached_rejection(t)) - .then(() => { - if (frame) - frame.remove(); - return service_worker_unregister(t, scope); - }); + const timing = await navigate_in_frame(frame, scope); + verify(timing); + // Additional checks for redirected navigation. + assert_true(timing.redirectStart <= timing.redirectEnd, + 'Expected redirectStart <= redirectEnd'); + assert_true(timing.redirectEnd <= timing.fetchStart, + 'Expected redirectEnd <= fetchStart'); }, 'Service worker controlled navigation timing redirect'); diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resource-timing.sub.https.html b/tests/wpt/web-platform-tests/service-workers/service-worker/resource-timing.sub.https.html index 2a366087cd3..f2f81bc35a1 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resource-timing.sub.https.html +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resource-timing.sub.https.html @@ -4,138 +4,147 @@ diff --git a/tests/wpt/web-platform-tests/svg/extensibility/foreignObject/getboundingclientrect.html b/tests/wpt/web-platform-tests/svg/extensibility/foreignObject/getboundingclientrect.html new file mode 100644 index 00000000000..82941bd14b3 --- /dev/null +++ b/tests/wpt/web-platform-tests/svg/extensibility/foreignObject/getboundingclientrect.html @@ -0,0 +1,33 @@ + +foreignObject: Element.prototype.getBoundingClientRect() + + + + + + + +
+
+
+ diff --git a/tests/wpt/web-platform-tests/svg/extensibility/foreignObject/overlapped-positioned-and-will-change-transform-descendant.html b/tests/wpt/web-platform-tests/svg/extensibility/foreignObject/overlapped-positioned-and-will-change-transform-descendant.html new file mode 100644 index 00000000000..e5c6a1b99cd --- /dev/null +++ b/tests/wpt/web-platform-tests/svg/extensibility/foreignObject/overlapped-positioned-and-will-change-transform-descendant.html @@ -0,0 +1,31 @@ + +fO with positioned descendants overlapping a fO with 'will-change: transform' child + + + + +
+
+ +
+
+
diff --git a/tests/wpt/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-03.svg b/tests/wpt/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-03.svg index 8d3f7e36123..8805cd2c41c 100644 --- a/tests/wpt/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-03.svg +++ b/tests/wpt/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-03.svg @@ -1,7 +1,7 @@ - When SVGGeometryElement.getPointAtLength is called with an element that is not in the document, throw exception + When SVGGeometryElement.getPointAtLength is called with an element that is not in the document, either succeed or throw exception @@ -17,13 +17,25 @@ rectElement.setAttribute("ry", 0); rectElement.setAttribute("width", 200); rectElement.setAttribute("height", 300); - assert_throws_dom("InvalidStateError", function() { rectElement.getPointAtLength(300); }); + try { + let rectPoint = rectElement.getPointAtLength(300); + assert_equals(rectPoint.x, 200, 'unexpected x position'); + assert_equals(rectPoint.y, 100, 'unexpected y position'); + } catch (e) { + assert_equals(e.name || e.type, 'InvalidStateError', 'Wrong exception, expected InvalidStateError'); + } }, document.title + " with SVGRectElement"); test(function() { var circleElement = document.createElementNS("http://www.w3.org/2000/svg", "circle"); circleElement.setAttribute("r", 10); - assert_throws_dom("InvalidStateError", function() { circleElement.getPointAtLength(100); }); + try { + let circlePoint = circleElement.getPointAtLength(100); + assert_approx_equals(circlePoint.x, 10, 0.2, 'unexpected x position'); + assert_approx_equals(circlePoint.y, 0, 0.2, 'unexpected y position'); + } catch (e) { + assert_equals(e.name || e.type, 'InvalidStateError', 'Wrong exception, expected InvalidStateError'); + } }, document.title + " with SVGCircleElement"); ]]> diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/base.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/base.py index e8a776b5935..b5820a38085 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/base.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/base.py @@ -37,6 +37,12 @@ def executor_kwargs(test_type, server_config, cache_manager, run_info_data, executor_kwargs["webdriver_binary"] = kwargs.get("webdriver_binary") executor_kwargs["webdriver_args"] = kwargs.get("webdriver_args") + # By default the executor may try to cleanup windows after a test (to best + # associate any problems with the test causing them). If the user might + # want to view the results, however, the executor has to skip that cleanup. + if kwargs["pause_after_test"] or kwargs["pause_on_unexpected"]: + executor_kwargs["cleanup_after_test"] = False + return executor_kwargs diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py index e0414669372..ad79600aeb8 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py @@ -369,7 +369,8 @@ class WebDriverTestharnessExecutor(TestharnessExecutor): def __init__(self, logger, browser, server_config, timeout_multiplier=1, close_after_done=True, capabilities=None, debug_info=None, - supports_eager_pageload=True, **kwargs): + supports_eager_pageload=True, cleanup_after_test=True, + **kwargs): """WebDriver-based executor for testharness.js tests""" TestharnessExecutor.__init__(self, logger, browser, server_config, timeout_multiplier=timeout_multiplier, @@ -383,6 +384,7 @@ class WebDriverTestharnessExecutor(TestharnessExecutor): self.close_after_done = close_after_done self.window_id = str(uuid.uuid4()) self.supports_eager_pageload = supports_eager_pageload + self.cleanup_after_test = cleanup_after_test def is_alive(self): return self.protocol.is_alive() @@ -409,7 +411,10 @@ class WebDriverTestharnessExecutor(TestharnessExecutor): def do_testharness(self, protocol, url, timeout): format_map = {"url": strip_server(url)} + # The previous test may not have closed its old windows (if something + # went wrong or if cleanup_after_test was False), so clean up here. parent_window = protocol.testharness.close_old_windows() + # Now start the test harness protocol.base.execute_script("window.open('about:blank', '%s', 'noopener')" % self.window_id) test_window = protocol.testharness.get_test_window(self.window_id, @@ -446,6 +451,14 @@ class WebDriverTestharnessExecutor(TestharnessExecutor): done, rv = handler(result) if done: break + + # Attempt to cleanup any leftover windows, if allowed. This is + # preferable as it will blame the correct test if something goes wrong + # closing windows, but if the user wants to see the test results we + # have to leave the window(s) open. + if self.cleanup_after_test: + protocol.testharness.close_old_windows() + return rv def wait_for_load(self, protocol): diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/tests/browsers/test_webkitgtk.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/tests/browsers/test_webkitgtk.py index be00dc4a6b7..6150d50acf9 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/tests/browsers/test_webkitgtk.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/tests/browsers/test_webkitgtk.py @@ -39,6 +39,8 @@ def test_webkitgtk_certificate_domain_list(product): kwargs["webkit_port"] = "gtk" kwargs["binary"] = None kwargs["webdriver_binary"] = None + kwargs["pause_after_test"] = False + kwargs["pause_on_unexpected"] = False with ConfigBuilder(browser_host="example.net", alternate_hosts={"alt": "example.org"}, subdomains={"a", "b"}, diff --git a/tests/wpt/web-platform-tests/video-rvfc/request-video-frame-callback-before-xr-session.https.html b/tests/wpt/web-platform-tests/video-rvfc/request-video-frame-callback-before-xr-session.https.html new file mode 100644 index 00000000000..db662bd9289 --- /dev/null +++ b/tests/wpt/web-platform-tests/video-rvfc/request-video-frame-callback-before-xr-session.https.html @@ -0,0 +1,67 @@ + + +Test that video.rVFC callbacks started before an XRSession work. + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/video-rvfc/request-video-frame-callback-during-xr-session.https.html b/tests/wpt/web-platform-tests/video-rvfc/request-video-frame-callback-during-xr-session.https.html new file mode 100644 index 00000000000..34561ee5fd0 --- /dev/null +++ b/tests/wpt/web-platform-tests/video-rvfc/request-video-frame-callback-during-xr-session.https.html @@ -0,0 +1,60 @@ + + +Test that video.rVFC callbacks started during an XRSession work. + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/web-nfc/NDEFReader_scan_filter.https.html b/tests/wpt/web-platform-tests/web-nfc/NDEFReader_scan_filter.https.html deleted file mode 100644 index 1fea2437b93..00000000000 --- a/tests/wpt/web-platform-tests/web-nfc/NDEFReader_scan_filter.https.html +++ /dev/null @@ -1,165 +0,0 @@ - - -Web NFC: NDEFReader.scan() filter tests - - - - - - diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/processing-model/delay-time-clamping.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/processing-model/delay-time-clamping.html index b79f0de0e58..fa010df3cd5 100644 --- a/tests/wpt/web-platform-tests/webaudio/the-audio-api/processing-model/delay-time-clamping.html +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/processing-model/delay-time-clamping.html @@ -9,7 +9,7 @@ + + + + diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-suspend-resume.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-suspend-resume.html index 48506d65ac9..ff3daebf396 100644 --- a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-suspend-resume.html +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-suspend-resume.html @@ -129,7 +129,7 @@ should(() => context = new AudioContext(), 'Create online context') .notThrow(); - should(context.state, 'context.state').beEqualTo('running'); + should(context.state, 'context.state').beEqualTo('suspended'); should(context.resume(), 'context.resume') .beResolved() .then(() => { diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/resources/not-fully-active-helper.sub.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/resources/not-fully-active-helper.sub.html new file mode 100644 index 00000000000..2654a2a5040 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/resources/not-fully-active-helper.sub.html @@ -0,0 +1,22 @@ + + + + + diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/realtime-conv.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/realtime-conv.html index c1686da9645..930728dc369 100644 --- a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/realtime-conv.html +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/realtime-conv.html @@ -22,7 +22,7 @@ // teh platform and browser. Don't set this value to be to much lower // than this. It probably indicates a fairly inaccurate convolver or // constant source node automations that should be fixed instead. - const minRequiredSNR = 88.457; + const minRequiredSNR = 83; // To test the real-time convolver, we convolve two square pulses together // to produce a triangular pulse. To verify the result is correct we diff --git a/tests/wpt/web-platform-tests/webcodecs/video-track-reader.html b/tests/wpt/web-platform-tests/webcodecs/video-track-reader.html index 087e0bb935b..b5d610e9eac 100644 --- a/tests/wpt/web-platform-tests/webcodecs/video-track-reader.html +++ b/tests/wpt/web-platform-tests/webcodecs/video-track-reader.html @@ -22,52 +22,48 @@ async function getMediaStream() { return video.captureStream(); } -async_test(async function(t) { +promise_test(async function(t) { let stream = await getMediaStream(); let vtr = new VideoTrackReader(stream.getVideoTracks()[0]); - - t.done(); }, 'Test we can construct a VideoTrackReader.'); -async_test(async function(t) { +promise_test(async function(t) { let stream = await getMediaStream(); let vtr = new VideoTrackReader(stream.getVideoTracks()[0]); let numberFrames = 0; - vtr.start(t.step_func((frame) => { - assert_equals(frame.codedWidth, testVideo.width); - assert_equals(frame.codedHeight, testVideo.height); - assert_not_equals(frame.timestamp, null); - frame.destroy(); - - if (++numberFrames == 5){ - vtr.stop(); - t.done(); - } - })); + return new Promise(resolve => { + vtr.start(t.step_func(frame => { + assert_equals(frame.codedWidth, testVideo.width); + assert_equals(frame.codedHeight, testVideo.height); + assert_not_equals(frame.timestamp, null); + frame.destroy(); + if (++numberFrames == 5) { + vtr.stop(); + resolve(); + } + })); + }); }, 'Test we can start and stop a VideoTrackReader.'); -async_test(async function(t) { +promise_test(async function(t) { let stream = await getMediaStream(); let vtr = new VideoTrackReader(stream.getVideoTracks()[0]); - let stoppedOnce = false; - - vtr.start(t.step_func(() => { - if(!stoppedOnce) { + let stopped = false; + return new Promise(resolve => { + vtr.start(t.step_func(() => { + assert_false(stopped, "A stopped callback should never be called again"); vtr.stop(); - vtr.start(t.step_func_done()); - stoppedOnce = true; - } else { - assert_unreached("A stopped callback should never be called again"); - } - })); - + vtr.start(resolve); + stopped = true; + })); + }); }, 'Test we can restart a stopped VideoTrackReader.'); -async_test(async function(t) { +promise_test(async function(t) { let stream = await getMediaStream(); let track = stream.getVideoTracks()[0]; @@ -77,45 +73,31 @@ async_test(async function(t) { let receivedFrame_a = false; let receivedFrame_b = false; - vtr_a.start(t.step_func(() => { - receivedFrame_a = true; - - if (receivedFrame_a && receivedFrame_b) - t.done(); - })); - - vtr_b.start(t.step_func(() => { - receivedFrame_b = true; - - if (receivedFrame_a && receivedFrame_b) - t.done(); - })); - + return Promise.all([ + new Promise(resolve => { vtr_a.start(resolve); }), + new Promise(resolve => { vtr_b.start(resolve); }), + ]); }, 'Test we can create multiple VideoTrackReaders from the same track.'); -async_test(async function(t) { +promise_test(async function(t) { let stream = await getMediaStream(); let audioTrack = stream.getAudioTracks()[0]; assert_throws_js(TypeError, () => { let vtr = new VideoTrackReader(audioTrack); }) - - t.done(); }, 'Test creating a VideoTrackReaders from an audio track throws.'); -async_test(async function(t) { +promise_test(async function(t) { let stream = await getMediaStream(); let vtr = new VideoTrackReader(stream.getVideoTracks()[0]); assert_throws_dom("InvalidStateError", () => { vtr.stop(); }) - - t.done(); }, 'Test stopping a stopped VideoTrackReader throws.'); -async_test(async function(t) { +promise_test(async function(t) { let stream = await getMediaStream(); let vtr = new VideoTrackReader(stream.getVideoTracks()[0]); @@ -124,8 +106,6 @@ async_test(async function(t) { assert_throws_dom("InvalidStateError", () => { vtr.start(() => {}); }) - - t.done(); }, 'Test starting a started VideoTrackReader throws.'); diff --git a/tests/wpt/web-platform-tests/webdriver/tests/accept_alert/accept.py b/tests/wpt/web-platform-tests/webdriver/tests/accept_alert/accept.py index d8211841d5c..711ad5af79f 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/accept_alert/accept.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/accept_alert/accept.py @@ -18,11 +18,16 @@ def test_null_response_value(session, url): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_level_browsing_context(session, closed_window): response = accept_alert(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = accept_alert(session) + assert_error(response, "no such alert") + + def test_no_user_prompt(session): response = accept_alert(session) assert_error(response, "no such alert") @@ -42,7 +47,11 @@ def test_accept_confirm(session): def test_accept_prompt(session): - session.url = inline("") + session.url = inline(""" + + """) response = accept_alert(session) assert_success(response) assert session.execute_script("return window.result") == "Federer" diff --git a/tests/wpt/web-platform-tests/webdriver/tests/add_cookie/add.py b/tests/wpt/web-platform-tests/webdriver/tests/add_cookie/add.py index 6aaa5a243a7..f0515379026 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/add_cookie/add.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/add_cookie/add.py @@ -34,7 +34,17 @@ def test_null_response_value(session, url): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + new_cookie = { + "name": "hello", + "value": "world", + } + + response = add_cookie(session, new_cookie) + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): new_cookie = { "name": "hello", "value": "world", diff --git a/tests/wpt/web-platform-tests/webdriver/tests/back/back.py b/tests/wpt/web-platform-tests/webdriver/tests/back/back.py index 0f94ab431ae..9ca52e8f223 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/back/back.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/back/back.py @@ -16,11 +16,16 @@ def test_null_response_value(session): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = back(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = back(session) + assert_success(response) + + def test_no_browsing_history(session): response = back(session) assert_success(response) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/close_window/close.py b/tests/wpt/web-platform-tests/webdriver/tests/close_window/close.py index fa823679106..53af5730f83 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/close_window/close.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/close_window/close.py @@ -10,11 +10,30 @@ def close(session): "DELETE", "session/{session_id}/window".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = close(session) assert_error(response, "no such window") +def test_no_browsing_context(session, url): + new_handle = session.new_window() + + session.url = url("/webdriver/tests/support/html/frames.html") + + subframe = session.find.css("#sub-frame", all=False) + session.switch_frame(subframe) + + frame = session.find.css("#delete-frame", all=False) + session.switch_frame(frame) + + button = session.find.css("#remove-parent", all=False) + button.click() + + response = close(session) + handles = assert_success(response) + assert handles == [new_handle] + + def test_close_browsing_context(session): original_handles = session.handles diff --git a/tests/wpt/web-platform-tests/webdriver/tests/delete_all_cookies/delete.py b/tests/wpt/web-platform-tests/webdriver/tests/delete_all_cookies/delete.py index e0947b6a757..86d66561b00 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/delete_all_cookies/delete.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/delete_all_cookies/delete.py @@ -12,6 +12,11 @@ def test_null_response_value(session, url): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = delete_all_cookies(session) + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = delete_all_cookies(session) assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/delete_cookie/delete.py b/tests/wpt/web-platform-tests/webdriver/tests/delete_cookie/delete.py index 0b6adade156..4b37c0453b9 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/delete_cookie/delete.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/delete_cookie/delete.py @@ -14,7 +14,12 @@ def test_null_response_value(session, url): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = delete_cookie(session, "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = delete_cookie(session, "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/dismiss_alert/dismiss.py b/tests/wpt/web-platform-tests/webdriver/tests/dismiss_alert/dismiss.py index bcff3a32af3..da65bac388d 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/dismiss_alert/dismiss.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/dismiss_alert/dismiss.py @@ -18,11 +18,16 @@ def test_null_response_value(session, url): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = dismiss_alert(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = dismiss_alert(session) + assert_error(response, "no such alert") + + def test_no_user_prompt(session): response = dismiss_alert(session) assert_error(response, "no such alert") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/element_clear/clear.py b/tests/wpt/web-platform-tests/webdriver/tests/element_clear/clear.py index 297fc38ff29..0189c38c277 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/element_clear/clear.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/element_clear/clear.py @@ -1,7 +1,6 @@ # META: timeout=long import pytest -import time from webdriver import Element @@ -47,8 +46,15 @@ def test_null_response_value(session): assert value is None -def test_no_browsing_context(session, closed_window): - element = Element("foo" + str(time.time()), session) +def test_no_top_browsing_context(session, closed_window): + element = Element("foo", session) + + response = element_clear(session, element) + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): + element = Element("foo", session) response = element_clear(session, element) assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/element_click/click.py b/tests/wpt/web-platform-tests/webdriver/tests/element_click/click.py index 4076a1a27c6..3a5d737216d 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/element_click/click.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/element_click/click.py @@ -20,7 +20,14 @@ def test_null_response_value(session): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + element = Element("foo", session) + + response = element_click(session, element) + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): element = Element("foo", session) response = element_click(session, element) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/element_send_keys/send_keys.py b/tests/wpt/web-platform-tests/webdriver/tests/element_send_keys/send_keys.py index 03cc94850c6..edf91e77614 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/element_send_keys/send_keys.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/element_send_keys/send_keys.py @@ -34,7 +34,14 @@ def test_null_response_value(session): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + element = Element("foo", session) + + response = element_send_keys(session, element, "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): element = Element("foo", session) response = element_send_keys(session, element, "foo") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/execute_async_script/execute_async.py b/tests/wpt/web-platform-tests/webdriver/tests/execute_async_script/execute_async.py index 7c454eaf4ac..c769ca811ee 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/execute_async_script/execute_async.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/execute_async_script/execute_async.py @@ -21,7 +21,12 @@ def test_null_parameter_value(session, http): assert_error(Response.from_http(response), "invalid argument") -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = execute_async_script(session, "argument[0](1);") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = execute_async_script(session, "argument[0](1);") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/execute_script/execute.py b/tests/wpt/web-platform-tests/webdriver/tests/execute_script/execute.py index 32bf6f59d4f..bd719b27859 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/execute_script/execute.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/execute_script/execute.py @@ -24,7 +24,12 @@ def test_null_parameter_value(session, http): assert_error(Response.from_http(response), "invalid argument") -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = execute_script(session, "return 1;") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = execute_script(session, "return 1;") assert_error(response, "no such window") @@ -60,8 +65,8 @@ window.addEventListener = () => {called.push("Internal addEventListener")} window.removeEventListener = () => {called.push("Internal removeEventListener")} })""") - response = execute_script(session, "return !window.onunload"); - assert_success(response, True); + response = execute_script(session, "return !window.onunload") + assert_success(response, True) response = execute_script(session, "return called") assert_success(response, []) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/find_element/find.py b/tests/wpt/web-platform-tests/webdriver/tests/find_element/find.py index 20cde541d11..9f0911d56dc 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/find_element/find.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/find_element/find.py @@ -18,7 +18,12 @@ def test_null_parameter_value(session, http): assert_error(Response.from_http(response), "invalid argument") -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = find_element(session, "css selector", "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = find_element(session, "css selector", "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/find_element_from_element/find.py b/tests/wpt/web-platform-tests/webdriver/tests/find_element_from_element/find.py index 56e216bb646..aa648117976 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/find_element_from_element/find.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/find_element_from_element/find.py @@ -24,7 +24,12 @@ def test_null_parameter_value(session, http): assert_error(Response.from_http(response), "invalid argument") -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = find_element(session, "notReal", "css selector", "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = find_element(session, "notReal", "css selector", "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/find_elements/find.py b/tests/wpt/web-platform-tests/webdriver/tests/find_elements/find.py index b31370ee0cd..c1381a0e82a 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/find_elements/find.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/find_elements/find.py @@ -18,7 +18,12 @@ def test_null_parameter_value(session, http): assert_error(Response.from_http(response), "invalid argument") -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = find_elements(session, "css selector", "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = find_elements(session, "css selector", "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/find_elements_from_element/find.py b/tests/wpt/web-platform-tests/webdriver/tests/find_elements_from_element/find.py index 5a48e9c76ef..5c267ba6479 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/find_elements_from_element/find.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/find_elements_from_element/find.py @@ -24,7 +24,12 @@ def test_null_parameter_value(session, http): assert_error(Response.from_http(response), "invalid argument") -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = find_elements(session, "notReal", "css selector", "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = find_elements(session, "notReal", "css selector", "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/forward/forward.py b/tests/wpt/web-platform-tests/webdriver/tests/forward/forward.py index a8c7e00b88d..4a1e2158151 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/forward/forward.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/forward/forward.py @@ -17,11 +17,16 @@ def test_null_response_value(session): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = forward(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = forward(session) + assert_success(response) + + def test_no_browsing_history(session): url = inline("
") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/fullscreen_window/fullscreen.py b/tests/wpt/web-platform-tests/webdriver/tests/fullscreen_window/fullscreen.py index 3194426e1ae..94f25ed9bdb 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/fullscreen_window/fullscreen.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/fullscreen_window/fullscreen.py @@ -7,11 +7,16 @@ def fullscreen(session): "POST", "session/{session_id}/window/fullscreen".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = fullscreen(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = fullscreen(session) + assert_success(response) + + def test_fullscreen(session): response = fullscreen(session) assert_success(response) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_active_element/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_active_element/get.py index 1fea56a0d7a..7f821f3a40d 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_active_element/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_active_element/get.py @@ -11,7 +11,12 @@ def get_active_element(session): "GET", "session/{session_id}/element/active".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = get_active_element(session) + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = get_active_element(session) assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_alert_text/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_alert_text/get.py index ad0058e0326..b64678653e0 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_alert_text/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_alert_text/get.py @@ -12,11 +12,16 @@ def get_alert_text(session): "GET", "session/{session_id}/alert/text".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = get_alert_text(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = get_alert_text(session) + assert_error(response, "no such alert") + + def test_no_user_prompt(session): response = get_alert_text(session) assert_error(response, "no such alert") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_current_url/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_current_url/get.py index 378ba27f2b2..0383a8aba9e 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_current_url/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_current_url/get.py @@ -13,11 +13,18 @@ def get_current_url(session): "GET", "session/{session_id}/url".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = get_current_url(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + session.url = doc + + response = get_current_url(session) + assert_success(response, doc) + + def test_get_current_url_matches_location(session): session.url = doc diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_element_attribute/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_element_attribute/get.py index 8bb2a8171a1..b18d9ca8b22 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_element_attribute/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_element_attribute/get.py @@ -12,7 +12,12 @@ def get_element_attribute(session, element, attr): attr=attr)) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = get_element_attribute(session, "foo", "id") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = get_element_attribute(session, "foo", "id") assert_error(response, "no such window") @@ -41,7 +46,7 @@ def test_normal(session): # Check we are not returning the property which will have a different value assert session.execute_script("return document.querySelector('input').checked") is False element.click() - assert True == session.execute_script("return document.querySelector('input').checked") + assert session.execute_script("return document.querySelector('input').checked") is True result = get_element_attribute(session, element.id, "input") assert_success(result, None) @@ -55,7 +60,9 @@ def test_normal(session): ("form", ["novalidate"]), ("iframe", ["allowfullscreen"]), ("img", ["ismap"]), - ("input", ["autofocus", "checked", "disabled", "formnovalidate", "multiple", "readonly", "required"]), + ("input", [ + "autofocus", "checked", "disabled", "formnovalidate", "multiple", "readonly", "required" + ]), ("menuitem", ["checked", "default", "disabled"]), ("ol", ["reversed"]), ("optgroup", ["disabled"]), diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_element_css_value/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_element_css_value/get.py index 88a56e1ad45..4e8704d50af 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_element_css_value/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_element_css_value/get.py @@ -13,7 +13,12 @@ def get_element_css_value(session, element_id, prop): ) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = get_element_css_value(session, "foo", "bar") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = get_element_css_value(session, "foo", "bar") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_element_property/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_element_property/get.py index 50185485b81..5c0247edb70 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_element_property/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_element_property/get.py @@ -12,7 +12,12 @@ def get_element_property(session, element_id, prop): prop=prop)) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = get_element_property(session, "foo", "id") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = get_element_property(session, "foo", "id") assert_error(response, "no such window") @@ -101,7 +106,11 @@ def test_mutated_element(session): session.url = inline("") element = session.find.css("input", all=False) element.click() - assert session.execute_script("return arguments[0].hasAttribute('checked')", args=(element,)) is False + + checked = session.execute_script(""" + return arguments[0].hasAttribute('checked') + """, args=(element,)) + assert checked is False response = get_element_property(session, element.id, "checked") assert_success(response, True) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_element_rect/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_element_rect/get.py index e3744c4bce5..494c45f8e45 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_element_rect/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_element_rect/get.py @@ -13,7 +13,12 @@ def get_element_rect(session, element_id): ) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = get_element_rect(session, "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = get_element_rect(session, "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_element_tag_name/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_element_tag_name/get.py index d705ae1118f..ffe6dd641e8 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_element_tag_name/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_element_tag_name/get.py @@ -9,7 +9,12 @@ def get_element_tag_name(session, element_id): element_id=element_id)) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = get_element_tag_name(session, "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = get_element_tag_name(session, "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_element_text/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_element_text/get.py index 9f660308bc2..5f169a3a233 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_element_text/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_element_text/get.py @@ -9,7 +9,12 @@ def get_element_text(session, element_id): element_id=element_id)) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = get_element_text(session, "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = get_element_text(session, "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_named_cookie/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_named_cookie/get.py index 120488aa7b3..102c18f0275 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_named_cookie/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_named_cookie/get.py @@ -8,6 +8,7 @@ from tests.support.asserts import assert_error, assert_success from tests.support.helpers import clear_all_cookies from tests.support.inline import inline + def get_named_cookie(session, name): return session.transport.send( "GET", "session/{session_id}/cookie/{name}".format( @@ -15,7 +16,12 @@ def get_named_cookie(session, name): name=name)) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = get_named_cookie(session, "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = get_named_cookie(session, "foo") assert_error(response, "no such window") @@ -74,7 +80,6 @@ def test_get_named_cookie(session, url): assert "sameSite" in cookie assert isinstance(cookie["sameSite"], text_type) - assert cookie["name"] == "foo" assert cookie["value"] == "bar" # convert from seconds since epoch diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_page_source/source.py b/tests/wpt/web-platform-tests/webdriver/tests/get_page_source/source.py index 0deb1b46488..5484ccbf2ee 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_page_source/source.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_page_source/source.py @@ -7,7 +7,12 @@ def get_page_source(session): "GET", "session/{session_id}/source".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = get_page_source(session) + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = get_page_source(session) assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_title/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_title/get.py index 7bb83c3f9cd..34405774ba0 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_title/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_title/get.py @@ -17,11 +17,18 @@ def test_payload(session): assert isinstance(value, text_type) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = get_title(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + session.url = inline("Foo") + + response = get_title(session) + assert_success(response, "Foo") + + def test_with_duplicated_title(session): session.url = inline("FirstSecond") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_window_handle/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_window_handle/get.py index c6a90f93c1b..8c262033c38 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_window_handle/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_window_handle/get.py @@ -6,11 +6,16 @@ def get_window_handle(session): "GET", "session/{session_id}/window".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = get_window_handle(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = get_window_handle(session) + assert_success(response, session.window_handle) + + def test_basic(session): response = get_window_handle(session) assert_success(response, session.window_handle) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_window_handles/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_window_handles/get.py index b25d76ce588..8f4361e30c9 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_window_handles/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_window_handles/get.py @@ -6,14 +6,14 @@ def get_window_handles(session): "GET", "session/{session_id}/window/handles".format(**vars(session))) -def test_no_browsing_context(session): - window_handles = session.handles - - session.window_handle = session.new_window() - session.window.close() - +def test_no_top_browsing_context(session, closed_window): response = get_window_handles(session) - assert_success(response, window_handles) + assert_success(response, session.handles) + + +def test_no_browsing_context(session, closed_frame): + response = get_window_handles(session) + assert_success(response, session.handles) def test_single_window(session): diff --git a/tests/wpt/web-platform-tests/webdriver/tests/get_window_rect/get.py b/tests/wpt/web-platform-tests/webdriver/tests/get_window_rect/get.py index b5103787e15..793650feef4 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/get_window_rect/get.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/get_window_rect/get.py @@ -10,11 +10,16 @@ def get_window_rect(session): "GET", "session/{session_id}/window/rect".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = get_window_rect(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = get_window_rect(session) + assert_success(response) + + def test_payload(session): expected = session.execute_script("""return { x: window.screenX, diff --git a/tests/wpt/web-platform-tests/webdriver/tests/is_element_enabled/enabled.py b/tests/wpt/web-platform-tests/webdriver/tests/is_element_enabled/enabled.py index dd56084d8d0..88b1534ded1 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/is_element_enabled/enabled.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/is_element_enabled/enabled.py @@ -14,7 +14,12 @@ def is_element_enabled(session, element_id): ) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = is_element_enabled(session, "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = is_element_enabled(session, "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/is_element_selected/selected.py b/tests/wpt/web-platform-tests/webdriver/tests/is_element_selected/selected.py index 76361e50563..79a1615dd9f 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/is_element_selected/selected.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/is_element_selected/selected.py @@ -21,7 +21,12 @@ def is_element_selected(session, element_id): element_id=element_id)) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): + response = is_element_selected(session, "foo") + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): response = is_element_selected(session, "foo") assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/maximize_window/maximize.py b/tests/wpt/web-platform-tests/webdriver/tests/maximize_window/maximize.py index 37546599792..6903eece70d 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/maximize_window/maximize.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/maximize_window/maximize.py @@ -9,11 +9,16 @@ def maximize(session): "POST", "session/{session_id}/window/maximize".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = maximize(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = maximize(session) + assert_success(response) + + def test_fully_exit_fullscreen(session): session.window.fullscreen() assert is_fullscreen(session) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/minimize_window/minimize.py b/tests/wpt/web-platform-tests/webdriver/tests/minimize_window/minimize.py index 279511caf0a..616b250c705 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/minimize_window/minimize.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/minimize_window/minimize.py @@ -9,11 +9,16 @@ def minimize(session): "POST", "session/{session_id}/window/minimize".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = minimize(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = minimize(session) + assert_success(response) + + def test_fully_exit_fullscreen(session): session.window.fullscreen() assert is_fullscreen(session) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/navigate_to/navigate.py b/tests/wpt/web-platform-tests/webdriver/tests/navigate_to/navigate.py index 36c277dab62..289e4321011 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/navigate_to/navigate.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/navigate_to/navigate.py @@ -23,11 +23,20 @@ def test_null_response_value(session): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = navigate_to(session, "foo") assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + doc = inline("

foo") + + response = navigate_to(session, doc) + assert_success(response) + + assert session.url == doc + + def test_file_protocol(session, server_config): # tests that the browsing context remains the same # when navigated privileged documents diff --git a/tests/wpt/web-platform-tests/webdriver/tests/new_window/new.py b/tests/wpt/web-platform-tests/webdriver/tests/new_window/new.py index 0abdeac614e..fd0a1ffceb8 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/new_window/new.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/new_window/new.py @@ -17,11 +17,23 @@ def test_null_parameter_value(session, http): assert_error(Response.from_http(response), "invalid argument") -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = new_window(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + original_handles = session.handles + + response = new_window(session) + value = assert_success(response) + handles = session.handles + assert len(handles) == len(original_handles) + 1 + assert value["handle"] in handles + assert value["handle"] not in original_handles + assert value["type"] in ["tab", "window"] + + @pytest.mark.parametrize("type_hint", [True, 42, 4.2, [], {}]) def test_type_with_invalid_type(session, type_hint): response = new_window(session, type_hint) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/key.py b/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/key.py index cbfb5bcef43..eef0ab96f4b 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/key.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/key.py @@ -11,7 +11,12 @@ def test_null_response_value(session, key_chain): assert value is None -def test_no_browsing_context(session, closed_window, key_chain): +def test_no_top_browsing_context(session, closed_window, key_chain): + with pytest.raises(NoSuchWindowException): + key_chain.key_up("a").perform() + + +def test_no_browsing_context(session, closed_frame, key_chain): with pytest.raises(NoSuchWindowException): key_chain.key_up("a").perform() diff --git a/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/none.py b/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/none.py index 07944a68ffe..4fadec40a45 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/none.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/none.py @@ -14,6 +14,11 @@ def test_null_response_value(session, none_chain): assert_success(response, None) -def test_no_browsing_context(session, closed_window, none_chain): +def test_no_top_browsing_context(session, closed_window, none_chain): + response = perform_actions(session, [none_chain.pause(0).dict]) + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame, none_chain): response = perform_actions(session, [none_chain.pause(0).dict]) assert_error(response, "no such window") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/pointer.py b/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/pointer.py index ca7d7b1be48..ad546921460 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/pointer.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/perform_actions/pointer.py @@ -21,7 +21,12 @@ def test_null_response_value(session, mouse_chain): assert value is None -def test_no_browsing_context(session, closed_window, mouse_chain): +def test_no_top_browsing_context(session, closed_window, mouse_chain): + with pytest.raises(NoSuchWindowException): + mouse_chain.click().perform() + + +def test_no_browsing_context(session, closed_frame, mouse_chain): with pytest.raises(NoSuchWindowException): mouse_chain.click().perform() @@ -85,8 +90,8 @@ def test_click_element_center(session, test_actions_page, mouse_chain): assert ["mousemove", "mousedown", "mouseup", "click"] == event_types for e in events: if e["type"] != "mousemove": - assert e["pageX"] == pytest.approx(center["x"], abs = 1.0) - assert e["pageY"] == pytest.approx(center["y"], abs = 1.0) + assert e["pageX"] == pytest.approx(center["x"], abs=1.0) + assert e["pageY"] == pytest.approx(center["y"], abs=1.0) assert e["target"] == "outer" @@ -135,8 +140,8 @@ def test_drag_and_drop(session, # mouseup that ends the drag is at the expected destination e = get_events(session)[1] assert e["type"] == "mouseup" - assert e["pageX"] == pytest.approx(initial_center["x"] + dx, abs = 1.0) - assert e["pageY"] == pytest.approx(initial_center["y"] + dy, abs = 1.0) + assert e["pageX"] == pytest.approx(initial_center["x"] + dx, abs=1.0) + assert e["pageY"] == pytest.approx(initial_center["y"] + dy, abs=1.0) # check resulting location of the dragged element final_rect = drag_target.rect assert initial_rect["x"] + dx == final_rect["x"] @@ -168,7 +173,9 @@ def test_drag_and_drop_with_draggable_element(session_new_window, assert len(e) >= 5 assert e[1]["type"] == "dragstart", "Events captured were {}".format(e) assert e[2]["type"] == "dragover", "Events captured were {}".format(e) - drag_events_captured = [ev["type"] for ev in e if ev["type"].startswith("drag") or ev["type"].startswith("drop")] + drag_events_captured = [ + ev["type"] for ev in e if ev["type"].startswith("drag") or ev["type"].startswith("drop") + ] assert "dragend" in drag_events_captured assert "dragenter" in drag_events_captured assert "dragleave" in drag_events_captured diff --git a/tests/wpt/web-platform-tests/webdriver/tests/print/__init__.py b/tests/wpt/web-platform-tests/webdriver/tests/print/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/wpt/web-platform-tests/webdriver/tests/print/printcmd.py b/tests/wpt/web-platform-tests/webdriver/tests/print/printcmd.py index 51b9fac8592..8874be3148b 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/print/printcmd.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/print/printcmd.py @@ -19,11 +19,18 @@ def assert_pdf(data): assert data.endswith(b"%%EOF\n"), "Decoded data ends with the EOF flag" -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = do_print(session, {}) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = do_print(session, {}) + value = assert_success(response) + pdf = base64.decodestring(value) + assert_pdf(pdf) + + def test_html_document(session): session.url = inline("Test") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/refresh/refresh.py b/tests/wpt/web-platform-tests/webdriver/tests/refresh/refresh.py index 30bd369bba1..eef413017e5 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/refresh/refresh.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/refresh/refresh.py @@ -19,11 +19,27 @@ def test_null_response_value(session): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = refresh(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + url = inline("

") + + session.url = url + element = session.find.css("#foo", all=False) + + response = refresh(session) + assert_success(response) + + with pytest.raises(StaleElementReferenceException): + element.property("id") + + assert session.url == url + assert session.find.css("#foo", all=False) + + def test_basic(session): url = inline("
") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/release_actions/release.py b/tests/wpt/web-platform-tests/webdriver/tests/release_actions/release.py index 84719043d1c..1f486f7759f 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/release_actions/release.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/release_actions/release.py @@ -13,6 +13,11 @@ def test_null_response_value(session): assert_success(response, None) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = release_actions(session) assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): + response = release_actions(session) + assert_success(response) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/send_alert_text/send.py b/tests/wpt/web-platform-tests/webdriver/tests/send_alert_text/send.py index e0fcdbf28a4..5da67590da3 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/send_alert_text/send.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/send_alert_text/send.py @@ -39,11 +39,16 @@ def test_invalid_input(session, page, text): assert_error(response, "invalid argument") -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = send_alert_text(session, "Federer") assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = send_alert_text(session, "Federer") + assert_error(response, "no such alert") + + def test_no_user_prompt(session): response = send_alert_text(session, "Federer") assert_error(response, "no such alert") diff --git a/tests/wpt/web-platform-tests/webdriver/tests/set_window_rect/set.py b/tests/wpt/web-platform-tests/webdriver/tests/set_window_rect/set.py index 32e400f4664..23382288a3d 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/set_window_rect/set.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/set_window_rect/set.py @@ -21,11 +21,18 @@ def test_null_parameter_value(session, http): assert_error(Response.from_http(response), "invalid argument") -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = set_window_rect(session, {}) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + response = set_window_rect(session, {"width": 750, "height": 700}) + value = assert_success(response) + assert value["width"] == 750 + assert value["height"] == 700 + + @pytest.mark.parametrize("rect", [ {"width": "a"}, {"height": "b"}, diff --git a/tests/wpt/web-platform-tests/webdriver/tests/support/fixtures.py b/tests/wpt/web-platform-tests/webdriver/tests/support/fixtures.py index 364ede1c93b..957c4d05868 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/support/fixtures.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/support/fixtures.py @@ -211,6 +211,32 @@ def create_dialog(session): return create_dialog +@pytest.fixture +def closed_frame(session, url): + original_handle = session.window_handle + new_handle = session.new_window() + + session.window_handle = new_handle + + session.url = url("/webdriver/tests/support/html/frames.html") + + subframe = session.find.css("#sub-frame", all=False) + session.switch_frame(subframe) + + deleteframe = session.find.css("#delete-frame", all=False) + session.switch_frame(deleteframe) + + button = session.find.css("#remove-parent", all=False) + button.click() + + yield + + session.window.close() + assert new_handle not in session.handles, "Unable to close window {}".format(new_handle) + + session.window_handle = original_handle + + @pytest.fixture def closed_window(session): original_handle = session.window_handle diff --git a/tests/wpt/web-platform-tests/webdriver/tests/support/html/deleteframe.html b/tests/wpt/web-platform-tests/webdriver/tests/support/html/deleteframe.html index e0063fd1b0f..fd757e6db0d 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/support/html/deleteframe.html +++ b/tests/wpt/web-platform-tests/webdriver/tests/support/html/deleteframe.html @@ -1,5 +1,6 @@ - + + diff --git a/tests/wpt/web-platform-tests/webdriver/tests/support/html/frames.html b/tests/wpt/web-platform-tests/webdriver/tests/support/html/frames.html index 2019485529f..81c6f9b3833 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/support/html/frames.html +++ b/tests/wpt/web-platform-tests/webdriver/tests/support/html/frames.html @@ -2,7 +2,7 @@ + + +
+ +
+ + diff --git a/tests/wpt/web-platform-tests/webdriver/tests/switch_to_frame/switch.py b/tests/wpt/web-platform-tests/webdriver/tests/switch_to_frame/switch.py index 723c48c3e85..705fa79a5de 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/switch_to_frame/switch.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/switch_to_frame/switch.py @@ -2,7 +2,7 @@ import pytest import webdriver.protocol as protocol -from webdriver import NoSuchElementException, StaleElementReferenceException +from webdriver import StaleElementReferenceException from webdriver.transport import Response from tests.support.asserts import assert_error, assert_same_element, assert_success @@ -37,17 +37,36 @@ def test_null_response_value(session): assert value is None +@pytest.mark.parametrize("id", [ + None, + 0, + {"element-6066-11e4-a52e-4f735466cecf": "foo"}, +]) +def test_no_top_browsing_context(session, closed_window, id): + response = switch_to_frame(session, id) + assert_error(response, "no such window") + + +@pytest.mark.parametrize("id", [ + None, + 0, + {"element-6066-11e4-a52e-4f735466cecf": "foo"}, +]) +def test_no_browsing_context(session, closed_frame, id): + response = switch_to_frame(session, id) + if id is None: + assert_success(response) + session.find.css("#delete", all=False) + else: + assert_error(response, "no such window") + + @pytest.mark.parametrize("value", ["foo", True, [], {}]) def test_frame_id_invalid_types(session, value): response = switch_to_frame(session, value) assert_error(response, "invalid argument") -def test_no_browsing_context(session, closed_window): - response = switch_to_frame(session, 1) - assert_error(response, "no such window") - - def test_frame_id_null(session): session.url = inline(iframe("{}
foo".format(iframe("

bar")))) @@ -70,22 +89,3 @@ def test_frame_id_null(session): frame = session.find.css("iframe", all=False) assert_same_element(session, frame, frame1) - - -def test_frame_deleted(session, url): - session.url = url("/webdriver/tests/support/html/frames.html") - frame = session.find.css("iframe", all=False) - - response = switch_to_frame(session, frame) - assert_success(response) - - input = session.find.css("input", all=False) - input.click() - - response = switch_to_frame(session, None) - assert_success(response) - - with pytest.raises(NoSuchElementException): - session.find.css("iframe", all=False) - - session.find.css("#delete", all=False) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/switch_to_parent_frame/switch.py b/tests/wpt/web-platform-tests/webdriver/tests/switch_to_parent_frame/switch.py index 6b9c90f0cd8..ef2da45f162 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/switch_to_parent_frame/switch.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/switch_to_parent_frame/switch.py @@ -21,11 +21,34 @@ def test_null_response_value(session): assert value is None -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = switch_to_parent_frame(session) assert_error(response, "no such window") +def test_no_parent_browsing_context(session, url): + session.url = url("/webdriver/tests/support/html/frames.html") + + subframe = session.find.css("#sub-frame", all=False) + session.switch_frame(subframe) + + deleteframe = session.find.css("#delete-frame", all=False) + session.switch_frame(deleteframe) + + button = session.find.css("#remove-top", all=False) + button.click() + + response = switch_to_parent_frame(session) + assert_error(response, "no such window") + + +def test_no_browsing_context(session, closed_frame): + response = switch_to_parent_frame(session) + assert_success(response) + + session.find.css("#delete", all=False) + + def test_stale_element_from_iframe(session): session.url = inline(iframe("

foo")) frame_element = session.find.css("iframe", all=False) @@ -37,3 +60,8 @@ def test_stale_element_from_iframe(session): with pytest.raises(StaleElementReferenceException): stale_element.text + + +def test_switch_from_top_level(session): + result = switch_to_parent_frame(session) + assert_success(result) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/switch_to_window/switch.py b/tests/wpt/web-platform-tests/webdriver/tests/switch_to_window/switch.py index 8fb80fb3238..98b4bee16e2 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/switch_to_window/switch.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/switch_to_window/switch.py @@ -19,3 +19,35 @@ def test_null_response_value(session): response = switch_to_window(session, session.new_window()) value = assert_success(response) assert value is None + + +def test_no_top_browsing_context(session): + original_handle = session.window_handle + new_handle = session.new_window() + + session.window.close() + assert original_handle not in session.handles, "Unable to close window" + + response = switch_to_window(session, new_handle) + assert_success(response) + + assert session.window_handle == new_handle + + +def test_no_browsing_context(session, url): + new_handle = session.new_window() + + session.url = url("/webdriver/tests/support/html/frames.html") + subframe = session.find.css("#sub-frame", all=False) + session.switch_frame(subframe) + + deleteframe = session.find.css("#delete-frame", all=False) + session.switch_frame(deleteframe) + + button = session.find.css("#remove-parent", all=False) + button.click() + + response = switch_to_window(session, new_handle) + assert_success(response) + + assert session.window_handle == new_handle diff --git a/tests/wpt/web-platform-tests/webdriver/tests/take_element_screenshot/screenshot.py b/tests/wpt/web-platform-tests/webdriver/tests/take_element_screenshot/screenshot.py index 50d33a266db..6ff6396edb2 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/take_element_screenshot/screenshot.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/take_element_screenshot/screenshot.py @@ -15,11 +15,21 @@ def take_element_screenshot(session, element_id): ) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = take_element_screenshot(session, "foo") assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + session.url = inline("") + element = session.find.css("input", all=False) + + response = take_element_screenshot(session, element.id) + screenshot = assert_success(response) + + assert png_dimensions(screenshot) == element_dimensions(session, element) + + def test_stale(session): session.url = inline("") element = session.find.css("input", all=False) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/take_screenshot/screenshot.py b/tests/wpt/web-platform-tests/webdriver/tests/take_screenshot/screenshot.py index ca6e0272637..d6130919167 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/take_screenshot/screenshot.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/take_screenshot/screenshot.py @@ -10,11 +10,21 @@ def take_screenshot(session): "GET", "session/{session_id}/screenshot".format(**vars(session))) -def test_no_browsing_context(session, closed_window): +def test_no_top_browsing_context(session, closed_window): response = take_screenshot(session) assert_error(response, "no such window") +def test_no_browsing_context(session, closed_frame): + session.url = inline("") + + response = take_screenshot(session) + value = assert_success(response) + + assert_png(value) + assert png_dimensions(value) == viewport_dimensions(session) + + def test_format_and_dimensions(session): session.url = inline("") diff --git a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-errors.https.html b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-errors.https.html new file mode 100644 index 00000000000..8dab9566ab5 --- /dev/null +++ b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-errors.https.html @@ -0,0 +1,83 @@ + + + +RTCPeerConnection Insertable Streams - Errors + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-legacy.https.html b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-legacy.https.html new file mode 100644 index 00000000000..3138f1878ef --- /dev/null +++ b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-legacy.https.html @@ -0,0 +1,115 @@ + + + +RTCPeerConnection Insertable Streams - Legacy API + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-video-frames.https.html b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-video-frames.https.html new file mode 100644 index 00000000000..136f4ec9f4c --- /dev/null +++ b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-video-frames.https.html @@ -0,0 +1,76 @@ + + + +RTCPeerConnection Insertable Streams - Video Frames + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-video.https.html b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-video.https.html new file mode 100644 index 00000000000..4bb757d27b4 --- /dev/null +++ b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-video.https.html @@ -0,0 +1,135 @@ + + + +RTCPeerConnection Insertable Streams - Video + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-worker.https.html b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-worker.https.html new file mode 100644 index 00000000000..a21a0d90e55 --- /dev/null +++ b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams-worker.https.html @@ -0,0 +1,65 @@ + + + +RTCPeerConnection Insertable Streams - Worker + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams.https.html b/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams.https.html deleted file mode 100644 index de225d50899..00000000000 --- a/tests/wpt/web-platform-tests/webrtc-insertable-streams/RTCPeerConnection-insertable-streams.https.html +++ /dev/null @@ -1,417 +0,0 @@ - - - -RTCPeerConnection Insertable Streams - - - - - - - - - diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-setCodecPreferences.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-setCodecPreferences.html index bed359512a4..a5df6a9d2b2 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-setCodecPreferences.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-setCodecPreferences.html @@ -29,6 +29,11 @@ codecs does not fulfill these requirements, the user agent MUST throw an InvalidModificationError. */ + /* + * Chromium note: this requires build bots with H264 support. See + * https://bugs.chromium.org/p/chromium/issues/detail?id=840659 + * for details on how to enable support. + */ test((t) => { const pc = new RTCPeerConnection(); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html index 4f57dc7b6d3..30cb6130d4f 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html @@ -79,4 +79,29 @@ promise_test(async (t)=> { assert_true(offer.sdp.includes("a=inactive"), "The audio m-section should be inactive"); }, "A stopped inactive transceiver should generate an inactive m-section in the offer"); + +promise_test(async (t) => { + const pc1 = new RTCPeerConnection(); + const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); + t.add_cleanup(() => pc2.close()); + pc1.addTransceiver("audio"); + await exchangeOfferAnswer(pc1, pc2); + pc1.getTransceivers()[0].stop(); + await exchangeOfferAnswer(pc1, pc2); + await pc1.setLocalDescription(await pc1.createOffer()); +}, 'If a track is stopped locally, setting a locally generated answer should still work'); + +promise_test(async (t) => { + const pc1 = new RTCPeerConnection(); + const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); + t.add_cleanup(() => pc2.close()); + pc1.addTransceiver("audio"); + await exchangeOfferAnswer(pc1, pc2); + pc2.getTransceivers()[0].stop(); + await exchangeOfferAnswer(pc2, pc1); + await pc1.setLocalDescription(await pc1.createOffer()); +}, 'If a track is stopped remotely, setting a locally generated answer should still work'); + diff --git a/tests/wpt/web-platform-tests/webrtc/protocol/video-codecs.https.html b/tests/wpt/web-platform-tests/webrtc/protocol/video-codecs.https.html index a4905ae441a..4ce0618bca3 100644 --- a/tests/wpt/web-platform-tests/webrtc/protocol/video-codecs.https.html +++ b/tests/wpt/web-platform-tests/webrtc/protocol/video-codecs.https.html @@ -7,6 +7,11 @@ + + diff --git a/tests/wpt/web-platform-tests/workers/support/Worker-run-forever-during-importScripts.js b/tests/wpt/web-platform-tests/workers/support/Worker-run-forever-during-importScripts.js new file mode 100644 index 00000000000..3a0fb4bb063 --- /dev/null +++ b/tests/wpt/web-platform-tests/workers/support/Worker-run-forever-during-importScripts.js @@ -0,0 +1 @@ +importScripts('Worker-run-forever.js'); diff --git a/tests/wpt/web-platform-tests/workers/support/Worker-run-forever-during-nested-importScripts.js b/tests/wpt/web-platform-tests/workers/support/Worker-run-forever-during-nested-importScripts.js new file mode 100644 index 00000000000..aae86a0b055 --- /dev/null +++ b/tests/wpt/web-platform-tests/workers/support/Worker-run-forever-during-nested-importScripts.js @@ -0,0 +1 @@ +importScripts('Worker-run-forever-during-importScripts.js'); diff --git a/tests/wpt/web-platform-tests/workers/support/Worker-run-forever.js b/tests/wpt/web-platform-tests/workers/support/Worker-run-forever.js index 912e49de650..679f908c202 100644 --- a/tests/wpt/web-platform-tests/workers/support/Worker-run-forever.js +++ b/tests/wpt/web-platform-tests/workers/support/Worker-run-forever.js @@ -1 +1,2 @@ +postMessage('start'); while(1); diff --git a/tests/wpt/web-platform-tests/xhr/xhr-timeout-longtask.any.js b/tests/wpt/web-platform-tests/xhr/xhr-timeout-longtask.any.js new file mode 100644 index 00000000000..161713104ae --- /dev/null +++ b/tests/wpt/web-platform-tests/xhr/xhr-timeout-longtask.any.js @@ -0,0 +1,14 @@ +async_test(function() { + var client = new XMLHttpRequest(); + client.open("GET", "resources/delay.py?ms=100", true); + + client.timeout = 150; + client.ontimeout = this.step_func(assert_unreached); + client.onloadend = () => this.done(); + + client.send(); + + const start = performance.now(); + while (performance.now() - start < 200) { } +}, "Long tasks should not trigger load timeout") +