diff --git a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini index 76b44d9e9cf..3605e8f3fc9 100644 --- a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini +++ b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini @@ -4,7 +4,7 @@ expected: TIMEOUT [Opening a blob URL in a new window immediately before revoking it works.] - expected: FAIL + expected: TIMEOUT [Fetching a blob URL immediately before revoking it works in an iframe.] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini deleted file mode 100644 index 4bfb0c2053a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[hit-test-floats-004.html] - [Miss float below something else] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/css-color/system-color-compute.html.ini b/tests/wpt/metadata-layout-2020/css/css-color/system-color-compute.html.ini new file mode 100644 index 00000000000..b1408cd97b6 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-color/system-color-compute.html.ini @@ -0,0 +1,4 @@ +[system-color-compute.html] + [color-scheme property affects Menu system color keyword] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/css-flexbox/dynamic-grid-flex-abspos.html.ini b/tests/wpt/metadata-layout-2020/css/css-flexbox/dynamic-grid-flex-abspos.html.ini new file mode 100644 index 00000000000..6205691956d --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-flexbox/dynamic-grid-flex-abspos.html.ini @@ -0,0 +1,7 @@ +[dynamic-grid-flex-abspos.html] + [.relpos 4] + expected: FAIL + + [.relpos 8] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/css-flexbox/percentage-max-height-002.html.ini b/tests/wpt/metadata-layout-2020/css/css-flexbox/percentage-max-height-002.html.ini new file mode 100644 index 00000000000..fa77972eac5 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-flexbox/percentage-max-height-002.html.ini @@ -0,0 +1,2 @@ +[percentage-max-height-002.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-fonts/parsing/font-variation-settings-computed.html.ini b/tests/wpt/metadata-layout-2020/css/css-fonts/parsing/font-variation-settings-computed.html.ini new file mode 100644 index 00000000000..4040932214f --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-fonts/parsing/font-variation-settings-computed.html.ini @@ -0,0 +1,19 @@ +[font-variation-settings-computed.html] + [Property font-variation-settings value 'normal'] + expected: FAIL + + [Property font-variation-settings value '"wght" 700, "wght" 500' duplicate values should be removed, keeping the rightmost occurrence.] + expected: FAIL + + [Property font-variation-settings value '"wght" 700, "XHGT" 0.7'] + expected: FAIL + + [Property font-variation-settings value '"wght" 700'] + expected: FAIL + + [Property font-variation-settings value '"AB@D" 0.5'] + expected: FAIL + + [Property font-variation-settings value '"XHGT" calc(0.4 + 0.3)'] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/css-fonts/parsing/font-variation-settings-valid.html.ini b/tests/wpt/metadata-layout-2020/css/css-fonts/parsing/font-variation-settings-valid.html.ini new file mode 100644 index 00000000000..ffe7b3f7efe --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-fonts/parsing/font-variation-settings-valid.html.ini @@ -0,0 +1,22 @@ +[font-variation-settings-valid.html] + [e.style['font-variation-settings'\] = "\\"wght\\" 700" should set the property value] + expected: FAIL + + [e.style['font-variation-settings'\] = "'wght' 1e3, 'slnt' -450.0e-1" should set the property value] + expected: FAIL + + [e.style['font-variation-settings'\] = "\\"a cd\\" 0.5" should set the property value] + expected: FAIL + + [e.style['font-variation-settings'\] = "\\"ab@d\\" 0.5" should set the property value] + expected: FAIL + + [e.style['font-variation-settings'\] = "normal" should set the property value] + expected: FAIL + + [e.style['font-variation-settings'\] = "\\"wght\\" 700, \\"XHGT\\" 0.7" should set the property value] + expected: FAIL + + [e.style['font-variation-settings'\] = "'wght' 700" should set the property value] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-100.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-100.html.ini new file mode 100644 index 00000000000..f29c7ce67c8 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-100.html.ini @@ -0,0 +1,2 @@ +[letter-spacing-100.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-101.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-101.html.ini new file mode 100644 index 00000000000..105e019839b --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-101.html.ini @@ -0,0 +1,2 @@ +[letter-spacing-101.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-102.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-102.html.ini new file mode 100644 index 00000000000..780ae75d22c --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-102.html.ini @@ -0,0 +1,2 @@ +[letter-spacing-102.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-103.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-103.html.ini new file mode 100644 index 00000000000..feb4120085f --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-103.html.ini @@ -0,0 +1,2 @@ +[letter-spacing-103.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-104.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-104.html.ini new file mode 100644 index 00000000000..d5abf4a4388 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-104.html.ini @@ -0,0 +1,2 @@ +[letter-spacing-104.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-105.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-105.html.ini new file mode 100644 index 00000000000..2d1ed90756c --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-105.html.ini @@ -0,0 +1,2 @@ +[letter-spacing-105.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-106.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-106.html.ini new file mode 100644 index 00000000000..9f666bb8923 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-106.html.ini @@ -0,0 +1,2 @@ +[letter-spacing-106.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-112.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-112.html.ini new file mode 100644 index 00000000000..1a4d3f7c2c9 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/letter-spacing/letter-spacing-112.html.ini @@ -0,0 +1,2 @@ +[letter-spacing-112.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-transitions/transition-duration-shorthand.html.ini b/tests/wpt/metadata-layout-2020/css/css-transitions/transition-duration-shorthand.html.ini new file mode 100644 index 00000000000..7d363f15d45 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-transitions/transition-duration-shorthand.html.ini @@ -0,0 +1,4 @@ +[transition-duration-shorthand.html] + [transition-duration when looking at shorthand properties should be correct] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/cssom/CSSStyleSheet-modify-after-removal.html.ini b/tests/wpt/metadata-layout-2020/css/cssom/CSSStyleSheet-modify-after-removal.html.ini new file mode 100644 index 00000000000..dd01fab5f42 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/cssom/CSSStyleSheet-modify-after-removal.html.ini @@ -0,0 +1,7 @@ +[CSSStyleSheet-modify-after-removal.html] + [Modify sheet from removed iframe] + expected: FAIL + + [Modify constructed sheet from removed iframe] + 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 b6cda2233a8..f83ba5155f5 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 @@ -315,15 +315,9 @@ [ + diff --git a/tests/wpt/web-platform-tests/css/css-images/image-orientation/image-orientation-list-style-image.html b/tests/wpt/web-platform-tests/css/css-images/image-orientation/image-orientation-list-style-image.html index 33730a323ad..926b3ab9ff0 100644 --- a/tests/wpt/web-platform-tests/css/css-images/image-orientation/image-orientation-list-style-image.html +++ b/tests/wpt/web-platform-tests/css/css-images/image-orientation/image-orientation-list-style-image.html @@ -1,6 +1,6 @@ -CSS Images Module Level 3: image-orientation does not apply to list-style-image +CSS Images Module Level 3: image-orientation does apply to list-style-image diff --git a/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-background-image-ref.html b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-background-image-ref.html index e5709064798..a3e2ece6e7c 100644 --- a/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-background-image-ref.html +++ b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-background-image-ref.html @@ -2,8 +2,9 @@ CSS Reference -
-
- +
+
diff --git a/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-border-image-ref.html b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-border-image-ref.html index 3f9b68832b1..51aa8d0e467 100644 --- a/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-border-image-ref.html +++ b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-border-image-ref.html @@ -6,8 +6,9 @@ div { width: 100px; height: 50px; border: 10px solid black; - border-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg) 10; } +.orient { border-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg) 10; } +.no-orient { border-image: url(../support/exif-orientation-9-u.jpg) 10; } -
-
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-iframe-ref.html b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-iframe-ref.html new file mode 100644 index 00000000000..a9e9b3fbe30 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-iframe-ref.html @@ -0,0 +1,5 @@ + + +CSS Reference + + diff --git a/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-list-style-image-ref.html b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-list-style-image-ref.html index 433cf98e636..8dcef6a2439 100644 --- a/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-list-style-image-ref.html +++ b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-list-style-image-ref.html @@ -2,7 +2,9 @@ CSS Reference - - + + diff --git a/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-mask-image-ref.html b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-mask-image-ref.html index ff078244151..ba593032456 100644 --- a/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-mask-image-ref.html +++ b/tests/wpt/web-platform-tests/css/css-images/image-orientation/reference/image-orientation-mask-image-ref.html @@ -6,9 +6,10 @@ div { width: 100px; height: 50px; background: blue; - mask-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg); mask-mode: luminance; } +.orient { mask-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg); } +.no-orient { mask-image: url(../support/exif-orientation-9-u.jpg); } -
-
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-images/image-orientation/support/cursor-8-llo.jpg b/tests/wpt/web-platform-tests/css/css-images/image-orientation/support/cursor-8-llo.jpg new file mode 100644 index 00000000000..ef26ad4aaae Binary files /dev/null and b/tests/wpt/web-platform-tests/css/css-images/image-orientation/support/cursor-8-llo.jpg differ diff --git a/tests/wpt/web-platform-tests/css/css-multicol/non-adjacent-spanners-000.html b/tests/wpt/web-platform-tests/css/css-multicol/non-adjacent-spanners-000.html new file mode 100644 index 00000000000..7e6ec67e298 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/non-adjacent-spanners-000.html @@ -0,0 +1,11 @@ + + + + +

Test passes if there is a filled green square.

+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/non-adjacent-spanners-001.html b/tests/wpt/web-platform-tests/css/css-multicol/non-adjacent-spanners-001.html new file mode 100644 index 00000000000..fa8dfc8bcdf --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/non-adjacent-spanners-001.html @@ -0,0 +1,10 @@ + + + + +

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

+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/remove-inline-with-block-beside-spanners-crash.html b/tests/wpt/web-platform-tests/css/css-multicol/remove-inline-with-block-beside-spanners-crash.html new file mode 100644 index 00000000000..d48ff19b99a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/remove-inline-with-block-beside-spanners-crash.html @@ -0,0 +1,23 @@ + + + +
+
+ + + + +
+ diff --git a/tests/wpt/web-platform-tests/css/css-multicol/remove-inline-with-block-beside-spanners.html b/tests/wpt/web-platform-tests/css/css-multicol/remove-inline-with-block-beside-spanners.html new file mode 100644 index 00000000000..c943e549860 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/remove-inline-with-block-beside-spanners.html @@ -0,0 +1,24 @@ + + + + + + +

Test passes if there is a filled green square.

+
+
+
+
+ diff --git a/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-000.html b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-000.html new file mode 100644 index 00000000000..f700235621a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-000.html @@ -0,0 +1,13 @@ + + + + +

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

+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-001.html b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-001.html new file mode 100644 index 00000000000..2cfbd2defa5 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-001.html @@ -0,0 +1,13 @@ + + + + +

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

+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-002.html b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-002.html new file mode 100644 index 00000000000..970a1ecbfe7 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-002.html @@ -0,0 +1,14 @@ + + + + +

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

+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-003.html b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-003.html new file mode 100644 index 00000000000..857ccf92ba9 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-003.html @@ -0,0 +1,12 @@ + + + + +

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

+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-004.html b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-004.html new file mode 100644 index 00000000000..2199a9340b5 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-004.html @@ -0,0 +1,17 @@ + + + + + +

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

+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-005.html b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-005.html new file mode 100644 index 00000000000..56e35c74daf --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-005.html @@ -0,0 +1,17 @@ + + + + + +

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

+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-006.html b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-006.html new file mode 100644 index 00000000000..60325b1d178 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-006.html @@ -0,0 +1,21 @@ + + + + + +

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

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-007.html b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-007.html new file mode 100644 index 00000000000..ea71c779fea --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-007.html @@ -0,0 +1,14 @@ + + + + + +

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

+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-008.html b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-008.html new file mode 100644 index 00000000000..d28eafe6555 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-multicol/spanner-fragmentation-008.html @@ -0,0 +1,16 @@ + + + + + +

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

+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-position/invalidate-opacity-negative-z-index-ref.html b/tests/wpt/web-platform-tests/css/css-position/invalidate-opacity-negative-z-index-ref.html new file mode 100644 index 00000000000..4f8d043e5a3 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-position/invalidate-opacity-negative-z-index-ref.html @@ -0,0 +1,8 @@ + + + + + +
+
diff --git a/tests/wpt/web-platform-tests/css/css-position/invalidate-opacity-negative-z-index.html b/tests/wpt/web-platform-tests/css/css-position/invalidate-opacity-negative-z-index.html new file mode 100644 index 00000000000..52deaa08061 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-position/invalidate-opacity-negative-z-index.html @@ -0,0 +1,19 @@ + + + + + + + +
+
+ + diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-100.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-100.html new file mode 100644 index 00000000000..57fad60d7f3 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-100.html @@ -0,0 +1,67 @@ + + + +letter-spacing at line endings (letters) + + + + + + +
Test passes if the pattern is identical in all four blue boxes.
+ + +
+ +

1 2

+ +

12三456七89

+ +

123
4 5
678

+

123 4 5 678

+
+ + +
+ +

1 2

+ +

1 2 三456七 8 9

+ +

1 2 3
4 5
6 7 8

+

1 2 3 4 5 6 7 8

+
+ + +
+ +

1 2

+ +

1 2 三456七 8 9

+ +

1 2 3
4 5
6 7 8

+

1 2 3 4 5 6 7 8

+
+ + +
+

1 2

+

1 2 三
4 5 6
七 8 9

+

1 2 3
4 5
6 7 8

+

1 2 3
4 5
6 7 8

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-101.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-101.html new file mode 100644 index 00000000000..dcf5e96cd80 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-101.html @@ -0,0 +1,69 @@ + + + +letter-spacing at line endings (spaces) + + + + + + +
Test passes if the pattern is identical in all four blue boxes.
+ + +
+ +

x

+ +

xx ​ x ​ xx

+ +

xx
x
xx

+

xx x xx

+
+ + +
+ +

x

+ +

x x ​ x ​ x x

+ +

x x
x
x x

+

x x x x x

+
+ + +
+ +

x

+ +

x x ​ x ​ x x

+ +

x x
x
x x

+

x x x x x

+
+ + +
+

x

+

x x
x
x x

+

x x
x
x x

+

x x
x
x x

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-102.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-102.html new file mode 100644 index 00000000000..6e045c6c430 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-102.html @@ -0,0 +1,46 @@ + + + +letter-spacing on zero-width characters + + + + + + +
Test passes if there is a green rectangle below and no red.
+ +
+
+​‌‍‎‏⁦⁧⁨‪‫‬‭‮⁩⁩⁠⁡⁢⁣⁤x​‌‍‎‏⁦⁧⁨‪‫‬‭‮⁩⁩⁠⁡⁢⁣⁤x​‌‍‎‏⁦⁧⁨‪‫‬‭‮⁩⁩⁠⁡⁢⁣⁤
+​‌‍‎‏⁦⁧⁨‪‫‬‭‮⁩⁩⁠⁡⁢⁣⁤xx​‌‍‎‏⁦⁧⁨‪‫‬‭‮⁩⁩⁠⁡⁢⁣⁤ +
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-103.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-103.html new file mode 100644 index 00000000000..42e78822d71 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-103.html @@ -0,0 +1,71 @@ + + + +letter-spacing at element boundaries + + + + + + +
Test passes if the pattern is identical in both blue boxes.
+ +
+ +

AAABBB

+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAA BBB

+

AAA BBB

+
+ +
+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A AB B B

+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A A B B B

+ +

AAA BBB

+

AAA B B B

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-104.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-104.html new file mode 100644 index 00000000000..763c6666e23 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-104.html @@ -0,0 +1,82 @@ + + + +letter-spacing at element boundaries + + + + + + +
Test passes if the pattern is identical in all blue boxes.
+ +
+

AD

+

AD

+

AD

+

AD

+

AD

+

AD

+
+ +
+

AD

+

AD

+

AD

+

AD

+

AD

+

AD

+
+ +
+

AD

+

AD

+

AD

+

AD

+

AD

+

AD

+
+ +
+

A D

+

A D

+

A D

+

A D

+

A D

+

A D

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-105.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-105.html new file mode 100644 index 00000000000..a94daa0aff2 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-105.html @@ -0,0 +1,39 @@ + + + +letter-spacing at element boundaries + + + + + + +
Test passes if the pattern is identical in both blue boxes.
+ +
+

AD

+
+ +
+

A D +

diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-106.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-106.html new file mode 100644 index 00000000000..4ebf9a3d465 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-106.html @@ -0,0 +1,101 @@ + + + +letter-spacing at element boundaries + + + + + + +
Test passes if the pattern is identical in all three blue boxes.
+ +
+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAA BBB

+

AAA BBB

+
+ +
+
+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAABBB

+

AAABBB

+ +

AAA BBB

+

AAA BBB

+
+
+ +
+

A A A B B B

+ +

AAA BBB

+

A A AB B B

+ +

AAA B B B

+

A A A B B B

+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A A B B B

+ +

AAA BBB

+

AAA B B B

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-111.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-111.html new file mode 100644 index 00000000000..d143cf0713a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-111.html @@ -0,0 +1,38 @@ + + + +letter-spacing at element boundaries + + + + + + + +
Test passes if the blue pattern is identical to the black one.
+ +
+

ABC

+
+ +
+

A B C +

diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-112.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-112.html new file mode 100644 index 00000000000..a998c4ffdec --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/letter-spacing-112.html @@ -0,0 +1,36 @@ + + + +letter-spacing at element boundaries + + + + + + + +
Test passes if the blue pattern is identical to the black one.
+ +
+

AaBBb

+
+ +
+

Aa B Bb

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-100-ref.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-100-ref.html new file mode 100644 index 00000000000..d6e87a56d92 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-100-ref.html @@ -0,0 +1,52 @@ + + + +CSS Test Reference + + + +
Test passes if the pattern is identical in all four blue boxes.
+ + +
+

x x

+

x x 水
x x x
水 x x

+

x x x
x x
x x x

+

x x x
x x
x x x

+
+ + +
+

x x

+

x x 水
x x x
水 x x

+

x x x
x x
x x x

+

x x x
x x
x x x

+
+ + +
+

x x

+

x x 水
x x x
水 x x

+

x x x
x x
x x x

+

x x x
x x
x x x

+
+ + +
+

x x

+

x x 水
x x x
水 x x

+

x x x
x x
x x x

+

x x x
x x
x x x

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-101-ref.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-101-ref.html new file mode 100644 index 00000000000..6898da609d2 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-101-ref.html @@ -0,0 +1,50 @@ + + + +CSS Test Reference + + + +
Test passes if the pattern is identical in all four blue boxes.
+ + +
+

x

+

x x
x
x x

+

x x
x
x x

+

x x
x
x x

+
+ + +
+

x

+

x x
x
x x

+

x x
x
x x

+

x x
x
x x

+
+ + +
+

x

+

x x
x
x x

+

x x
x
x x

+

x x
x
x x

+
+ + +
+

x

+

x x
x
x x

+

x x
x
x x

+

x x
x
x x

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-102-ref.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-102-ref.html new file mode 100644 index 00000000000..08ea8e56e3d --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-102-ref.html @@ -0,0 +1,14 @@ + + + +CSS Test Reference + + + +
Test passes if there is a green rectangle below and no red.
+ +
xx
xx
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-103-ref.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-103-ref.html new file mode 100644 index 00000000000..3461347a28e --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-103-ref.html @@ -0,0 +1,58 @@ + + + +CSS Test Reference + + + +
Test passes if the pattern is identical in both blue boxes.
+ +
+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A AB B B

+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A A B B B

+ +

AAA BBB

+

AAA B B B

+
+ +
+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A AB B B

+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A A B B B

+ +

AAA BBB

+

AAA B B B

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-104-ref.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-104-ref.html new file mode 100644 index 00000000000..078656c4631 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-104-ref.html @@ -0,0 +1,74 @@ + + + +CSS Test Reference + + + +
Test passes if the pattern is identical in all blue boxes.
+ +
+

A D

+

A D

+

A D

+

A D

+

A D

+

A D

+
+ +
+

A D

+

A D

+

A D

+

A D

+

A D

+

A D

+
+ +
+

A D

+

A D

+

A D

+

A D

+

A D

+

A D

+
+ +
+

A D

+

A D

+

A D

+

A D

+

A D

+

A D

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-105-ref.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-105-ref.html new file mode 100644 index 00000000000..3c6e2aa60e4 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-105-ref.html @@ -0,0 +1,36 @@ + + + +letter-spacing at element boundaries + + + +
Test passes if the pattern is identical in both blue boxes.
+ +
+

A D +

+ +
+

A D +

diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-106-ref.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-106-ref.html new file mode 100644 index 00000000000..36bad163f0a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-106-ref.html @@ -0,0 +1,84 @@ + + + +letter-spacing at element boundaries + + + +
Test passes if the pattern is identical in all three blue boxes.
+ +
+

A A A B B B

+ +

AAA BBB

+

A A AB B B

+ +

AAA B B B

+

A A A B B B

+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A A B B B

+ +

AAA BBB

+

AAA B B B

+
+ +
+

A A A B B B

+ +

AAA BBB

+

A A AB B B

+ +

AAA B B B

+

A A A B B B

+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A A B B B

+ +

AAA BBB

+

AAA B B B

+
+ +
+

A A A B B B

+ +

AAA BBB

+

A A AB B B

+ +

AAA B B B

+

A A A B B B

+ +

AAA BBB

+

A A AB B B

+ +

AAAB B B

+

A A A B B B

+ +

AAA BBB

+

AAA B B B

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-111-ref.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-111-ref.html new file mode 100644 index 00000000000..9b3499ed7c5 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-111-ref.html @@ -0,0 +1,29 @@ + + + +letter-spacing at element boundaries + + + +
Test passes if the blue pattern is identical to the black one.
+ +
+

A B C +

+ +
+

A B C +

diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-112-ref.html b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-112-ref.html new file mode 100644 index 00000000000..889803699d4 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/reference/letter-spacing-112-ref.html @@ -0,0 +1,28 @@ + + + +CSS Test Reference + + + +
Test passes if the blue pattern is identical to the black one.
+ +
+

Aa B Bb

+
+ +
+

Aa B Bb

+
diff --git a/tests/wpt/web-platform-tests/css/css-text/letter-spacing/support/swatch-orange.png b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/support/swatch-orange.png new file mode 100644 index 00000000000..d3cd498b52b Binary files /dev/null and b/tests/wpt/web-platform-tests/css/css-text/letter-spacing/support/swatch-orange.png differ diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-letter-spacing-001.html b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-letter-spacing-001.html index 5d65c67c320..8d8ab401e83 100644 --- a/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-letter-spacing-001.html +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/white-space-letter-spacing-001.html @@ -6,7 +6,6 @@ - +
+ diff --git a/tests/wpt/web-platform-tests/css/css-typed-om/stylevalue-subclasses/cssTransformComponent-toMatrix.html b/tests/wpt/web-platform-tests/css/css-typed-om/stylevalue-subclasses/cssTransformComponent-toMatrix.html index 14d819be40a..d3e510296bd 100644 --- a/tests/wpt/web-platform-tests/css/css-typed-om/stylevalue-subclasses/cssTransformComponent-toMatrix.html +++ b/tests/wpt/web-platform-tests/css/css-typed-om/stylevalue-subclasses/cssTransformComponent-toMatrix.html @@ -51,7 +51,7 @@ test(() => { test(() => { const component = new CSSSkewX( - new CSSUnitValue(10, 'rad'), + new CSSUnitValue(10, 'deg'), ); const expectedMatrix = (new DOMMatrixReadOnly()).skewX(10); assert_matrix_approx_equals(component.toMatrix(), expectedMatrix, gEpsilon); @@ -59,7 +59,7 @@ test(() => { test(() => { const component = new CSSSkewY( - new CSSUnitValue(10, 'rad'), + new CSSUnitValue(10, 'deg'), ); const expectedMatrix = (new DOMMatrixReadOnly()).skewY(10); assert_matrix_approx_equals(component.toMatrix(), expectedMatrix, gEpsilon); diff --git a/tests/wpt/web-platform-tests/css/cssom-view/MediaQueryList-change-event-matches-value.html b/tests/wpt/web-platform-tests/css/cssom-view/MediaQueryList-change-event-matches-value.html new file mode 100644 index 00000000000..d96c6bdff78 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/cssom-view/MediaQueryList-change-event-matches-value.html @@ -0,0 +1,32 @@ + +MediaQueryList.changed is correct for all lists in the document even during a change event handler + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-modify-after-removal.html b/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-modify-after-removal.html new file mode 100644 index 00000000000..010c0b93281 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/cssom/CSSStyleSheet-modify-after-removal.html @@ -0,0 +1,29 @@ + +CSS Test: CSSStyleSheet modifications after removal + + + + + + + diff --git a/tests/wpt/web-platform-tests/docs/writing-tests/testharness-api.md b/tests/wpt/web-platform-tests/docs/writing-tests/testharness-api.md index bd7d42be968..72263dbd4ea 100644 --- a/tests/wpt/web-platform-tests/docs/writing-tests/testharness-api.md +++ b/tests/wpt/web-platform-tests/docs/writing-tests/testharness-api.md @@ -528,6 +528,10 @@ with some existing test framework that has its own timeout mechanism). `allow_uncaught_exception` - don't treat an uncaught exception as an error; needed when e.g. testing the `window.onerror` handler. +`hide_test_state` - hide the test state output while the test is +running; This is helpful when the output of the test state may interfere +the test results. + `timeout_multiplier` - Multiplier to apply to per-test timeouts. `single_test` - Test authors may set this property to `true` to enable [the diff --git a/tests/wpt/web-platform-tests/document-policy/echo-policy-nested.html.headers b/tests/wpt/web-platform-tests/document-policy/echo-policy-nested.html.headers index fe839ef5bb6..a6c7386bda0 100644 --- a/tests/wpt/web-platform-tests/document-policy/echo-policy-nested.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/echo-policy-nested.html.headers @@ -1 +1 @@ -Document-Policy: unoptimized-lossless-images;bpp=0.0 +Document-Policy: unoptimized-lossless-images=0.0 diff --git a/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers index bebb5d05482..745da550ee5 100644 --- a/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-tentative.html.headers @@ -1 +1 @@ -Document-Policy: no-layout-animations +Document-Policy: layout-animations=?0 diff --git a/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers index bebb5d05482..745da550ee5 100644 --- a/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-violation-report-js-tentative.html.headers @@ -1 +1 @@ -Document-Policy: no-layout-animations +Document-Policy: layout-animations=?0 diff --git a/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers index bebb5d05482..745da550ee5 100644 --- a/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/experimental-features/layout-animations-disabled-violation-report-keyframes-tentative.html.headers @@ -1 +1 @@ -Document-Policy: no-layout-animations +Document-Policy: layout-animations=?0 diff --git a/tests/wpt/web-platform-tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers b/tests/wpt/web-platform-tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers index d73d2520cb2..cf59933e8dd 100644 --- a/tests/wpt/web-platform-tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/experimental-features/unsized-media.tentative.https.sub.html.headers @@ -1 +1 @@ -Document-Policy: no-unsized-media +Document-Policy: unsized-media=?0 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/font-display-document-policy-01.tentative.html.headers index e1387f50dee..01b8bbccd44 100644 --- 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/font-display-document-policy-01.tentative.html.headers @@ -1 +1 @@ -Document-Policy: no-font-display-late-swap +Document-Policy: font-display-late-swap=?0 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/font-display-document-policy-report-only.tentative.html.headers index e090edd0da4..15091272777 100644 --- 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/font-display-document-policy-report-only.tentative.html.headers @@ -1 +1 @@ -Document-Policy-Report-Only: no-font-display-late-swap \ No newline at end of file +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/font-display-document-policy-reporting.tentative.html.headers b/tests/wpt/web-platform-tests/document-policy/font-display/font-display-document-policy-reporting.tentative.html.headers index 84ad7cbf97b..273ca3564df 100644 --- 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/font-display-document-policy-reporting.tentative.html.headers @@ -1 +1 @@ -Document-Policy: no-font-display-late-swap \ No newline at end of file +Document-Policy: font-display-late-swap=?0 \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/document-policy/reporting/oversized-images-reporting.html.headers b/tests/wpt/web-platform-tests/document-policy/reporting/oversized-images-reporting.html.headers index 206db539c1e..10f5be1c334 100644 --- a/tests/wpt/web-platform-tests/document-policy/reporting/oversized-images-reporting.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/reporting/oversized-images-reporting.html.headers @@ -1 +1 @@ -Document-Policy: oversized-images;scale=2.0 +Document-Policy: oversized-images=2.0 diff --git a/tests/wpt/web-platform-tests/document-policy/reporting/unoptimized-lossy-images-reporting-onload.html.headers b/tests/wpt/web-platform-tests/document-policy/reporting/unoptimized-lossy-images-reporting-onload.html.headers index 261d5db13e3..3cad9badac3 100644 --- a/tests/wpt/web-platform-tests/document-policy/reporting/unoptimized-lossy-images-reporting-onload.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/reporting/unoptimized-lossy-images-reporting-onload.html.headers @@ -1 +1 @@ -Document-Policy: unoptimized-lossy-images;bpp=0.5 +Document-Policy: unoptimized-lossy-images=0.5 diff --git a/tests/wpt/web-platform-tests/document-policy/reporting/unoptimized-lossy-images-reporting.html.headers b/tests/wpt/web-platform-tests/document-policy/reporting/unoptimized-lossy-images-reporting.html.headers index 261d5db13e3..3cad9badac3 100644 --- a/tests/wpt/web-platform-tests/document-policy/reporting/unoptimized-lossy-images-reporting.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/reporting/unoptimized-lossy-images-reporting.html.headers @@ -1 +1 @@ -Document-Policy: unoptimized-lossy-images;bpp=0.5 +Document-Policy: unoptimized-lossy-images=0.5 diff --git a/tests/wpt/web-platform-tests/document-policy/reporting/unsized-media-reporting.html.headers b/tests/wpt/web-platform-tests/document-policy/reporting/unsized-media-reporting.html.headers index d73d2520cb2..cf59933e8dd 100644 --- a/tests/wpt/web-platform-tests/document-policy/reporting/unsized-media-reporting.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/reporting/unsized-media-reporting.html.headers @@ -1 +1 @@ -Document-Policy: no-unsized-media +Document-Policy: unsized-media=?0 diff --git a/tests/wpt/web-platform-tests/document-policy/required-policy/document-policy.html b/tests/wpt/web-platform-tests/document-policy/required-policy/document-policy.html index 1935be3dd0a..b7fbceb2acd 100644 --- a/tests/wpt/web-platform-tests/document-policy/required-policy/document-policy.html +++ b/tests/wpt/web-platform-tests/document-policy/required-policy/document-policy.html @@ -33,9 +33,9 @@ async_test(t => { async_test(t => { var iframe = document.createElement('iframe'); iframe.src = "/document-policy/echo-policy.py?id=2"; - iframe.policy = "no-font-display-late-swap"; + iframe.policy = "font-display-late-swap=?0"; callbacks["2"] = t.step_func_done(result => { - assert_equals(result, "no-font-display-late-swap"); + assert_equals(result, "font-display-late-swap=?0"); }); document.body.appendChild(iframe); }, "Child frame can have a required policy independent of the parent document."); @@ -43,9 +43,9 @@ async_test(t => { async_test(t => { var iframe = document.createElement('iframe'); iframe.src = "/document-policy/echo-policy.py?id=3"; - iframe.policy = "unoptimized-lossless-images;bpp=4"; + iframe.policy = "unoptimized-lossless-images=4"; callbacks["3"] = t.step_func_done(result => { - assert_equals(result, "unoptimized-lossless-images;bpp=4.0"); + assert_equals(result, "unoptimized-lossless-images=4.0"); }); document.body.appendChild(iframe); }, "Child frame can have a required policy which is less strict than the parent document's policy."); diff --git a/tests/wpt/web-platform-tests/document-policy/required-policy/document-policy.html.headers b/tests/wpt/web-platform-tests/document-policy/required-policy/document-policy.html.headers index d321c265d15..8ea51b103f9 100644 --- a/tests/wpt/web-platform-tests/document-policy/required-policy/document-policy.html.headers +++ b/tests/wpt/web-platform-tests/document-policy/required-policy/document-policy.html.headers @@ -1 +1 @@ -Document-Policy: unoptimized-lossless-images;bpp=1.1 +Document-Policy: unoptimized-lossless-images=1.1 diff --git a/tests/wpt/web-platform-tests/document-policy/required-policy/no-document-policy.html b/tests/wpt/web-platform-tests/document-policy/required-policy/no-document-policy.html index 9af2e51c2ac..8a3624440f3 100644 --- a/tests/wpt/web-platform-tests/document-policy/required-policy/no-document-policy.html +++ b/tests/wpt/web-platform-tests/document-policy/required-policy/no-document-policy.html @@ -33,9 +33,9 @@ async_test(t => { async_test(t => { var iframe = document.createElement('iframe'); iframe.src = "/document-policy/echo-policy.py?id=2"; - iframe.policy = "no-font-display-late-swap"; + iframe.policy = "font-display-late-swap=?0"; callbacks["2"] = t.step_func_done(result => { - assert_equals(result, "no-font-display-late-swap"); + assert_equals(result, "font-display-late-swap=?0"); }); document.body.appendChild(iframe); }, "Child frame can have an explicit required policy."); diff --git a/tests/wpt/web-platform-tests/document-policy/required-policy/required-document-policy-nested.html b/tests/wpt/web-platform-tests/document-policy/required-policy/required-document-policy-nested.html index 39e2a92f773..15281fcc287 100644 --- a/tests/wpt/web-platform-tests/document-policy/required-policy/required-document-policy-nested.html +++ b/tests/wpt/web-platform-tests/document-policy/required-policy/required-document-policy-nested.html @@ -34,29 +34,29 @@ async_test(t => { // Frame tree should be: // Top: -// " % id - doc = """ + id = request.GET[b'id'] + encoding = request.GET[b'encoding'] + mode = request.GET[b'mode'] + iframe = u"" + if mode == b'NETWORK': + iframe = u"" % isomorphic_decode(id) + doc = u""" %s -""" % (id, encoding, mode, iframe) - return [("Content-Type", "text/html; charset=%s" % encoding)], doc.encode(encoding) +""" % (isomorphic_decode(id), isomorphic_decode(encoding), isomorphic_decode(mode), iframe) + return [(b"Content-Type", b"text/html; charset=%s" % encoding)], doc.encode(isomorphic_decode(encoding)) diff --git a/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py b/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py index a1736f0d700..60eb4a15a06 100644 --- a/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py +++ b/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py @@ -1,24 +1,26 @@ import os import re +from wptserve.utils import isomorphic_decode, isomorphic_encode + def main(request, response): - type = request.GET['type'] - encoding = request.GET['encoding'] + type = request.GET[b'type'] + encoding = request.GET[b'encoding'] # We want the raw input for 'q' q = re.search(r'q=([^&]+)', request.url_parts.query).groups()[0] - if type == 'html': - return [("Content-Type", "text/html; charset=utf-8")], q - elif type == 'css': - return [("Content-Type", "text/css; charset=utf-8")], "#test::before { content:'%s' }" % q - elif type == 'js': - return [("Content-Type", "text/javascript; charset=utf-8")], "%s = '%s';" % (request.GET['var'], q) - elif type == 'worker': - return [("Content-Type", "text/javascript")], "postMessage('%s'); close();" % q - elif type == 'sharedworker': - return [("Content-Type", "text/javascript")], "onconnect = function(e) { e.source.postMessage('%s'); close(); };" % q - elif type == 'worker_importScripts': - return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers - """try { + if type == b'html': + return [(b"Content-Type", b"text/html; charset=utf-8")], isomorphic_encode(q) + elif type == b'css': + return [(b"Content-Type", b"text/css; charset=utf-8")], b"#test::before { content:'%s' }" % isomorphic_encode(q) + elif type == b'js': + return [(b"Content-Type", b"text/javascript; charset=utf-8")], b"%s = '%s';" % (request.GET[b'var'], isomorphic_encode(q)) + elif type == b'worker': + return [(b"Content-Type", b"text/javascript")], b"postMessage('%s'); close();" % isomorphic_encode(q) + elif type == b'sharedworker': + return [(b"Content-Type", b"text/javascript")], b"onconnect = function(e) { e.source.postMessage('%s'); close(); };" % isomorphic_encode(q) + elif type == b'worker_importScripts': + return ([(b"Content-Type", b"text/javascript; charset=%s" % encoding)], # charset should be ignored for workers + b"""try { var x = 'importScripts failed to run'; importScripts('?q=\\u00E5&type=js&var=x&encoding=%s'); postMessage(x); @@ -26,9 +28,9 @@ def main(request, response): } catch(ex) { postMessage(String(ex)); }""" % encoding) - elif type == 'worker_worker': - return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers - """try { + elif type == b'worker_worker': + return ([(b"Content-Type", b"text/javascript; charset=%s" % encoding)], # charset should be ignored for workers + b"""try { var worker = new Worker('?q=\\u00E5&type=worker&encoding=%s'); worker.onmessage = function(e) { postMessage(e.data); @@ -37,9 +39,9 @@ def main(request, response): } catch(ex) { postMessage(String(ex)); }""" % encoding) - elif type =='worker_sharedworker': - return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers - """try { + elif type == b'worker_sharedworker': + return ([(b"Content-Type", b"text/javascript; charset=%s" % encoding)], # charset should be ignored for workers + b"""try { var worker = new SharedWorker('?q=\\u00E5&type=sharedworker&encoding=%s'); worker.port.onmessage = function(e) { postMessage(e.data); @@ -48,9 +50,9 @@ def main(request, response): } catch(ex) { postMessage(String(ex)); }""" % encoding) - elif type == 'sharedworker_importScripts': - return ([("Content-Type", "text/javascript; charset=%s" % request.GET['encoding'])], # charset should be ignored for workers - """onconnect = function(e) { + elif type == b'sharedworker_importScripts': + return ([(b"Content-Type", b"text/javascript; charset=%s" % request.GET[b'encoding'])], # charset should be ignored for workers + b"""onconnect = function(e) { var connect_port = e.source; try { var x = 'importScripts failed to run'; @@ -61,9 +63,9 @@ def main(request, response): connect_port.postMessage(String(ex)); } };""" % encoding) - elif type == 'sharedworker_worker': - return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers - """onconnect = function(e) { + elif type == b'sharedworker_worker': + return ([(b"Content-Type", b"text/javascript; charset=%s" % encoding)], # charset should be ignored for workers + b"""onconnect = function(e) { var connect_port = e.source; try { var worker = new Worker('?q=\\u00E5&type=worker&encoding=%s'); @@ -75,9 +77,9 @@ def main(request, response): connect_port.postMessage(String(ex)); } };""" % encoding) - elif type == 'sharedworker_sharedworker': - return ([("Content-Type", "text/javascript; charset=%s" % encoding)], # charset should be ignored for workers - """onconnect = function(e) { + elif type == b'sharedworker_sharedworker': + return ([(b"Content-Type", b"text/javascript; charset=%s" % encoding)], # charset should be ignored for workers + b"""onconnect = function(e) { var connect_port = e.source; try { onerror = function(msg) { @@ -94,38 +96,38 @@ def main(request, response): connect_port.postMessage(String(ex)); } };""" % encoding) - elif type == 'eventstream': - return [("Content-Type", "text/event-stream")], "data: %s\n\n" % q - elif type == 'svg': - return [("Content-Type", "image/svg+xml")], "%s" % q - elif type == 'xmlstylesheet_css': - return ([("Content-Type", "application/xhtml+xml; charset=%s" % encoding)], - (u"""""" % encoding) - .encode(encoding)) - elif type == 'png': - if q == '%E5': - image = 'green-1x1.png' - elif q == '%C3%A5': - image = 'green-2x2.png' - elif q == '%3F': - image = 'green-16x16.png' + elif type == b'eventstream': + return [(b"Content-Type", b"text/event-stream")], b"data: %s\n\n" % isomorphic_encode(q) + elif type == b'svg': + return [(b"Content-Type", b"image/svg+xml")], b"%s" % isomorphic_encode(q) + elif type == b'xmlstylesheet_css': + return ([(b"Content-Type", b"application/xhtml+xml; charset=%s" % encoding)], + (u"""""" % isomorphic_decode(encoding)) + .encode(isomorphic_decode(encoding))) + elif type == b'png': + if q == u'%E5': + image = u'green-1x1.png' + elif q == u'%C3%A5': + image = u'green-2x2.png' + elif q == u'%3F': + image = u'green-16x16.png' else: - image = 'green-256x256.png' - rv = open(os.path.join(request.doc_root, "images", image), "rb").read() - return [("Content-Type", "image/png")], rv - elif type == 'video': - ext = request.GET['ext'] - if q == '%E5': - video = 'A4' # duration: 3 - elif q == '%C3%A5': - video = 'movie_5' # duration: 5 - elif q == '%3F': - video = 'green-at-15' # duration: 30 + image = u'green-256x256.png' + rv = open(os.path.join(request.doc_root, u"images", image), "rb").read() + return [(b"Content-Type", b"image/png")], rv + elif type == b'video': + ext = request.GET[b'ext'] + if q == u'%E5': + video = u'A4' # duration: 3 + elif q == u'%C3%A5': + video = u'movie_5' # duration: 5 + elif q == u'%3F': + video = u'green-at-15' # duration: 30 else: - video = 'movie_300' # duration: 300 - rv = open(os.path.join(request.doc_root, "media", "%s.%s" % (video, ext)), "rb").read() - if ext == 'ogv': - ext = 'ogg' - return [("Content-Type", "video/%s" % ext)], rv - elif type == 'webvtt': - return [("Content-Type", "text/vtt")], "WEBVTT\n\n00:00:00.000 --> 00:00:01.000\n%s" % q + video = u'movie_300' # duration: 300 + rv = open(os.path.join(request.doc_root, u"media", u"%s.%s" % (video, isomorphic_decode(ext))), "rb").read() + if ext == b'ogv': + ext = b'ogg' + return [(b"Content-Type", b"video/%s" % ext)], rv + elif type == b'webvtt': + return [(b"Content-Type", b"text/vtt")], b"WEBVTT\n\n00:00:00.000 --> 00:00:01.000\n%s" % isomorphic_encode(q) diff --git a/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py b/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py index d6e3dd5ea50..a6b589d2acf 100644 --- a/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py +++ b/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py @@ -1,16 +1,15 @@ -import time import re def main(request, response): - key = request.GET['id'] - action = request.GET['action'] - if action == 'put': + key = request.GET[b'id'] + action = request.GET[b'action'] + if action == b'put': # We want the raw input for 'q' q = re.search(r'q=([^&]+)', request.url_parts.query).groups()[0] request.server.stash.put(key, q) - return [("Content-Type", "text/html")], 'Put %s' % q + return [(b"Content-Type", b"text/html")], u'Put %s' % q else: q = request.server.stash.take(key) if q != None: - return [("Content-Type", "text/html")], q - return [], "" + return [(b"Content-Type", b"text/html")], q + return [], u"" diff --git a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/aqua-yellow-32x32.png b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/aqua-yellow-32x32.png new file mode 100644 index 00000000000..42f8a2100b2 Binary files /dev/null and b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/aqua-yellow-32x32.png differ diff --git a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/blue-16x20-green-16x20.png b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/blue-16x20-green-16x20.png new file mode 100644 index 00000000000..9bf59ebdf1a Binary files /dev/null and b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/blue-16x20-green-16x20.png differ diff --git a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/fuchsia-32x32.png b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/fuchsia-32x32.png new file mode 100644 index 00000000000..7902bc31e09 Binary files /dev/null and b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/fuchsia-32x32.png differ diff --git a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/red-32x32.png b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/red-32x32.png new file mode 100644 index 00000000000..191e13ea11d Binary files /dev/null and b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/red-32x32.png differ diff --git a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/yellow-32x32.png b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/yellow-32x32.png new file mode 100644 index 00000000000..a45f8111b44 Binary files /dev/null and b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/resources/yellow-32x32.png differ diff --git a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/table-background-print-ref.html b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/table-background-print-ref.html new file mode 100644 index 00000000000..3aa0abd3207 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/table-background-print-ref.html @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Foo + + Bar +
+ Foo + + Bar +
+ Foo + + Bar +
+ Baz +
+ + diff --git a/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/table-background-print.html b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/table-background-print.html new file mode 100644 index 00000000000..0cbaca60192 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/rendering/non-replaced-elements/tables/table-background-print.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Foo + + Bar +
+ Foo + + Bar +
+ Foo + + Bar +
+ Baz +
+ + diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/sandbox-toggle-in-inactive-document-crash.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/sandbox-toggle-in-inactive-document-crash.html new file mode 100644 index 00000000000..654542f6a8e --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/sandbox-toggle-in-inactive-document-crash.html @@ -0,0 +1,9 @@ + + + diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/constraints/number-input-lang-validationMessage-crash.html b/tests/wpt/web-platform-tests/html/semantics/forms/constraints/number-input-lang-validationMessage-crash.html new file mode 100644 index 00000000000..7affb1d65bf --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/forms/constraints/number-input-lang-validationMessage-crash.html @@ -0,0 +1,15 @@ + +Should not assert or crash + + +
+
+ diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-action-in-inactive-document-crash.html b/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-action-in-inactive-document-crash.html new file mode 100644 index 00000000000..8a3543fcbcf --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-action-in-inactive-document-crash.html @@ -0,0 +1,6 @@ + + diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-classic.html b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-classic-manual.html similarity index 100% rename from tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-classic.html rename to tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-classic-manual.html diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-module.html b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-module-manual.html similarity index 100% rename from tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-module.html rename to tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-module-manual.html diff --git a/tests/wpt/web-platform-tests/html/tools/build.sh b/tests/wpt/web-platform-tests/html/tools/build.sh index 21403090b8e..a416d05dd4d 100755 --- a/tests/wpt/web-platform-tests/html/tools/build.sh +++ b/tests/wpt/web-platform-tests/html/tools/build.sh @@ -2,7 +2,7 @@ set -ex cd "${0%/*}" -virtualenv -p python .virtualenv +virtualenv -p python2 .virtualenv .virtualenv/bin/pip install genshi git clone https://github.com/html5lib/html5lib-python.git .virtualenv/html5lib && cd .virtualenv/html5lib || cd .virtualenv/html5lib && git pull # Pinned commit, to avoid html5lib from changing underneath us. diff --git a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/http-refresh.py b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/http-refresh.py index d323f967b21..161a34b6b50 100644 --- a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/http-refresh.py +++ b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/http-refresh.py @@ -1,3 +1,5 @@ +from wptserve.utils import isomorphic_encode + def main(request, response): - time = request.url_parts.query if request.url_parts.query else '0' - return 200, [('Refresh', time), ('Content-Type', "text/html")], '' + time = isomorphic_encode(request.url_parts.query) if request.url_parts.query else b'0' + return 200, [(b'Refresh', time), (b'Content-Type', b"text/html")], b'' diff --git a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/meta-refresh.py b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/meta-refresh.py index dd3cef44b44..2dfbab6e760 100644 --- a/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/meta-refresh.py +++ b/tests/wpt/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/meta-refresh.py @@ -1,5 +1,3 @@ -import time - def main(request, response): - time = request.url_parts.query if request.url_parts.query else '0' - return 200, [['Content-Type', 'text/html']], '' % time + time = request.url_parts.query if request.url_parts.query else u'0' + return 200, [[b'Content-Type', b'text/html']], u'' % time diff --git a/tests/wpt/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/support/promise-access-control.py b/tests/wpt/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/support/promise-access-control.py index be74a36034e..cf8ed5e4924 100644 --- a/tests/wpt/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/support/promise-access-control.py +++ b/tests/wpt/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/support/promise-access-control.py @@ -1,11 +1,11 @@ def main(request, response): - allow = request.GET.first("allow", "false") + allow = request.GET.first(b"allow", b"false") - headers = [("Content-Type", "application/javascript")] - if allow != "false": - headers.append(("Access-Control-Allow-Origin", "*")) + headers = [(b"Content-Type", b"application/javascript")] + if allow != b"false": + headers.append((b"Access-Control-Allow-Origin", b"*")) - body = """ + body = b""" function handleRejectedPromise(promise) { promise.catch(() => {}); } diff --git a/tests/wpt/web-platform-tests/images/blue-png-cachable.py b/tests/wpt/web-platform-tests/images/blue-png-cachable.py index e87975343f6..6d8556542ab 100644 --- a/tests/wpt/web-platform-tests/images/blue-png-cachable.py +++ b/tests/wpt/web-platform-tests/images/blue-png-cachable.py @@ -1,5 +1,5 @@ import os -import time +from wptserve.utils import isomorphic_decode def main(request, response): """Serves the contents in blue.png but with a Cache-Control header. @@ -7,7 +7,7 @@ def main(request, response): Emits a Cache-Control header with max-age set to 1h to allow the browser cache the image. Used for testing behaviors involving caching logics. """ - image_path = os.path.join(os.path.dirname(__file__), "blue.png") - response.headers.set("Cache-Control", "max-age=3600") - response.headers.set("Content-Type", "image/png") + image_path = os.path.join(os.path.dirname(isomorphic_decode(__file__)), u"blue.png") + response.headers.set(b"Cache-Control", b"max-age=3600") + response.headers.set(b"Content-Type", b"image/png") response.content = open(image_path, mode='rb').read() diff --git a/tests/wpt/web-platform-tests/infrastructure/testdriver/file_upload.py b/tests/wpt/web-platform-tests/infrastructure/testdriver/file_upload.py index 89ed67a79ef..9c4dd754384 100644 --- a/tests/wpt/web-platform-tests/infrastructure/testdriver/file_upload.py +++ b/tests/wpt/web-platform-tests/infrastructure/testdriver/file_upload.py @@ -1,2 +1,2 @@ def main(request, response): - return "PASS" if request.POST[b"file_input"].file.read() == b"File to upload\n" else "FAIL" + return b"PASS" if request.POST[b"file_input"].file.read() == b"File to upload\n" else b"FAIL" diff --git a/tests/wpt/web-platform-tests/interfaces/ambient-light.idl b/tests/wpt/web-platform-tests/interfaces/ambient-light.idl index ce335161a25..06d6eec690b 100644 --- a/tests/wpt/web-platform-tests/interfaces/ambient-light.idl +++ b/tests/wpt/web-platform-tests/interfaces/ambient-light.idl @@ -3,8 +3,9 @@ // (https://github.com/tidoust/reffy-reports) // Source: Ambient Light Sensor (https://w3c.github.io/ambient-light/) -[Constructor(optional SensorOptions sensorOptions = {}), SecureContext, Exposed=Window] +[SecureContext, Exposed=Window] interface AmbientLightSensor : Sensor { + constructor(optional SensorOptions sensorOptions = {}); readonly attribute double? illuminance; }; diff --git a/tests/wpt/web-platform-tests/interfaces/intervention-reporting.idl b/tests/wpt/web-platform-tests/interfaces/intervention-reporting.idl new file mode 100644 index 00000000000..95905fe3b58 --- /dev/null +++ b/tests/wpt/web-platform-tests/interfaces/intervention-reporting.idl @@ -0,0 +1,14 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into reffy-reports +// (https://github.com/tidoust/reffy-reports) +// Source: Intervention Reporting (https://wicg.github.io/intervention-reporting/) + +[Exposed=(Window,Worker)] +interface InterventionReportBody : ReportBody { + [Default] object toJSON(); + readonly attribute DOMString id; + readonly attribute DOMString message; + readonly attribute DOMString? sourceFile; + readonly attribute unsigned long? lineNumber; + readonly attribute unsigned long? columnNumber; +}; diff --git a/tests/wpt/web-platform-tests/interfaces/native-file-system.idl b/tests/wpt/web-platform-tests/interfaces/native-file-system.idl index 92d05fe4659..1fd2cb8b3a1 100644 --- a/tests/wpt/web-platform-tests/interfaces/native-file-system.idl +++ b/tests/wpt/web-platform-tests/interfaces/native-file-system.idl @@ -7,10 +7,14 @@ dictionary FileSystemHandlePermissionDescriptor { boolean writable = false; }; +enum FileSystemHandleKind { + "file", + "directory", +}; + [Exposed=(Window,Worker), SecureContext, Serializable] interface FileSystemHandle { - readonly attribute boolean isFile; - readonly attribute boolean isDirectory; + readonly attribute FileSystemHandleKind kind; readonly attribute USVString name; Promise isSameEntry(FileSystemHandle other); @@ -45,8 +49,8 @@ dictionary FileSystemRemoveOptions { interface FileSystemDirectoryHandle : FileSystemHandle { async iterable; - Promise getFile(USVString name, optional FileSystemGetFileOptions options = {}); - Promise getDirectory(USVString name, optional FileSystemGetDirectoryOptions options = {}); + Promise getFileHandle(USVString name, optional FileSystemGetFileOptions options = {}); + Promise getDirectoryHandle(USVString name, optional FileSystemGetDirectoryOptions options = {}); Promise removeEntry(USVString name, optional FileSystemRemoveOptions options = {}); diff --git a/tests/wpt/web-platform-tests/interfaces/payment-handler.idl b/tests/wpt/web-platform-tests/interfaces/payment-handler.idl index 824210a5c18..66732945ca6 100644 --- a/tests/wpt/web-platform-tests/interfaces/payment-handler.idl +++ b/tests/wpt/web-platform-tests/interfaces/payment-handler.idl @@ -11,7 +11,7 @@ partial interface ServiceWorkerRegistration { interface PaymentManager { [SameObject] readonly attribute PaymentInstruments instruments; attribute DOMString userHint; - Promise enableDelegations(FrozenArray delegations); + Promise enableDelegations(sequence delegations); }; enum PaymentDelegation { @@ -70,8 +70,8 @@ partial interface ServiceWorkerGlobalScope { dictionary PaymentRequestDetailsUpdate { DOMString error; PaymentCurrencyAmount total; - FrozenArray modifiers; - FrozenArray shippingOptions; + sequence modifiers; + sequence shippingOptions; object paymentMethodErrors; AddressErrors shippingAddressErrors; }; diff --git a/tests/wpt/web-platform-tests/interfaces/webauthn.idl b/tests/wpt/web-platform-tests/interfaces/webauthn.idl index 9de7f64919d..607c4765485 100644 --- a/tests/wpt/web-platform-tests/interfaces/webauthn.idl +++ b/tests/wpt/web-platform-tests/interfaces/webauthn.idl @@ -167,6 +167,10 @@ partial dictionary AuthenticationExtensionsClientInputs { USVString appidExclude; }; +partial dictionary AuthenticationExtensionsClientOutputs { + boolean appidExclude; +}; + partial dictionary AuthenticationExtensionsClientInputs { boolean uvm; }; diff --git a/tests/wpt/web-platform-tests/intervention-reporting/idlharness.any.js b/tests/wpt/web-platform-tests/intervention-reporting/idlharness.any.js new file mode 100644 index 00000000000..c7a4d6095f8 --- /dev/null +++ b/tests/wpt/web-platform-tests/intervention-reporting/idlharness.any.js @@ -0,0 +1,14 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +'use strict'; + +idl_test( + ['intervention-reporting'], + ['reporting'], + idl_array => { + idl_array.add_objects({ + // TODO: objects + }); + } +); diff --git a/tests/wpt/web-platform-tests/layout-instability/resources/slow-image.py b/tests/wpt/web-platform-tests/layout-instability/resources/slow-image.py index ee7988c551f..d9f09b8bca7 100644 --- a/tests/wpt/web-platform-tests/layout-instability/resources/slow-image.py +++ b/tests/wpt/web-platform-tests/layout-instability/resources/slow-image.py @@ -3,4 +3,4 @@ import time def main(request, response): # Sleep for 3s to delay onload. time.sleep(3) - return [], "" \ No newline at end of file + return [], b"" diff --git a/tests/wpt/web-platform-tests/lint.ignore b/tests/wpt/web-platform-tests/lint.ignore index 8d0ac45b8c8..23cf8609bf2 100644 --- a/tests/wpt/web-platform-tests/lint.ignore +++ b/tests/wpt/web-platform-tests/lint.ignore @@ -688,6 +688,7 @@ MISSING-LINK: css/filter-effects/*.any.js # Tests that use WebKit/Blink testing APIs LAYOUTTESTS APIS: import-maps/common/resources/common-test-helper.js +LAYOUTTESTS APIS: resources/test-only-api.js LAYOUTTESTS APIS: resources/chromium/enable-hyperlink-auditing.js LAYOUTTESTS APIS: resources/chromium/generic_sensor_mocks.js LAYOUTTESTS APIS: resources/chromium/nfc-mock.js @@ -709,6 +710,7 @@ WEB-PLATFORM.TEST:web-bundle/resources/wbn/*.wbn # Tests that depend on resources in /gen/ in Chromium: # https://github.com/web-platform-tests/wpt/issues/16455 # Please consult with ecosystem-infra@chromium.org before adding more. +MISSING DEPENDENCY: resources/test-only-api.js MISSING DEPENDENCY: idle-detection/interceptor.https.html MISSING DEPENDENCY: credential-management/support/otpcredential-helper.js MISSING DEPENDENCY: web-nfc/resources/nfc-helpers.js diff --git a/tests/wpt/web-platform-tests/longtask-timing/containerNames.html b/tests/wpt/web-platform-tests/longtask-timing/containerNames.html new file mode 100644 index 00000000000..cfde4a30433 --- /dev/null +++ b/tests/wpt/web-platform-tests/longtask-timing/containerNames.html @@ -0,0 +1,54 @@ + + +LongTask Timing: long tasks in long-name iframe containers + + + +

Longtasks in iframe

+
+ + diff --git a/tests/wpt/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https.html b/tests/wpt/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https.html index 1bc1f9b5740..d94b43c9cf9 100644 --- a/tests/wpt/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https.html +++ b/tests/wpt/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https.html @@ -197,4 +197,23 @@ "resizeMode should exist and it should be a string."); assert_in_array(settings.resizeMode, ['none', 'crop-and-scale']); }, 'resizeMode is reported by getSettings() for getUserMedia() video tracks'); + + promise_test(async t => { + const stream = await navigator.mediaDevices.getUserMedia({ audio: true, video : true}); + const audioTrack = stream.getAudioTracks()[0]; + const videoTrack = stream.getVideoTracks()[0]; + + const audioDeviceId = audioTrack.getSettings().deviceId; + const videoDeviceId = videoTrack.getSettings().deviceId; + const audioGroupId = audioTrack.getSettings().groupId; + const videoGroupId = videoTrack.getSettings().groupId; + + audioTrack.stop(); + videoTrack.stop(); + + assert_equals(audioTrack.getSettings().deviceId, audioDeviceId, "audio track deviceId"); + assert_equals(videoTrack.getSettings().deviceId, videoDeviceId, "video track deviceId"); + assert_equals(audioTrack.getSettings().groupId, audioGroupId, "audio track groupId"); + assert_equals(videoTrack.getSettings().groupId, videoGroupId, "video track groupId"); + }, 'Stopped tracks should expose deviceId/groupId'); diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-IndexedDB-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-IndexedDB-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-IndexedDB-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-IndexedDB-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-isSameEntry-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-isSameEntry-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-isSameEntry-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-isSameEntry-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-BroadcastChannel-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-BroadcastChannel-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-BroadcastChannel-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-BroadcastChannel-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-Error-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-Error-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-Error-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-Error-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-frames-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-frames-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-frames-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-frames-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-windows-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-windows-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-windows-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-windows-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-workers-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-workers-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-workers-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort-workers-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-frames-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-frames-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-frames-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-frames-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-windows-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-windows-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-windows-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-windows-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-workers-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-workers-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-workers-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemBaseHandle-postMessage-workers-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getDirectory-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getDirectoryHandle-manual.https.html similarity index 95% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getDirectory-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getDirectoryHandle-manual.https.html index afd95af99d3..03672321e2d 100644 --- a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getDirectory-manual.https.tentative.html +++ b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getDirectoryHandle-manual.https.html @@ -7,4 +7,4 @@ - + diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getEntries-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getEntries-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getEntries-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getEntries-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getFile-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getFileHandle-manual.https.html similarity index 81% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getFile-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getFileHandle-manual.https.html index 085d4371c48..94b31226f8d 100644 --- a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getFile-manual.https.tentative.html +++ b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-getFileHandle-manual.https.html @@ -7,4 +7,4 @@ - + diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-removeEntry-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-removeEntry-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-removeEntry-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-removeEntry-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-resolve-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-resolve-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-resolve-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemDirectoryHandle-resolve-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemFileHandle-getFile-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemFileHandle-getFile-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemFileHandle-getFile-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemFileHandle-getFile-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-piped-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-piped-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-piped-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-piped-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-write-manual.https.tentative.html b/tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-write-manual.https.html similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-write-manual.https.tentative.html rename to tests/wpt/web-platform-tests/native-file-system/native_FileSystemWritableFileStream-write-manual.https.html diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/message-target.js b/tests/wpt/web-platform-tests/native-file-system/resources/message-target.js index 423bcf42e16..ab8012dfca5 100644 --- a/tests/wpt/web-platform-tests/native-file-system/resources/message-target.js +++ b/tests/wpt/web-platform-tests/native-file-system/resources/message-target.js @@ -87,7 +87,7 @@ function add_message_event_handlers(receiver, target, target_origin) { const directory = await self.getOriginPrivateDirectory(); const file_handle = - await directory.getFile('temp-file', { create: true }); + await directory.getFileHandle('temp-file', { create: true }); message_source.postMessage( { type: 'receive-file', file_handle }, { targetOrigin: target_origin }); @@ -98,7 +98,7 @@ function add_message_event_handlers(receiver, target, target_origin) { const parent_directory = await self.getOriginPrivateDirectory(); const directory_handle = - await parent_directory.getDirectory('temp-directory', + await parent_directory.getDirectoryHandle('temp-directory', { create: true }); message_source.postMessage( { type: 'receive-directory', directory_handle }, @@ -140,4 +140,4 @@ function add_message_event_handlers(receiver, target, target_origin) { { targetOrigin: target_origin }); } }); -} \ No newline at end of file +} diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/messaging-serialize-helpers.js b/tests/wpt/web-platform-tests/native-file-system/resources/messaging-serialize-helpers.js index ff7e59cf45a..b4d41aa91c0 100644 --- a/tests/wpt/web-platform-tests/native-file-system/resources/messaging-serialize-helpers.js +++ b/tests/wpt/web-platform-tests/native-file-system/resources/messaging-serialize-helpers.js @@ -15,16 +15,15 @@ async function serialize_handles(handle_array) { // Serializes either a FileSystemFileHandle or FileSystemDirectoryHandle. async function serialize_handle(handle) { - let serialized; - if (handle.isDirectory) { - serialized = await serialize_file_system_directory_handle(handle); - } else if (handle.isFile) { - serialized = await serialize_file_system_file_handle(handle); - } else { - throw 'Object is not a FileSystemFileHandle or ' + - `FileSystemDirectoryHandle ${handle}`; + switch (handle.kind) { + case 'directory': + return await serialize_file_system_directory_handle(handle); + case 'file': + return await serialize_file_system_file_handle(handle); + default: + throw 'Object is not a FileSystemFileHandle or ' + + `FileSystemDirectoryHandle ${handle}`; } - return serialized; } // Creates a dictionary for a FileSystemHandle base, which contains @@ -38,8 +37,7 @@ async function serialize_file_system_handle(handle) { await handle.queryPermission({ writable: true }) return { - is_file: handle.isFile, - is_directory: handle.isDirectory, + kind: handle.kind, name: handle.name, read_permission, write_permission @@ -50,8 +48,7 @@ async function serialize_file_system_handle(handle) { // Also, reads the contents of the file to include with the returned // dictionary. Example output: // { -// is_file: true, -// is_directory: false, +// kind: "file", // name: "example-file-name" // read_permission: "granted", // write_permission: "granted", @@ -69,8 +66,7 @@ async function serialize_file_system_file_handle(file_handle) { // Create a dictionary with each property value in FileSystemDirectoryHandle. // Example output: // { -// is_file: false, -// is_directory: true, +// kind: "directory", // name: "example-directory-name" // read_permission: "granted", // write_permission: "granted", @@ -83,7 +79,7 @@ async function serialize_file_system_directory_handle(directory_handle) { const serialized_directories = []; for await (const child_handle of directory_handle.getEntries()) { const serialized_child_handle = await serialize_handle(child_handle); - if (child_handle.isDirectory) { + if (child_handle.kind === "directory") { serialized_directories.push(serialized_child_handle); } else { serialized_files.push(serialized_child_handle); @@ -138,24 +134,24 @@ function assert_equals_serialized_handles(left_array, right_array) { // Verifies each property of a serialized FileSystemFileHandle or // FileSystemDirectoryHandle. function assert_equals_serialized_handle(left, right) { - if (left.is_directory) { - assert_equals_serialized_file_system_directory_handle(left, right); - } else if (left.is_file) { - assert_equals_serialized_file_system_file_handle(left, right); - } else { - throw 'Object is not a FileSystemFileHandle or ' + - `FileSystemDirectoryHandle ${left}`; + switch (left.kind) { + case 'directory': + assert_equals_serialized_file_system_directory_handle(left, right); + break; + case 'file': + assert_equals_serialized_file_system_file_handle(left, right); + break; + default: + throw 'Object is not a FileSystemFileHandle or ' + + `FileSystemDirectoryHandle ${left}`; } } // Compares the output of serialize_file_system_handle() for // two FileSystemHandles. function assert_equals_serialized_file_system_handle(left, right) { - assert_equals(left.is_file, right.is_file, - 'Each FileSystemHandle instance must use the expected "isFile".'); - - assert_equals(left.is_directory, right.is_directory, - 'Each FileSystemHandle instance must use the expected "isDirectory".'); + assert_equals(left.kind, right.kind, + 'Each FileSystemHandle instance must use the expected "kind".'); assert_equals(left.name, right.name, 'Each FileSystemHandle instance must use the expected "name" ' + diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/native-fs-test-helpers.js b/tests/wpt/web-platform-tests/native-file-system/resources/native-fs-test-helpers.js index cf9f39a9a87..231bc067532 100644 --- a/tests/wpt/web-platform-tests/native-file-system/resources/native-fs-test-helpers.js +++ b/tests/wpt/web-platform-tests/native-file-system/resources/native-fs-test-helpers.js @@ -33,7 +33,8 @@ function directory_test(func, description) { // To be resilient against tests not cleaning up properly, cleanup before // every test. for await (let entry of directory.getEntries()) { - await directory.removeEntry(entry.name, {recursive: entry.isDirectory}); + await directory.removeEntry( + entry.name, {recursive: entry.kind === 'directory'}); } await func(t, directory); }, description); diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/sandboxed-fs-test-helpers.js b/tests/wpt/web-platform-tests/native-file-system/resources/sandboxed-fs-test-helpers.js index 3ec31436a03..1b27445e951 100644 --- a/tests/wpt/web-platform-tests/native-file-system/resources/sandboxed-fs-test-helpers.js +++ b/tests/wpt/web-platform-tests/native-file-system/resources/sandboxed-fs-test-helpers.js @@ -10,7 +10,7 @@ async function cleanupSandboxedFileSystem() { const dir = await self.getOriginPrivateDirectory(); for await (let entry of dir.getEntries()) - await dir.removeEntry(entry.name, {recursive: entry.isDirectory}); + await dir.removeEntry(entry.name, {recursive: entry.kind === 'directory'}); } function directory_test(func, description) { diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js b/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js index eb123bf6da6..0d8bdfde8d7 100644 --- a/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js +++ b/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js @@ -34,7 +34,7 @@ async function getDirectoryEntryCount(handle) { async function getSortedDirectoryEntries(handle) { let result = []; for await (let entry of handle.getEntries()) { - if (entry.isDirectory) + if (entry.kind === 'directory') result.push(entry.name + '/'); else result.push(entry.name); @@ -44,7 +44,7 @@ async function getSortedDirectoryEntries(handle) { } async function createDirectory(test, name, parent) { - const new_dir_handle = await parent.getDirectory(name, {create: true}); + const new_dir_handle = await parent.getDirectoryHandle(name, {create: true}); test.add_cleanup(async () => { try { await parent.removeEntry(name, {recursive: true}); @@ -57,7 +57,7 @@ async function createDirectory(test, name, parent) { } async function createEmptyFile(test, name, parent) { - const handle = await parent.getFile(name, {create: true}); + const handle = await parent.getFileHandle(name, {create: true}); test.add_cleanup(async () => { try { await parent.removeEntry(name); diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-IndexedDB.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-IndexedDB.https.any.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-IndexedDB.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-IndexedDB.https.any.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-isSameEntry.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-isSameEntry.https.any.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-isSameEntry.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-isSameEntry.https.any.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-BroadcastChannel.tentative.https.window.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-BroadcastChannel.https.window.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-BroadcastChannel.tentative.https.window.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-BroadcastChannel.https.window.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-Error.tentative.https.window.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-Error.https.window.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-Error.tentative.https.window.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-Error.https.window.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-frames.tentative.https.window.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-frames.https.window.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-frames.tentative.https.window.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-frames.https.window.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-windows.tentative.https.window.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-windows.https.window.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-windows.tentative.https.window.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-windows.https.window.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-workers.tentative.https.window.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-workers.https.window.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-workers.tentative.https.window.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort-workers.https.window.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-frames.tentative.https.window.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-frames.https.window.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-frames.tentative.https.window.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-frames.https.window.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-windows.tentative.https.window.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-windows.https.window.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-windows.tentative.https.window.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-windows.https.window.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-workers.tentative.https.window.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-workers.https.window.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-workers.tentative.https.window.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemBaseHandle-postMessage-workers.https.window.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getDirectory.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.js similarity index 92% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getDirectory.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.js index 6fcf566e31f..69ca2bf3677 100644 --- a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getDirectory.tentative.https.any.js +++ b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.js @@ -1,3 +1,3 @@ // META: script=resources/test-helpers.js // META: script=resources/sandboxed-fs-test-helpers.js -// META: script=script-tests/FileSystemDirectoryHandle-getDirectory.js +// META: script=script-tests/FileSystemDirectoryHandle-getDirectoryHandle.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getEntries.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getEntries.https.any.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getEntries.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getEntries.https.any.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getFile.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.js similarity index 57% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getFile.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.js index 65ae891cd44..afe362e757c 100644 --- a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getFile.tentative.https.any.js +++ b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.js @@ -1,3 +1,3 @@ // META: script=resources/test-helpers.js // META: script=resources/sandboxed-fs-test-helpers.js -// META: script=script-tests/FileSystemDirectoryHandle-getFile.js +// META: script=script-tests/FileSystemDirectoryHandle-getFileHandle.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-removeEntry.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-removeEntry.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-resolve.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-resolve.https.any.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-resolve.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemDirectoryHandle-resolve.https.any.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemFileHandle-getFile.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemFileHandle-getFile.https.any.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemFileHandle-getFile.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemFileHandle-getFile.https.any.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream-piped.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream-piped.https.any.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream-piped.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream-piped.https.any.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream-write.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream-write.https.any.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream-write.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream-write.https.any.js diff --git a/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream.tentative.https.any.js b/tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream.https.any.js similarity index 100% rename from tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream.tentative.https.any.js rename to tests/wpt/web-platform-tests/native-file-system/sandboxed_FileSystemWritableFileStream.https.any.js diff --git a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemBaseHandle-isSameEntry.js b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemBaseHandle-isSameEntry.js index e8a8725b95e..8c0b3521c3f 100644 --- a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemBaseHandle-isSameEntry.js +++ b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemBaseHandle-isSameEntry.js @@ -16,7 +16,7 @@ directory_test(async (t, root_dir) => { directory_test(async (t, root_dir) => { const subdir = await createDirectory(t, 'subdir-name', root_dir); - const subdir2 = await root_dir.getDirectory('subdir-name'); + const subdir2 = await root_dir.getDirectoryHandle('subdir-name'); assert_true(await subdir.isSameEntry(subdir2)); assert_true(await subdir2.isSameEntry(subdir)); @@ -38,7 +38,7 @@ directory_test(async (t, root_dir) => { directory_test(async (t, root_dir) => { const handle1 = await createEmptyFile(t, 'mtime.txt', root_dir); - const handle2 = await root_dir.getFile('mtime.txt'); + const handle2 = await root_dir.getFileHandle('mtime.txt'); assert_true(await handle1.isSameEntry(handle2)); assert_true(await handle2.isSameEntry(handle1)); diff --git a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getDirectory.js b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getDirectoryHandle.js similarity index 50% rename from tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getDirectory.js rename to tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getDirectoryHandle.js index cd910fd361f..48a4ce4ce69 100644 --- a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getDirectory.js +++ b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getDirectoryHandle.js @@ -1,82 +1,85 @@ directory_test(async (t, root) => { await promise_rejects_dom( - t, 'NotFoundError', root.getDirectory('non-existing-dir')); -}, 'getDirectory(create=false) rejects for non-existing directories'); + t, 'NotFoundError', root.getDirectoryHandle('non-existing-dir')); +}, 'getDirectoryHandle(create=false) rejects for non-existing directories'); directory_test(async (t, root) => { - const handle = await root.getDirectory('non-existing-dir', {create: true}); + const handle = + await root.getDirectoryHandle('non-existing-dir', {create: true}); t.add_cleanup(() => root.removeEntry('non-existing-dir', {recursive: true})); - assert_false(handle.isFile); - assert_true(handle.isDirectory); + assert_equals(handle.kind, 'directory'); assert_equals(handle.name, 'non-existing-dir'); assert_equals(await getDirectoryEntryCount(handle), 0); assert_array_equals( await getSortedDirectoryEntries(root), ['non-existing-dir/']); -}, 'getDirectory(create=true) creates an empty directory'); +}, 'getDirectoryHandle(create=true) creates an empty directory'); directory_test(async (t, root) => { const existing_handle = - await root.getDirectory('dir-with-contents', {create: true}); + await root.getDirectoryHandle('dir-with-contents', {create: true}); t.add_cleanup(() => root.removeEntry('dir-with-contents', {recursive: true})); const file_handle = await createEmptyFile(t, 'test-file', existing_handle); - const handle = await root.getDirectory('dir-with-contents', {create: false}); + const handle = + await root.getDirectoryHandle('dir-with-contents', {create: false}); - assert_false(handle.isFile); - assert_true(handle.isDirectory); + assert_equals(handle.kind, 'directory'); assert_equals(handle.name, 'dir-with-contents'); assert_array_equals(await getSortedDirectoryEntries(handle), ['test-file']); -}, 'getDirectory(create=false) returns existing directories'); +}, 'getDirectoryHandle(create=false) returns existing directories'); directory_test(async (t, root) => { const existing_handle = - await root.getDirectory('dir-with-contents', {create: true}); + await root.getDirectoryHandle('dir-with-contents', {create: true}); t.add_cleanup(() => root.removeEntry('dir-with-contents', {recursive: true})); const file_handle = - await existing_handle.getFile('test-file', {create: true}); + await existing_handle.getFileHandle('test-file', {create: true}); - const handle = await root.getDirectory('dir-with-contents', {create: true}); + const handle = + await root.getDirectoryHandle('dir-with-contents', {create: true}); - assert_false(handle.isFile); - assert_true(handle.isDirectory); + assert_equals(handle.kind, 'directory'); assert_equals(handle.name, 'dir-with-contents'); assert_array_equals(await getSortedDirectoryEntries(handle), ['test-file']); -}, 'getDirectory(create=true) returns existing directories without erasing'); +}, 'getDirectoryHandle(create=true) returns existing directories without erasing'); directory_test(async (t, root) => { await createEmptyFile(t, 'file-name', root); - await promise_rejects_dom(t, 'TypeMismatchError', root.getDirectory('file-name')); await promise_rejects_dom( - t, 'TypeMismatchError', root.getDirectory('file-name', {create: false})); + t, 'TypeMismatchError', root.getDirectoryHandle('file-name')); await promise_rejects_dom( - t, 'TypeMismatchError', root.getDirectory('file-name', {create: true})); -}, 'getDirectory() when a file already exists with the same name'); + t, 'TypeMismatchError', + root.getDirectoryHandle('file-name', {create: false})); + await promise_rejects_dom( + t, 'TypeMismatchError', + root.getDirectoryHandle('file-name', {create: true})); +}, 'getDirectoryHandle() when a file already exists with the same name'); directory_test(async (t, dir) => { await promise_rejects_js( - t, TypeError, dir.getDirectory('', {create: true})); + t, TypeError, dir.getDirectoryHandle('', {create: true})); await promise_rejects_js( - t, TypeError, dir.getDirectory('', {create: false})); -}, 'getDirectory() with empty name'); + t, TypeError, dir.getDirectoryHandle('', {create: false})); +}, 'getDirectoryHandle() with empty name'); directory_test(async (t, dir) => { await promise_rejects_js( - t, TypeError, dir.getDirectory(kCurrentDirectory)); + t, TypeError, dir.getDirectoryHandle(kCurrentDirectory)); await promise_rejects_js( - t, TypeError, dir.getDirectory(kCurrentDirectory, {create: true})); -}, `getDirectory() with "${kCurrentDirectory}" name`); + t, TypeError, dir.getDirectoryHandle(kCurrentDirectory, {create: true})); +}, `getDirectoryHandle() with "${kCurrentDirectory}" name`); directory_test(async (t, dir) => { const subdir = await createDirectory(t, 'subdir-name', /*parent=*/ dir); await promise_rejects_js( - t, TypeError, subdir.getDirectory(kParentDirectory)); + t, TypeError, subdir.getDirectoryHandle(kParentDirectory)); await promise_rejects_js( t, TypeError, - subdir.getDirectory(kParentDirectory, {create: true})); -}, `getDirectory() with "${kParentDirectory}" name`); + subdir.getDirectoryHandle(kParentDirectory, {create: true})); +}, `getDirectoryHandle() with "${kParentDirectory}" name`); directory_test(async (t, dir) => { const first_subdir_name = 'first-subdir-name'; @@ -91,10 +94,11 @@ directory_test(async (t, dir) => { const path_with_separator = `${first_subdir_name}${kPathSeparators[i]}${second_subdir_name}`; await promise_rejects_js( - t, TypeError, dir.getDirectory(path_with_separator), - `getDirectory() must reject names containing "${kPathSeparators[i]}"`); + t, TypeError, dir.getDirectoryHandle(path_with_separator), + `getDirectoryHandle() must reject names containing "${ + kPathSeparators[i]}"`); } -}, 'getDirectory(create=false) with a path separator when the directory exists'); +}, 'getDirectoryHandle(create=false) with a path separator when the directory exists'); directory_test(async (t, dir) => { const subdir_name = 'subdir-name'; @@ -104,8 +108,8 @@ directory_test(async (t, dir) => { const path_with_separator = `${subdir_name}${kPathSeparators[i]}file_name`; await promise_rejects_js( t, TypeError, - dir.getDirectory(path_with_separator, {create: true}), - `getDirectory(true) must reject names containing "${ + dir.getDirectoryHandle(path_with_separator, {create: true}), + `getDirectoryHandle(true) must reject names containing "${ kPathSeparators[i]}"`); } -}, 'getDirectory(create=true) with a path separator'); +}, 'getDirectoryHandle(create=true) with a path separator'); diff --git a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getFile.js b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getFile.js deleted file mode 100644 index 383f19a4b2b..00000000000 --- a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getFile.js +++ /dev/null @@ -1,100 +0,0 @@ -directory_test(async (t, dir) => { - await promise_rejects_dom(t, 'NotFoundError', dir.getFile('non-existing-file')); -}, 'getFile(create=false) rejects for non-existing files'); - -directory_test(async (t, dir) => { - const handle = await dir.getFile('non-existing-file', {create: true}); - t.add_cleanup(() => dir.removeEntry('non-existing-file')); - - assert_true(handle.isFile); - assert_false(handle.isDirectory); - assert_equals(handle.name, 'non-existing-file'); - assert_equals(await getFileSize(handle), 0); - assert_equals(await getFileContents(handle), ''); -}, 'getFile(create=true) creates an empty file for non-existing files'); - -directory_test(async (t, dir) => { - const existing_handle = await createFileWithContents( - t, 'existing-file', '1234567890', /*parent=*/ dir); - const handle = await dir.getFile('existing-file'); - - assert_true(handle.isFile); - assert_false(handle.isDirectory); - assert_equals(handle.name, 'existing-file'); - assert_equals(await getFileSize(handle), 10); - assert_equals(await getFileContents(handle), '1234567890'); -}, 'getFile(create=false) returns existing files'); - -directory_test(async (t, dir) => { - const existing_handle = await createFileWithContents( - t, 'file-with-contents', '1234567890', /*parent=*/ dir); - const handle = await dir.getFile('file-with-contents', {create: true}); - - assert_true(handle.isFile); - assert_false(handle.isDirectory); - assert_equals(handle.name, 'file-with-contents'); - assert_equals(await getFileSize(handle), 10); - assert_equals(await getFileContents(handle), '1234567890'); -}, 'getFile(create=true) returns existing files without erasing'); - -directory_test(async (t, dir) => { - const dir_handle = await dir.getDirectory('dir-name', {create: true}); - t.add_cleanup(() => dir.removeEntry('dir-name', {recursive: true})); - - await promise_rejects_dom(t, 'TypeMismatchError', dir.getFile('dir-name')); -}, 'getFile(create=false) when a directory already exists with the same name'); - -directory_test(async (t, dir) => { - const dir_handle = await dir.getDirectory('dir-name', {create: true}); - t.add_cleanup(() => dir.removeEntry('dir-name', {recursive: true})); - - await promise_rejects_dom( - t, 'TypeMismatchError', dir.getFile('dir-name', {create: true})); -}, 'getFile(create=true) when a directory already exists with the same name'); - -directory_test(async (t, dir) => { - await promise_rejects_js(t, TypeError, dir.getFile('', {create: true})); - await promise_rejects_js(t, TypeError, dir.getFile('', {create: false})); -}, 'getFile() with empty name'); - -directory_test(async (t, dir) => { - await promise_rejects_js(t, TypeError, dir.getFile(kCurrentDirectory)); - await promise_rejects_js( - t, TypeError, dir.getFile(kCurrentDirectory, {create: true})); -}, `getFile() with "${kCurrentDirectory}" name`); - -directory_test(async (t, dir) => { - const subdir = await createDirectory(t, 'subdir-name', /*parent=*/ dir); - - await promise_rejects_js(t, TypeError, subdir.getFile(kParentDirectory)); - await promise_rejects_js( - t, TypeError, subdir.getFile(kParentDirectory, {create: true})); -}, `getFile() with "${kParentDirectory}" name`); - -directory_test(async (t, dir) => { - const subdir_name = 'subdir-name'; - const subdir = await createDirectory(t, subdir_name, /*parent=*/ dir); - - const file_name = 'file-name'; - await createEmptyFile(t, file_name, /*parent=*/ subdir); - - for (let i = 0; i < kPathSeparators.length; ++i) { - const path_with_separator = - `${subdir_name}${kPathSeparators[i]}${file_name}`; - await promise_rejects_js( - t, TypeError, dir.getFile(path_with_separator), - `getFile() must reject names containing "${kPathSeparators[i]}"`); - } -}, 'getFile(create=false) with a path separator when the file exists.'); - -directory_test(async (t, dir) => { - const subdir_name = 'subdir-name'; - const subdir = await createDirectory(t, subdir_name, /*parent=*/ dir); - - for (let i = 0; i < kPathSeparators.length; ++i) { - const path_with_separator = `${subdir_name}${kPathSeparators[i]}file_name`; - await promise_rejects_js( - t, TypeError, dir.getFile(path_with_separator, {create: true}), - `getFile(true) must reject names containing "${kPathSeparators[i]}"`); - } -}, 'getFile(create=true) with a path separator'); diff --git a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getFileHandle.js b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getFileHandle.js new file mode 100644 index 00000000000..dddd67a7058 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-getFileHandle.js @@ -0,0 +1,102 @@ +directory_test(async (t, dir) => { + await promise_rejects_dom( + t, 'NotFoundError', dir.getFileHandle('non-existing-file')); +}, 'getFileHandle(create=false) rejects for non-existing files'); + +directory_test(async (t, dir) => { + const handle = await dir.getFileHandle('non-existing-file', {create: true}); + t.add_cleanup(() => dir.removeEntry('non-existing-file')); + + assert_equals(handle.kind, 'file'); + assert_equals(handle.name, 'non-existing-file'); + assert_equals(await getFileSize(handle), 0); + assert_equals(await getFileContents(handle), ''); +}, 'getFileHandle(create=true) creates an empty file for non-existing files'); + +directory_test(async (t, dir) => { + const existing_handle = await createFileWithContents( + t, 'existing-file', '1234567890', /*parent=*/ dir); + const handle = await dir.getFileHandle('existing-file'); + + assert_equals(handle.kind, 'file'); + assert_equals(handle.name, 'existing-file'); + assert_equals(await getFileSize(handle), 10); + assert_equals(await getFileContents(handle), '1234567890'); +}, 'getFileHandle(create=false) returns existing files'); + +directory_test(async (t, dir) => { + const existing_handle = await createFileWithContents( + t, 'file-with-contents', '1234567890', /*parent=*/ dir); + const handle = await dir.getFileHandle('file-with-contents', {create: true}); + + assert_equals(handle.kind, 'file'); + assert_equals(handle.name, 'file-with-contents'); + assert_equals(await getFileSize(handle), 10); + assert_equals(await getFileContents(handle), '1234567890'); +}, 'getFileHandle(create=true) returns existing files without erasing'); + +directory_test(async (t, dir) => { + const dir_handle = await dir.getDirectoryHandle('dir-name', {create: true}); + t.add_cleanup(() => dir.removeEntry('dir-name', {recursive: true})); + + await promise_rejects_dom( + t, 'TypeMismatchError', dir.getFileHandle('dir-name')); +}, 'getFileHandle(create=false) when a directory already exists with the same name'); + +directory_test(async (t, dir) => { + const dir_handle = await dir.getDirectoryHandle('dir-name', {create: true}); + t.add_cleanup(() => dir.removeEntry('dir-name', {recursive: true})); + + await promise_rejects_dom( + t, 'TypeMismatchError', dir.getFileHandle('dir-name', {create: true})); +}, 'getFileHandle(create=true) when a directory already exists with the same name'); + +directory_test(async (t, dir) => { + await promise_rejects_js(t, TypeError, dir.getFileHandle('', {create: true})); + await promise_rejects_js( + t, TypeError, dir.getFileHandle('', {create: false})); +}, 'getFileHandle() with empty name'); + +directory_test(async (t, dir) => { + await promise_rejects_js(t, TypeError, dir.getFileHandle(kCurrentDirectory)); + await promise_rejects_js( + t, TypeError, dir.getFileHandle(kCurrentDirectory, {create: true})); +}, `getFileHandle() with "${kCurrentDirectory}" name`); + +directory_test(async (t, dir) => { + const subdir = await createDirectory(t, 'subdir-name', /*parent=*/ dir); + + await promise_rejects_js( + t, TypeError, subdir.getFileHandle(kParentDirectory)); + await promise_rejects_js( + t, TypeError, subdir.getFileHandle(kParentDirectory, {create: true})); +}, `getFileHandle() with "${kParentDirectory}" name`); + +directory_test(async (t, dir) => { + const subdir_name = 'subdir-name'; + const subdir = await createDirectory(t, subdir_name, /*parent=*/ dir); + + const file_name = 'file-name'; + await createEmptyFile(t, file_name, /*parent=*/ subdir); + + for (let i = 0; i < kPathSeparators.length; ++i) { + const path_with_separator = + `${subdir_name}${kPathSeparators[i]}${file_name}`; + await promise_rejects_js( + t, TypeError, dir.getFileHandle(path_with_separator), + `getFileHandle() must reject names containing "${kPathSeparators[i]}"`); + } +}, 'getFileHandle(create=false) with a path separator when the file exists.'); + +directory_test(async (t, dir) => { + const subdir_name = 'subdir-name'; + const subdir = await createDirectory(t, subdir_name, /*parent=*/ dir); + + for (let i = 0; i < kPathSeparators.length; ++i) { + const path_with_separator = `${subdir_name}${kPathSeparators[i]}file_name`; + await promise_rejects_js( + t, TypeError, dir.getFileHandle(path_with_separator, {create: true}), + `getFileHandle(create=true) must reject names containing "${ + kPathSeparators[i]}"`); + } +}, 'getFileHandle(create=true) with a path separator'); diff --git a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-removeEntry.js b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-removeEntry.js index ffd24a5eb7b..5b25ed6874f 100644 --- a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-removeEntry.js +++ b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemDirectoryHandle-removeEntry.js @@ -18,7 +18,7 @@ directory_test(async (t, root) => { }, 'removeEntry() on an already removed file should fail'); directory_test(async (t, root) => { - const dir = await root.getDirectory('dir-to-remove', {create: true}); + const dir = await root.getDirectoryHandle('dir-to-remove', {create: true}); await createFileWithContents(t, 'file-to-keep', 'abc', root); await root.removeEntry('dir-to-remove'); @@ -27,7 +27,7 @@ directory_test(async (t, root) => { }, 'removeEntry() to remove an empty directory'); directory_test(async (t, root) => { - const dir = await root.getDirectory('dir-to-remove', {create: true}); + const dir = await root.getDirectoryHandle('dir-to-remove', {create: true}); t.add_cleanup(() => root.removeEntry('dir-to-remove', {recursive: true})); await createEmptyFile(t, 'file-in-dir', dir); diff --git a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemWritableFileStream-write.js b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemWritableFileStream-write.js index 516894bcf95..c49f0f62848 100644 --- a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemWritableFileStream-write.js +++ b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemWritableFileStream-write.js @@ -295,7 +295,9 @@ directory_test(async (t, root) => { directory_test(async (t, root) => { const handle = await createEmptyFile(t, 'writer_written', root); const stream = await handle.createWritable(); + assert_false(stream.locked); const writer = stream.getWriter(); + assert_true(stream.locked); await writer.write('foo'); await writer.write(new Blob(['bar'])); diff --git a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemWritableFileStream.js b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemWritableFileStream.js index 778437e2a59..1cebb993556 100644 --- a/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemWritableFileStream.js +++ b/tests/wpt/web-platform-tests/native-file-system/script-tests/FileSystemWritableFileStream.js @@ -104,14 +104,20 @@ directory_test(async (t, root) => { directory_test(async (t, root) => { const handle = await createEmptyFile(t, 'contents', root); const stream = await handle.createWritable(); + assert_false(stream.locked); stream.write('abc'); + assert_false(stream.locked); stream.write('def'); + assert_false(stream.locked); stream.truncate(9); + assert_false(stream.locked); stream.seek(0); + assert_false(stream.locked); stream.write('xyz'); + assert_false(stream.locked); await stream.close(); assert_equals(await getFileContents(handle), 'xyzdef\0\0\0'); assert_equals(await getFileSize(handle), 9); -}, 'commands are queued'); +}, 'commands are queued, stream is unlocked after each operation'); diff --git a/tests/wpt/web-platform-tests/native-file-system/showDirectoryPicker-manual.https.html b/tests/wpt/web-platform-tests/native-file-system/showDirectoryPicker-manual.https.html index b19287877f7..5dadbe1a9d5 100644 --- a/tests/wpt/web-platform-tests/native-file-system/showDirectoryPicker-manual.https.html +++ b/tests/wpt/web-platform-tests/native-file-system/showDirectoryPicker-manual.https.html @@ -22,8 +22,7 @@ const dir = await self.showDirectoryPicker(); assert_true(dir instanceof FileSystemHandle); assert_true(dir instanceof FileSystemDirectoryHandle); - assert_false(dir.isFile); - assert_true(dir.isDirectory); + assert_equals(dir.kind, "directory"); assert_equals(dir.name, 'data'); assert_array_equals(await getSortedDirectoryEntries(dir), ['testfile.txt']); diff --git a/tests/wpt/web-platform-tests/native-file-system/showOpenFilePicker-manual.https.html b/tests/wpt/web-platform-tests/native-file-system/showOpenFilePicker-manual.https.html index b55157ad20f..2289b8f8d8b 100644 --- a/tests/wpt/web-platform-tests/native-file-system/showOpenFilePicker-manual.https.html +++ b/tests/wpt/web-platform-tests/native-file-system/showOpenFilePicker-manual.https.html @@ -29,8 +29,7 @@ assert_equals(files.length, 1); assert_true(files[0] instanceof FileSystemHandle); assert_true(files[0] instanceof FileSystemFileHandle); - assert_true(files[0].isFile); - assert_false(files[0].isDirectory); + assert_equals(files[0].kind, "file"); assert_equals(files[0].name, 'testfile.txt'); assert_equals(await (await files[0].getFile()).text(), 'Hello World!\n'); diff --git a/tests/wpt/web-platform-tests/native-file-system/showSaveFilePicker-manual.https.html b/tests/wpt/web-platform-tests/native-file-system/showSaveFilePicker-manual.https.html index f8280d29ff5..022f67771d7 100644 --- a/tests/wpt/web-platform-tests/native-file-system/showSaveFilePicker-manual.https.html +++ b/tests/wpt/web-platform-tests/native-file-system/showSaveFilePicker-manual.https.html @@ -19,8 +19,7 @@ }); assert_true(file instanceof FileSystemHandle); assert_true(file instanceof FileSystemFileHandle); - assert_true(file.isFile); - assert_false(file.isDirectory); + assert_equals(file.kind, "file"); assert_equals(file.name, 'testfile.txt'); assert_equals(await (await file.getFile()).text(), '', 'showSaveFilePicker should clear contents of file'); diff --git a/tests/wpt/web-platform-tests/native-io/close_async.tentative.https.any.js b/tests/wpt/web-platform-tests/native-io/close_async.tentative.https.any.js index 6ad27ffb447..a2b692e2950 100644 --- a/tests/wpt/web-platform-tests/native-io/close_async.tentative.https.any.js +++ b/tests/wpt/web-platform-tests/native-io/close_async.tentative.https.any.js @@ -80,3 +80,18 @@ promise_test(async testCase => { file.write(writtenBytes, 4)); assert_equals(await closePromise, undefined); }, 'NativeIOFile.write fails immediately after calling NativeIOFile.close'); + +promise_test(async testCase => { + const file = await createFile(testCase, 'file_name'); + assert_equals(await file.close(), undefined); + + await promise_rejects_dom(testCase, 'InvalidStateError', file.getLength()); +}, 'NativeIOFile.getLength fails after NativeIOFile.close settles'); + +promise_test(async testCase => { + const file = await createFile(testCase, 'file_name'); + const closePromise = file.close(); + + await promise_rejects_dom(testCase, 'InvalidStateError', file.getLength()); + assert_equals(await closePromise, undefined); +}, 'NativeIOFile.getLength fails immediately after calling NativeIOFile.close'); diff --git a/tests/wpt/web-platform-tests/native-io/close_sync.tentative.https.any.js b/tests/wpt/web-platform-tests/native-io/close_sync.tentative.https.any.js index e4f5871a65e..b5fb2880919 100644 --- a/tests/wpt/web-platform-tests/native-io/close_sync.tentative.https.any.js +++ b/tests/wpt/web-platform-tests/native-io/close_sync.tentative.https.any.js @@ -25,7 +25,7 @@ test(testCase => { assert_equals(undefined, file.close()); assert_equals(undefined, file.close()); -}, 'nativeIO.close is idempotent'); +}, 'NativeIOFileSync.close is idempotent'); test(testCase => { const file = createFileSync(testCase, 'file_name'); @@ -33,7 +33,7 @@ test(testCase => { const readBytes = new Uint8Array(4); assert_throws_dom('InvalidStateError', () => file.read(readBytes, 4)); -}, 'nativeIO.read fails after nativeIO.close settles'); +}, 'NativeIOFileSync.read fails after NativeIOFileSync.close'); test(testCase => { const file = createFileSync(testCase, 'file_name'); @@ -42,3 +42,10 @@ test(testCase => { const writtenBytes = Uint8Array.from([96, 97, 98, 99]); assert_throws_dom('InvalidStateError', () => file.write(writtenBytes, 4)); }, 'NativeIOFile.write fails after NativeIOFile.close'); + +test(testCase => { + const file = createFileSync(testCase, 'file_name'); + assert_equals(undefined, file.close()); + + assert_throws_dom('InvalidStateError', () => file.getLength()); +}, 'NativeIOFileSync.getLength fails after NativeIOFileSync.close'); diff --git a/tests/wpt/web-platform-tests/native-io/concurrent_io/concurrent_io_getLength_async.tentative.https.any.js b/tests/wpt/web-platform-tests/native-io/concurrent_io/concurrent_io_getLength_async.tentative.https.any.js new file mode 100644 index 00000000000..d542188738e --- /dev/null +++ b/tests/wpt/web-platform-tests/native-io/concurrent_io/concurrent_io_getLength_async.tentative.https.any.js @@ -0,0 +1,31 @@ +// META: title=NativeIO API: Concurrent IO while getLength is resolving. +// META: global=window,worker +// META: script=operation_helpers.js +// META: script=../resources/support.js + +'use strict'; + +// See documentation in operation_helpers.js + +for (let op of kOperations) { + promise_test(async testCase => { + const file = await createFile(testCase, 'getlength_file'); + + const res = op.prepare(); + + const getLengthPromise = file.getLength(); + await op.assertRejection(testCase, file, res); + + assert_equals(await getLengthPromise, 4); + + const readSharedArrayBuffer = new SharedArrayBuffer(4); + const readBytes = new Uint8Array(readSharedArrayBuffer); + assert_equals(await file.read(readBytes, 0), 4, + `NativeIOFile.read() should not fail after a rejected ` + + `${op.name} during getLength()`); + assert_array_equals(readBytes, [64, 65, 66, 67], + `Rejecting ${op.name} during getLength() should not ` + + `change the file.`); + op.assertUnchanged(res); + }, `${op.name}() rejects while getLength() is resolving.`); +}; diff --git a/tests/wpt/web-platform-tests/native-io/concurrent_io/concurrent_io_read_async.tentative.https.any.js b/tests/wpt/web-platform-tests/native-io/concurrent_io/concurrent_io_read_async.tentative.https.any.js new file mode 100644 index 00000000000..0cc4ad3e930 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-io/concurrent_io/concurrent_io_read_async.tentative.https.any.js @@ -0,0 +1,33 @@ +// META: title=NativeIO API: Concurrent IO while read is resolving. +// META: global=window,worker +// META: script=operation_helpers.js +// META: script=../resources/support.js + +'use strict'; + +// See documentation in operation_helpers.js + +for (let op of kOperations) { + promise_test(async testCase => { + const file = await createFile(testCase, 'read_file'); + + const readSharedArrayBuffer = new SharedArrayBuffer(4); + const readBytes = new Uint8Array(readSharedArrayBuffer); + const res = op.prepare(); + + const readPromise = file.read(readBytes, 0); + await op.assertRejection(testCase, file, res); + + assert_equals(await readPromise, 4); + assert_array_equals(readBytes, [64, 65, 66, 67]); + + readBytes.fill(0); + assert_equals(await file.read(readBytes, 0), 4, + 'NativeIOFile.read() should not fail after a rejected ' + + `${op.name} during read()`); + assert_array_equals(readBytes, [64, 65, 66, 67], + `Rejecting ${op.name} during read() should not ` + + 'change the file.'); + op.assertUnchanged(res); + }, `${op.name}() rejects while read() is resolving.`); +}; diff --git a/tests/wpt/web-platform-tests/native-io/concurrent_io/concurrent_io_write_async.tentative.https.any.js b/tests/wpt/web-platform-tests/native-io/concurrent_io/concurrent_io_write_async.tentative.https.any.js new file mode 100644 index 00000000000..0deb7652ee7 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-io/concurrent_io/concurrent_io_write_async.tentative.https.any.js @@ -0,0 +1,34 @@ +// META: title=NativeIO API: Concurrent IO while write is resolving. +// META: global=window,worker +// META: script=operation_helpers.js +// META: script=../resources/support.js + +'use strict'; + +// See documentation in operation_helpers.js + +for (let op of kOperations) { + promise_test(async testCase => { + const file = await createFile(testCase, 'write_file'); + + const writeSharedArrayBuffer = new SharedArrayBuffer(4); + const writtenBytes = new Uint8Array(writeSharedArrayBuffer); + writtenBytes.set([96, 97, 98, 99]); + const res = op.prepare(); + + const writePromise = file.write(writtenBytes, 0); + await op.assertRejection(testCase, file, res); + + assert_equals(await writePromise, 4); + + const readSharedArrayBuffer = new SharedArrayBuffer(4); + const readBytes = new Uint8Array(readSharedArrayBuffer); + assert_equals(await file.read(readBytes, 0), 4, + `NativeIOFile.read() should not fail after a rejected ` + + `${op.name} during write()`); + assert_array_equals(readBytes, writtenBytes, + `Rejecting ${op.name} during write() should still ` + + `complete the write.`); + op.assertUnchanged(res); + }, `${op.name}() rejects while write() is resolving.`); +}; diff --git a/tests/wpt/web-platform-tests/native-io/concurrent_io/operation_helpers.js b/tests/wpt/web-platform-tests/native-io/concurrent_io/operation_helpers.js new file mode 100644 index 00000000000..71cbc29efa0 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-io/concurrent_io/operation_helpers.js @@ -0,0 +1,67 @@ +// The concurrency tests assert that no pair of asynchronous I/O operations is +// run concurrently. For any operation A, there is one file containing the tests +// asserting that while A is running, any other operation B rejects. In order to +// avoid constructing a quadratic number of tests, the rejecting operations are +// abstracted here. +// +// For any rejecting operation B, define the following. +// name: The operation's name +// prepare: Code needed before performing the operation, e.g., buffer +// allocation. Returns an object to be passed to assertRejection +// and assertUnchanged. May be empty. +// assertRejection: A promise_rejects_dom(...) statement that calls +// operation B. Takes the object returned by prepare as +// third parameter. +// assertUnchanged: An assertion that rejecting the promise did not change +// the buffers in unexpected ways. The assertion does not +// check if the file itself was not changed. This will be +// after performing operation A in its file. Takes the +// object returned by prepare as parameter. May be empty. +// +// The array kOperations contains all abstractions. + +const kOperations = []; + +(() => { + const kOpRead = { + name: 'read', + prepare: () => { + const readSharedArrayBuffer = new SharedArrayBuffer(4); + const readBytes = new Uint8Array(readSharedArrayBuffer); + return readBytes; + }, + assertRejection: (testCase, file, readBytes) => { + return promise_rejects_dom(testCase, 'InvalidStateError', + file.read(readBytes, 4)); + }, + assertUnchanged: (readBytes) => { + assert_array_equals(readBytes, [0, 0, 0, 0]); + }, + }; + kOperations.push(kOpRead); + const kOpWrite = { + name: 'write', + prepare: () => { + const writeSharedArrayBuffer = new SharedArrayBuffer(4); + const writtenBytes = new Uint8Array(writeSharedArrayBuffer); + writtenBytes.set([96, 97, 98, 99]); + return writtenBytes; + }, + assertRejection: (testCase, file, writtenBytes) => { + return promise_rejects_dom(testCase, 'InvalidStateError', + file.write(writtenBytes, 4)); + }, + assertUnchanged: () => {}, + }; + kOperations.push(kOpWrite); + const kOpGetLength = { + name: 'getLength', + prepare: () => {}, + assertRejection: (testCase, file) => { + return promise_rejects_dom(testCase, 'InvalidStateError', + file.getLength()); + }, + assertUnchanged: () => {}, + }; + kOperations.push(kOpGetLength); +})(); diff --git a/tests/wpt/web-platform-tests/native-io/concurrent_io_async.tentative.https.any.js b/tests/wpt/web-platform-tests/native-io/concurrent_io_async.tentative.https.any.js deleted file mode 100644 index d7752004678..00000000000 --- a/tests/wpt/web-platform-tests/native-io/concurrent_io_async.tentative.https.any.js +++ /dev/null @@ -1,105 +0,0 @@ -// META: title=NativeIO API: close(). -// META: global=window,worker - -'use strict'; - -// Returns a handle to a newly created file that holds some data. -// -// The file will be closed and deleted when the test ends. -async function createFile(testCase, fileName) { - const file = await nativeIO.open(fileName); - testCase.add_cleanup(async () => { - await file.close(); - await nativeIO.delete(fileName); - }); - - const writeSharedArrayBuffer = new SharedArrayBuffer(4); - const writtenBytes = new Uint8Array(writeSharedArrayBuffer); - writtenBytes.set([64, 65, 66, 67]); - const writeCount = await file.write(writtenBytes, 0); - assert_equals(writeCount, 4); - - return file; -} - -promise_test(async testCase => { - const file = await createFile(testCase, 'file_name'); - - const readSharedArrayBuffer = new SharedArrayBuffer(4); - const readBytes = new Uint8Array(readSharedArrayBuffer); - const readSharedArrayBuffer2 = new SharedArrayBuffer(4); - const readBytes2 = new Uint8Array(readSharedArrayBuffer2); - - const readPromise = file.read(readBytes, 0); - await promise_rejects_dom(testCase, 'InvalidStateError', - file.read(readBytes2, 4)); - - assert_equals(await readPromise, 4); - assert_array_equals(readBytes, [64, 65, 66, 67]); - assert_array_equals(readBytes2, [0, 0, 0, 0]); -}, 'read() rejects wrile read() is resolving'); - -promise_test(async testCase => { - const file = await createFile(testCase, 'file_name'); - - const writeSharedArrayBuffer = new SharedArrayBuffer(4); - const writtenBytes = new Uint8Array(writeSharedArrayBuffer); - writtenBytes.set([96, 97, 98, 99]); - const readSharedArrayBuffer = new SharedArrayBuffer(4); - const readBytes = new Uint8Array(readSharedArrayBuffer); - - const writePromise = file.write(writtenBytes, 0); - await promise_rejects_dom(testCase, 'InvalidStateError', - file.read(readBytes, 4)); - - assert_equals(await writePromise, 4); - assert_array_equals(readBytes, [0, 0, 0, 0]); -}, 'read() rejects wrile write() is resolving'); - -promise_test(async testCase => { - const file = await createFile(testCase, 'file_name'); - - const readSharedArrayBuffer = new SharedArrayBuffer(4); - const readBytes = new Uint8Array(readSharedArrayBuffer); - const writeSharedArrayBuffer = new SharedArrayBuffer(4); - const writtenBytes = new Uint8Array(writeSharedArrayBuffer); - writtenBytes.set([96, 97, 98, 99]); - - const readPromise = file.read(readBytes, 0); - await promise_rejects_dom(testCase, 'InvalidStateError', - file.write(writtenBytes, 4)); - - assert_equals(await readPromise, 4); - assert_array_equals(readBytes, [64, 65, 66, 67]); - - readBytes.fill(0); - assert_equals(await file.read(readBytes, 0), 4, - 'NativeIOFile.read() should not fail after a rejected write'); - assert_array_equals(readBytes, [64, 65, 66, 67], - 'The rejected write should not change the file'); -}, 'write() rejects wrile read() is resolving'); - -promise_test(async testCase => { - const file = await createFile(testCase, 'file_name'); - - const writeSharedArrayBuffer = new SharedArrayBuffer(4); - const writtenBytes = new Uint8Array(writeSharedArrayBuffer); - writtenBytes.set([96, 97, 98, 99]); - - const writeSharedArrayBuffer2 = new SharedArrayBuffer(4); - const writtenBytes2 = new Uint8Array(writeSharedArrayBuffer2); - writtenBytes2.set([48, 49, 50, 51]); - - const writePromise = file.write(writtenBytes, 0); - await promise_rejects_dom(testCase, 'InvalidStateError', - file.write(writtenBytes2, 4)); - - assert_equals(await writePromise, 4); - - const readSharedArrayBuffer = new SharedArrayBuffer(4); - const readBytes = new Uint8Array(readSharedArrayBuffer); - assert_equals(await file.read(readBytes, 0), 4, - 'NativeIOFile.read() should not fail after a rejected write'); - assert_array_equals(readBytes, writtenBytes, - 'The rejected write should not change the file'); -}, 'write() rejects wrile write() is resolving'); diff --git a/tests/wpt/web-platform-tests/native-io/resources/support.js b/tests/wpt/web-platform-tests/native-io/resources/support.js index adbfbc45d19..90bb9120bc5 100644 --- a/tests/wpt/web-platform-tests/native-io/resources/support.js +++ b/tests/wpt/web-platform-tests/native-io/resources/support.js @@ -5,3 +5,22 @@ const kBadNativeIoNames = [ "has.dot", "has/slash", ]; + +// Returns a handle to a newly created file that holds some data. +// +// The file will be closed and deleted when the test ends. +async function createFile(testCase, fileName) { + const file = await nativeIO.open(fileName); + testCase.add_cleanup(async () => { + await file.close(); + await nativeIO.delete(fileName); + }); + + const writeSharedArrayBuffer = new SharedArrayBuffer(4); + const writtenBytes = new Uint8Array(writeSharedArrayBuffer); + writtenBytes.set([64, 65, 66, 67]); + const writeCount = await file.write(writtenBytes, 0); + assert_equals(writeCount, 4); + + return file; +} diff --git a/tests/wpt/web-platform-tests/native-io/write_getLength_async_basic.tentative.https.any.js b/tests/wpt/web-platform-tests/native-io/write_getLength_async_basic.tentative.https.any.js new file mode 100644 index 00000000000..bf886cca397 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-io/write_getLength_async_basic.tentative.https.any.js @@ -0,0 +1,26 @@ +// META: title=Synchronous NativeIO API: getLength reports written bytes. +// META: global=window,worker + +'use strict'; + +promise_test(async testCase => { + const file = await nativeIO.open('test_file'); + testCase.add_cleanup(async () => { + await file.close(); + await nativeIO.delete('test_file'); + }); + + const writeSharedArrayBuffer = new SharedArrayBuffer(4); + const writtenBytes = new Uint8Array(writeSharedArrayBuffer); + writtenBytes.set([64, 65, 66, 67]); + const writeCount = await file.write(writtenBytes, 0); + assert_equals( + writeCount, 4, + 'NativeIOFile.write() should resolve with the number of bytes written'); + + const length = await file.getLength(); + assert_equals(length, 4, + 'NativeIOFile.getLength() should return the number of' + + ' bytes in the file'); +}, 'NativeIOFile.getLength returns number of bytes written by' + + 'NativeIOFile.write'); diff --git a/tests/wpt/web-platform-tests/native-io/write_getLength_sync_basic.tentative.https.any.js b/tests/wpt/web-platform-tests/native-io/write_getLength_sync_basic.tentative.https.any.js new file mode 100644 index 00000000000..e0fead326a5 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-io/write_getLength_sync_basic.tentative.https.any.js @@ -0,0 +1,25 @@ +// META: title=Synchronous NativeIO API: getLength reports written bytes. +// META: global=dedicatedworker + +'use strict'; + +test(testCase => { + const file = nativeIO.openSync('test_file'); + testCase.add_cleanup(() => { + file.close(); + nativeIO.deleteSync('test_file'); + }); + + const writtenBytes = Uint8Array.from([64, 65, 66, 67]); + const writeCount = file.write(writtenBytes, 0); + assert_equals( + writeCount, 4, + 'NativeIOFileSync.write() should resolve with the number of bytes' + + 'written.'); + + const length = file.getLength(); + assert_equals(length, 4, + 'NativeIOFileSync.getLength() should return the number of' + + ' bytes in the file.'); +}, 'NativeIOFileSync.getLength returns the number bytes written by' + + ' NativeIOFileSync.write'); diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-same-no-2-ports-yes.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-same-no-2-ports-yes.sub.https.html new file mode 100644 index 00000000000..dc449e22509 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-same-no-2-ports-yes.sub.https.html @@ -0,0 +1,40 @@ + + +Parent is not isolated, navigate a frame from same-origin non-isolated to different-origin (different-port) isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-same-no-2-subdomain-yes.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-same-no-2-subdomain-yes.sub.https.html new file mode 100644 index 00000000000..6815aa97a65 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-same-no-2-subdomain-yes.sub.https.html @@ -0,0 +1,40 @@ + + +Parent is not isolated, navigate a frame from same-origin non-isolated to different-origin (subdomain) isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-no-2-subdomain-yes.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-no-2-subdomain-yes.sub.https.html new file mode 100644 index 00000000000..2887ea85f60 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-no-2-subdomain-yes.sub.https.html @@ -0,0 +1,40 @@ + + +Parent is not isolated, navigate a frame from a subdomain non-isolated to the same subdomain isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-no-2-subdomain2-yes.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-no-2-subdomain2-yes.sub.https.html new file mode 100644 index 00000000000..cd01f969d4f --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-no-2-subdomain2-yes.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is not isolated, navigate a frame from a subdomain non-isolated to a second-subdomain isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-yes-2-subdomain-no.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-yes-2-subdomain-no.sub.https.html new file mode 100644 index 00000000000..245a833192e --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-yes-2-subdomain-no.sub.https.html @@ -0,0 +1,40 @@ + + +Parent is not isolated, navigate a frame from a subdomain isolated to the same subdomain non-isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-yes-2-subdomain2-no.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-yes-2-subdomain2-no.sub.https.html new file mode 100644 index 00000000000..a4ee8e1f927 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-no-1-subdomain-yes-2-subdomain2-no.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is not isolated, navigate a frame from a subdomain isolated to a second-subdomain non-isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-ports-no.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-ports-no.sub.https.html new file mode 100644 index 00000000000..9b554c3cecf --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-ports-no.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is isolated, navigate a frame from same-origin non-isolated to different-origin (different-port) isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-ports-no.sub.https.html.headers b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-ports-no.sub.https.html.headers new file mode 100644 index 00000000000..ea3f6b335c7 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-ports-no.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-subdomain-no.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-subdomain-no.sub.https.html new file mode 100644 index 00000000000..07a6b01d9f0 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-subdomain-no.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is isolated, navigate a frame from same-origin non-isolated to different-origin (subdomain) isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-subdomain-no.sub.https.html.headers b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-subdomain-no.sub.https.html.headers new file mode 100644 index 00000000000..ea3f6b335c7 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/navigation-parent-yes-1-same-no-2-subdomain-no.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-no-child-yes-ports.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/parent-no-child-yes-ports.sub.https.html new file mode 100644 index 00000000000..e203d0c3c67 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-no-child-yes-ports.sub.https.html @@ -0,0 +1,24 @@ + + +Parent is not isolated, child is isolated, child is different-origin to the parent because of a port mismatch + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-no-child1-no-child2-yes-children-ports.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/parent-no-child1-no-child2-yes-children-ports.sub.https.html new file mode 100644 index 00000000000..f5de8877f67 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-no-child1-no-child2-yes-children-ports.sub.https.html @@ -0,0 +1,32 @@ + + +Parent is not isolated, subdomain child 1 is not isolated, different-port-same-subdomain child 2 is isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-no-child1-yes-child2-no-not-subdomain.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/parent-no-child1-yes-child2-no-not-subdomain.sub.https.html new file mode 100644 index 00000000000..7b7b2a2f191 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-no-child1-yes-child2-no-not-subdomain.sub.https.html @@ -0,0 +1,37 @@ + + +Parent is not isolated, subdomain child 1 is isolated, non-subdomain but different-port child 2 is not isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-no-ports.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-no-ports.sub.https.html new file mode 100644 index 00000000000..a33dcd25ee3 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-no-ports.sub.https.html @@ -0,0 +1,23 @@ + + +Parent is isolated, child is not isolated, child is is different-origin to the parent because of a port mismatch + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-no-ports.sub.https.html.headers b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-no-ports.sub.https.html.headers new file mode 100644 index 00000000000..ea3f6b335c7 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-no-ports.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-yes-ports.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-yes-ports.sub.https.html new file mode 100644 index 00000000000..d20bd347a51 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-yes-ports.sub.https.html @@ -0,0 +1,23 @@ + + +Parent is isolated, child is not isolated, child is different-origin to the parent because of a port mismatch + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-yes-ports.sub.https.html.headers b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-yes-ports.sub.https.html.headers new file mode 100644 index 00000000000..ea3f6b335c7 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child-yes-ports.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-no-child2-yes-children-ports.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-no-child2-yes-children-ports.sub.https.html new file mode 100644 index 00000000000..230162471cf --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-no-child2-yes-children-ports.sub.https.html @@ -0,0 +1,33 @@ + + +Parent is isolated, subdomain child 1 is not isolated, different-port-same-subdomain child 2 is isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-no-child2-yes-children-ports.sub.https.html.headers b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-no-child2-yes-children-ports.sub.https.html.headers new file mode 100644 index 00000000000..ea3f6b335c7 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-no-child2-yes-children-ports.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-no-not-subdomain.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-no-not-subdomain.sub.https.html new file mode 100644 index 00000000000..784e100f617 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-no-not-subdomain.sub.https.html @@ -0,0 +1,36 @@ + + +Parent is isolated, subdomain child 1 is isolated, non-subdomain but different-port child 2 is not isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-no-not-subdomain.sub.https.html.headers b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-no-not-subdomain.sub.https.html.headers new file mode 100644 index 00000000000..ea3f6b335c7 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-no-not-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-ports.sub.https.html b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-ports.sub.https.html new file mode 100644 index 00000000000..bf8731663be --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-ports.sub.https.html @@ -0,0 +1,33 @@ + + +Parent is isolated, subdomain child 1 is isolated, different-port-same-subdomain child 2 is isolated + + + +
+ + diff --git a/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-ports.sub.https.html.headers b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-ports.sub.https.html.headers new file mode 100644 index 00000000000..ea3f6b335c7 --- /dev/null +++ b/tests/wpt/web-platform-tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-ports.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/tests/wpt/web-platform-tests/origin-isolation/resources/helpers.mjs b/tests/wpt/web-platform-tests/origin-isolation/resources/helpers.mjs index 50ca1ab4874..e8425c240b5 100644 --- a/tests/wpt/web-platform-tests/origin-isolation/resources/helpers.mjs +++ b/tests/wpt/web-platform-tests/origin-isolation/resources/helpers.mjs @@ -2,15 +2,15 @@ * Inserts an iframe usable for origin isolation testing, and returns a promise * fulfilled when the iframe is loaded and its document.domain is set. The * iframe will point to the send-origin-isolation-header.py file, on the - * designated hostname - * @param {string} hostname - The hostname used to calculate the iframe's src="" + * designated host + * @param {string} host - The host used to calculate the iframe's src="" * @param {string=} header - The value of the Origin-Isolation header that the * iframe will set. Omit this to set no header. * @returns {HTMLIFrameElement} The created iframe element */ -export async function insertIframe(hostname, header) { +export async function insertIframe(host, header) { const iframe = document.createElement("iframe"); - const navigatePromise = navigateIframe(iframe, hostname, header); + const navigatePromise = navigateIframe(iframe, host, header); document.body.append(iframe); await navigatePromise; await setBothDocumentDomains(iframe.contentWindow); @@ -21,15 +21,14 @@ export async function insertIframe(hostname, header) { * Navigates an iframe to a page for origin isolation testing, similar to * insertIframe but operating on an existing iframe. * @param {HTMLIFrameElement} iframeEl - The + + + diff --git a/tests/wpt/web-platform-tests/portals/portals-focus.sub.html b/tests/wpt/web-platform-tests/portals/portals-focus.sub.html index ccbac7db906..168e74aa9c8 100644 --- a/tests/wpt/web-platform-tests/portals/portals-focus.sub.html +++ b/tests/wpt/web-platform-tests/portals/portals-focus.sub.html @@ -121,7 +121,9 @@ try { portal.focus(); for (let key of [SPACE, RETURN]) { - let clickPromise = new Promise(r => portal.onclick = r); + let clickPromise = new Promise((resolve) => { + portal.onclick = e => { e.preventDefault(); resolve(); }; + }); await test_driver.send_keys(document.body, key); await clickPromise; } diff --git a/tests/wpt/web-platform-tests/portals/resources/portal-activate-broadcastchannel.html b/tests/wpt/web-platform-tests/portals/resources/portal-activate-broadcastchannel.html new file mode 100644 index 00000000000..b922afaec26 --- /dev/null +++ b/tests/wpt/web-platform-tests/portals/resources/portal-activate-broadcastchannel.html @@ -0,0 +1,8 @@ + + diff --git a/tests/wpt/web-platform-tests/resize-observer/svg.html b/tests/wpt/web-platform-tests/resize-observer/svg.html index b05a10c82e8..8a6def18964 100644 --- a/tests/wpt/web-platform-tests/resize-observer/svg.html +++ b/tests/wpt/web-platform-tests/resize-observer/svg.html @@ -398,7 +398,7 @@ function test12() { function test13() { let target = document.querySelector('rect'); let helper = new ResizeTestHelper( - "test13: observe svg:circle border box", + "test13: observe svg:rect border box", [ { setup: observer => { @@ -508,7 +508,6 @@ function test16() { document.body.style.zoom = 0.1; }, notify: (entries, observer) => { - // Ensure zoom does not impact the sizes assert_equals(entries.length, 1); assert_equals(entries[0].contentRect.width, 50); assert_equals(entries[0].contentRect.height, 20); @@ -516,8 +515,26 @@ function test16() { assert_equals(entries[0].contentBoxSize[0].blockSize, 20); assert_equals(entries[0].borderBoxSize[0].inlineSize, 50); assert_equals(entries[0].borderBoxSize[0].blockSize, 20); - assert_equals(entries[0].devicePixelContentBoxSize[0].inlineSize, 50); - assert_equals(entries[0].devicePixelContentBoxSize[0].blockSize, 20); + assert_equals(entries[0].devicePixelContentBoxSize[0].inlineSize, 5); + assert_equals(entries[0].devicePixelContentBoxSize[0].blockSize, 2); + return true; // Delay next step + } + }, + { + setup: observer => { + observer.observe(target, {box: "device-pixel-content-box"}); + target.setAttribute('height', 30); + }, + notify: (entries, observer) => { + assert_equals(entries.length, 1); + assert_equals(entries[0].contentRect.width, 50); + assert_equals(entries[0].contentRect.height, 30); + assert_equals(entries[0].contentBoxSize[0].inlineSize, 50); + assert_equals(entries[0].contentBoxSize[0].blockSize, 30); + assert_equals(entries[0].borderBoxSize[0].inlineSize, 50); + assert_equals(entries[0].borderBoxSize[0].blockSize, 30); + assert_equals(entries[0].devicePixelContentBoxSize[0].inlineSize, 5); + assert_equals(entries[0].devicePixelContentBoxSize[0].blockSize, 3); return true; // Delay next step } }, @@ -526,11 +543,16 @@ function test16() { document.body.style.zoom = 10; }, notify: (entries, observer) => { - + assert_equals(entries.length, 1); + assert_equals(entries[0].contentRect.width, 50); + assert_equals(entries[0].contentRect.height, 30); + assert_equals(entries[0].contentBoxSize[0].inlineSize, 50); + assert_equals(entries[0].contentBoxSize[0].blockSize, 30); + assert_equals(entries[0].borderBoxSize[0].inlineSize, 50); + assert_equals(entries[0].borderBoxSize[0].blockSize, 30); + assert_equals(entries[0].devicePixelContentBoxSize[0].inlineSize, 500); + assert_equals(entries[0].devicePixelContentBoxSize[0].blockSize, 300); }, - timeout: () => { - // SVG computed size is always bounding box inline and block lengths - } } ]); return helper.start(); diff --git a/tests/wpt/web-platform-tests/resources/chromium/webxr-test.js b/tests/wpt/web-platform-tests/resources/chromium/webxr-test.js index 7854b4f85ff..3ecb18e5556 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/webxr-test.js +++ b/tests/wpt/web-platform-tests/resources/chromium/webxr-test.js @@ -3,14 +3,13 @@ // This polyfill library implements the WebXR Test API as specified here: // https://github.com/immersive-web/webxr-test-api -// The standingTransform is floor_from_mojo and represented as such here. -const default_standing = new gfx.mojom.Transform(); -default_standing.matrix = [1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 1.65, 0, 1]; +const defaultMojoFromFloor = new gfx.mojom.Transform(); +defaultMojoFromFloor.matrix = [1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, -1.65, 0, 1]; const default_stage_parameters = { - standingTransform: default_standing, + mojoFromFloor: defaultMojoFromFloor, bounds: null }; @@ -267,6 +266,10 @@ class FakeXRAnchorController { return this.dirty_; } + get paused() { + return this.paused_; + } + markProcessed() { this.dirty_ = false; } @@ -490,12 +493,11 @@ class MockRuntime { this.stageParameters_.bounds = this.bounds_; } - this.stageParameters_.standingTransform = new gfx.mojom.Transform(); + this.stageParameters_.mojoFromFloor = new gfx.mojom.Transform(); - // floorOrigin is passed in as mojoFromFloor; however, standingTransform is - // floorFromMojo so we need to invert the result of |getMatrixFromTransform| - this.stageParameters_.standingTransform.matrix = - XRMathHelper.inverse(getMatrixFromTransform(floorOrigin)); + // floorOrigin is passed in as mojoFromFloor. + this.stageParameters_.mojoFromFloor.matrix = + getMatrixFromTransform(floorOrigin); this.onStageParametersUpdated(); } @@ -982,7 +984,7 @@ class MockRuntime { const anchorData = new device.mojom.XRAnchorData(); anchorData.id = id; if(!controller.paused) { - anchorData.pose = XRMathHelper.decomposeRigidTransform( + anchorData.mojoFromAnchor = XRMathHelper.decomposeRigidTransform( controller.getAnchorOrigin()); } @@ -1261,12 +1263,11 @@ class MockRuntime { case device.mojom.XRReferenceSpaceType.kLocal: return XRMathHelper.identity(); case device.mojom.XRReferenceSpaceType.kLocalFloor: - if (this.stageParameters_ == null || this.stageParameters_.standingTransform == null) { + if (this.stageParameters_ == null || this.stageParameters_.mojoFromFloor == null) { console.warn("Standing transform not available."); return null; } - // this.stageParameters_.standingTransform = floor_from_mojo aka native_origin_from_mojo - return XRMathHelper.inverse(this.stageParameters_.standingTransform.matrix); + return this.stageParameters_.mojoFromFloor.matrix; case device.mojom.XRReferenceSpaceType.kViewer: return mojo_from_viewer; case device.mojom.XRReferenceSpaceType.kBoundedFlor: diff --git a/tests/wpt/web-platform-tests/resources/test-only-api.js b/tests/wpt/web-platform-tests/resources/test-only-api.js new file mode 100644 index 00000000000..53891d21bd4 --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/test-only-api.js @@ -0,0 +1,68 @@ +'use strict'; + +/* Whether the browser is Chromium-based with MojoJS enabled */ +const isChromiumBased = 'MojoInterfaceInterceptor' in self; +/* Whether the browser is WebKit-based with internal test-only API enabled */ +const isWebKitBased = !isChromiumBased && 'internals' in self; + +/** + * Loads a script in a window or worker. + * + * @param {string} path - A script path + * @returns {Promise} + */ +function loadScript(path) { + if (typeof document === 'undefined') { + // Workers (importScripts is synchronous and may throw.) + importScripts(path); + return Promise.resolve(); + } else { + // Window + const script = document.createElement('script'); + script.src = path; + script.async = false; + const p = new Promise((resolve, reject) => { + script.onload = () => { resolve(); }; + script.onerror = e => { reject(e); }; + }) + document.head.appendChild(script); + return p; + } +} + +/** + * A helper for Chromium-based browsers to load Mojo JS bindingds + * + * This is an async function that works in both workers and windows. It first + * loads mojo_bindings.js, disables automatic dependency loading, and loads all + * resources sequentially. The promise resolves if everything loads + * successfully, or rejects if any exception is raised. If testharness.js is + * used, an uncaught exception will terminate the test with a harness error + * (unless `allow_uncaught_exception` is true), which is usually the desired + * behaviour. Only call this function if isChromiumBased === true. + * + * @param {Array.} resources - A list of scripts to load: Mojo JS + * bindings should be of the form '/gen/../*.mojom.js', the ordering of which + * does not matter. Do not include mojo_bindings.js in this list. You may + * include other non-mojom.js scripts for convenience. + * @returns {Promise} + */ +async function loadMojoResources(resources) { + if (!isChromiumBased) { + throw new Error('MojoJS not enabled; start Chrome with --enable-blink-features=MojoJS,MojoJSTest'); + } + if (resources.length == 0) { + return; + } + + // We want to load mojo_bindings.js separately to set mojo.config. + if (resources.some(p => p.endsWith('/mojo_bindings.js'))) { + throw new Error('Do not load mojo_bindings.js explicitly.'); + } + await loadScript('/gen/layout_test_data/mojo/public/js/mojo_bindings.js'); + mojo.config.autoLoadMojomDeps = false; + + for (const path of resources) { + await loadScript(path); + } +} diff --git a/tests/wpt/web-platform-tests/resources/test-only-api.js.headers b/tests/wpt/web-platform-tests/resources/test-only-api.js.headers new file mode 100644 index 00000000000..5e8f640c665 --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/test-only-api.js.headers @@ -0,0 +1,2 @@ +Content-Type: text/javascript; charset=utf-8 +Cache-Control: max-age=3600 diff --git a/tests/wpt/web-platform-tests/resources/testharness.js b/tests/wpt/web-platform-tests/resources/testharness.js index 7e2d4600f0f..274dc9d7d89 100644 --- a/tests/wpt/web-platform-tests/resources/testharness.js +++ b/tests/wpt/web-platform-tests/resources/testharness.js @@ -2609,6 +2609,7 @@ policies and contribution forms [3]. this.test_done_callbacks = []; this.all_done_callbacks = []; + this.hide_test_state = false; this.pending_remotes = []; this.status = new TestsStatus(); @@ -2656,6 +2657,8 @@ policies and contribution forms [3]. if (this.timeout_length) { this.timeout_length *= this.timeout_multiplier; } + } else if (p == "hide_test_state") { + this.hide_test_state = value; } } } @@ -3162,7 +3165,7 @@ policies and contribution forms [3]. this.phase = this.HAVE_RESULTS; } var done_count = tests.tests.length - tests.num_pending; - if (this.output_node) { + if (this.output_node && !tests.hide_test_state) { if (done_count < 100 || (done_count < 1000 && done_count % 100 === 0) || done_count % 1000 === 0) { diff --git a/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-before-phase.html b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-before-phase.html new file mode 100644 index 00000000000..878f9def212 --- /dev/null +++ b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-before-phase.html @@ -0,0 +1,62 @@ + + + + + + + +
+
+
+
+ diff --git a/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-cascade.html b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-cascade.html new file mode 100644 index 00000000000..7103491c0d0 --- /dev/null +++ b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-cascade.html @@ -0,0 +1,50 @@ + + + + + + +
+
+
+
+ diff --git a/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-inactive-phase.html b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-inactive-phase.html new file mode 100644 index 00000000000..a8db8e63238 --- /dev/null +++ b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-inactive-phase.html @@ -0,0 +1,59 @@ + + + + + + + + +
+
+ diff --git a/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-orientation.html b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-orientation.html new file mode 100644 index 00000000000..2c76f7a1117 --- /dev/null +++ b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-orientation.html @@ -0,0 +1,129 @@ + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+ diff --git a/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-sampling.html b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-sampling.html new file mode 100644 index 00000000000..474364f38fd --- /dev/null +++ b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-sampling.html @@ -0,0 +1,52 @@ + + + + + + + +
+
+
+
+ diff --git a/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-source.html b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-source.html new file mode 100644 index 00000000000..f2c50a1cd38 --- /dev/null +++ b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-source.html @@ -0,0 +1,135 @@ + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-start-end.html b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-start-end.html new file mode 100644 index 00000000000..fbe53d0fc0c --- /dev/null +++ b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-start-end.html @@ -0,0 +1,187 @@ + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+ diff --git a/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-time-range.html b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-time-range.html new file mode 100644 index 00000000000..407e17f0748 --- /dev/null +++ b/tests/wpt/web-platform-tests/scroll-animations/css/at-scroll-timeline-time-range.html @@ -0,0 +1,75 @@ + + + + + + + +
+
+
+
+
+
+
+
+ diff --git a/tests/wpt/web-platform-tests/scroll-animations/css/scroll-timeline-cssom.tentative.html b/tests/wpt/web-platform-tests/scroll-animations/css/scroll-timeline-cssom.tentative.html index 36fcbf704bd..09ec90a0449 100644 --- a/tests/wpt/web-platform-tests/scroll-animations/css/scroll-timeline-cssom.tentative.html +++ b/tests/wpt/web-platform-tests/scroll-animations/css/scroll-timeline-cssom.tentative.html @@ -112,6 +112,7 @@ test_source(' selector(#foo) ', 'selector(#foo)'); test_source('none'); test_source(' none ', 'none'); test_source('selector(#a\\9 b)'); +test_source('auto'); test_source('#foo', 'none'); test_source('', 'none'); diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-scripts-get.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-scripts-get.py index 9e376bc0928..ab7b84e3e34 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-scripts-get.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-scripts-get.py @@ -1,6 +1,6 @@ def main(req, res): return ([ - ('Cache-Control', 'no-cache, must-revalidate'), - ('Pragma', 'no-cache'), - ('Content-Type', 'application/javascript')], - '%s = "%s";\n' % (req.GET['output'], req.GET['msg'])) + (b'Cache-Control', b'no-cache, must-revalidate'), + (b'Pragma', b'no-cache'), + (b'Content-Type', b'application/javascript')], + b'%s = "%s";\n' % (req.GET[b'output'], req.GET[b'msg'])) diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-scripts-version.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-scripts-version.py index 91caa1a41ed..cde28544e60 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-scripts-version.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-scripts-version.py @@ -11,7 +11,7 @@ def main(req, res): now = (datetime.datetime.now() - epoch).total_seconds() return ([ - ('Cache-Control', 'no-cache, must-revalidate'), - ('Pragma', 'no-cache'), - ('Content-Type', 'application/javascript')], - 'version = "%s";\n' % now) + (b'Cache-Control', b'no-cache, must-revalidate'), + (b'Pragma', b'no-cache'), + (b'Content-Type', b'application/javascript')], + u'version = "%s";\n' % now) diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/invalid-chunked-encoding-with-flush.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/invalid-chunked-encoding-with-flush.py index c91250a9d1f..22a696508f4 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/invalid-chunked-encoding-with-flush.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/invalid-chunked-encoding-with-flush.py @@ -1,11 +1,11 @@ import time def main(request, response): - response.headers.set("Content-Type", "application/javascript") - response.headers.set("Transfer-encoding", "chunked") + response.headers.set(b"Content-Type", b"application/javascript") + response.headers.set(b"Transfer-encoding", b"chunked") response.write_status_headers() time.sleep(1) response.explicit_flush = True - response.writer.write("XX\r\n\r\n") + response.writer.write(b"XX\r\n\r\n") response.writer.flush() diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/invalid-chunked-encoding.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/invalid-chunked-encoding.py index ae2c1f21b2e..a8edd06b8dc 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/invalid-chunked-encoding.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/invalid-chunked-encoding.py @@ -1,2 +1,2 @@ def main(request, response): - return [("Content-Type", "application/javascript"), ("Transfer-encoding", "chunked")], "XX\r\n\r\n" + return [(b"Content-Type", b"application/javascript"), (b"Transfer-encoding", b"chunked")], b"XX\r\n\r\n" diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/malformed-worker.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/malformed-worker.py index 501521ff3e3..562c44eddc1 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/malformed-worker.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/malformed-worker.py @@ -1,10 +1,10 @@ def main(request, response): - headers = [("Content-Type", "application/javascript")] + headers = [(b"Content-Type", b"application/javascript")] - body = {'parse-error': 'var foo = function() {;', - 'undefined-error': 'foo.bar = 42;', - 'uncaught-exception': 'throw new DOMException("AbortError");', - 'caught-exception': 'try { throw new Error; } catch(e) {}', - 'import-malformed-script': 'importScripts("malformed-worker.py?parse-error");', - 'import-no-such-script': 'importScripts("no-such-script.js");'}[request.url_parts.query] + body = {u'parse-error': u'var foo = function() {;', + u'undefined-error': u'foo.bar = 42;', + u'uncaught-exception': u'throw new DOMException("AbortError");', + u'caught-exception': u'try { throw new Error; } catch(e) {}', + u'import-malformed-script': u'importScripts("malformed-worker.py?parse-error");', + u'import-no-such-script': u'importScripts("no-such-script.js");'}[request.url_parts.query] return headers, body diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/mime-type-worker.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/mime-type-worker.py index a16684de5cb..92a602e634c 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/mime-type-worker.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/mime-type-worker.py @@ -1,4 +1,4 @@ def main(request, response): - if 'mime' in request.GET: - return [('Content-Type', request.GET['mime'])], "" - return [], "" + if b'mime' in request.GET: + return [(b'Content-Type', request.GET[b'mime'])], b"" + return [], b"" diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/mint-new-worker.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/mint-new-worker.py index cbe70304d89..ebee4ff8e8d 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/mint-new-worker.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/mint-new-worker.py @@ -1,6 +1,8 @@ +import random + import time -body = ''' +body = u''' onactivate = (e) => e.waitUntil(clients.claim()); var resolve_wait_until; var wait_until = new Promise(resolve => { @@ -14,12 +16,12 @@ onmessage = (e) => { };''' def main(request, response): - headers = [('Cache-Control', 'no-cache, must-revalidate'), - ('Pragma', 'no-cache'), - ('Content-Type', 'application/javascript')] + headers = [(b'Cache-Control', b'no-cache, must-revalidate'), + (b'Pragma', b'no-cache'), + (b'Content-Type', b'application/javascript')] - skipWaiting = '' - if 'skip-waiting' in request.GET: - skipWaiting = 'skipWaiting();' + skipWaiting = u'' + if b'skip-waiting' in request.GET: + skipWaiting = u'skipWaiting();' - return headers, '/* %s %s */ %s %s' % (time.time(), time.clock(), skipWaiting, body) + return headers, u'/* %s %s */ %s %s' % (time.time(), random.random(), skipWaiting, body) diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/multipart-image.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/multipart-image.py index f94ee1c64fd..9a3c035f492 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/multipart-image.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/multipart-image.py @@ -3,21 +3,21 @@ import os -BOUNDARY = 'cutHere' +BOUNDARY = b'cutHere' def create_part(path): - with open(path, 'rb') as f: - return 'Content-Type: image/png\r\n\r\n' + f.read() + '--%s' % BOUNDARY + with open(path, u'rb') as f: + return b'Content-Type: image/png\r\n\r\n' + f.read() + b'--%s' % BOUNDARY def main(request, response): - content_type = 'multipart/x-mixed-replace; boundary=%s' % BOUNDARY - headers = [('Content-Type', content_type)] - if 'approvecors' in request.GET: - headers.append(('Access-Control-Allow-Origin', '*')) + content_type = b'multipart/x-mixed-replace; boundary=%s' % BOUNDARY + headers = [(b'Content-Type', content_type)] + if b'approvecors' in request.GET: + headers.append((b'Access-Control-Allow-Origin', b'*')) - image_path = os.path.join(request.doc_root, 'images') - body = create_part(os.path.join(image_path, 'red.png')) - body = body + create_part(os.path.join(image_path, 'red-16x16.png')) + image_path = os.path.join(request.doc_root, u'images') + body = create_part(os.path.join(image_path, u'red.png')) + body = body + create_part(os.path.join(image_path, u'red-16x16.png')) return headers, body diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-body.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-body.py index 601f818cff6..d10329e7836 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-body.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-body.py @@ -1,9 +1,11 @@ import os -filename = os.path.basename(__file__) +from wptserve.utils import isomorphic_encode + +filename = os.path.basename(isomorphic_encode(__file__)) def main(request, response): - if request.method == 'POST': - return 302, [('Location', './%s?redirect' % filename)], '' + if request.method == u'POST': + return 302, [(b'Location', b'./%s?redirect' % filename)], b'' - return [('Content-Type', 'text/plain')], request.request_path + return [(b'Content-Type', b'text/plain')], request.request_path diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-out-scope.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-out-scope.py index 16850723f96..9b90b146955 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-out-scope.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-out-scope.py @@ -1,14 +1,14 @@ def main(request, response): - if "url" in request.GET: - headers = [("Location", request.GET["url"])] - return 302, headers, '' + if b"url" in request.GET: + headers = [(b"Location", request.GET[b"url"])] + return 302, headers, b'' status = 200 - if "noLocationRedirect" in request.GET: + if b"noLocationRedirect" in request.GET: status = 302 - return status, [("content-type", "text/html")], ''' + return status, [(b"content-type", b"text/html")], b''' def make_mock_manifest(*items): - rv = Mock(tests_root="/foobar") + rv = mock.Mock(tests_root="/foobar") tests = [] rv.__iter__ = lambda self: iter(tests) rv.__getitem__ = lambda self, k: tests[k] @@ -204,13 +206,15 @@ def test_metadata_fuzzy(): references=[["/a/fuzzy-ref.html", "=="]], fuzzy=[[["/a/fuzzy.html", '/a/fuzzy-ref.html', '=='], [[2, 3], [10, 15]]]]) - s = Mock(rel_path="a/fuzzy.html", rel_path_parts=("a", "fuzzy.html"), hash="0"*40) - s.manifest_items = Mock(return_value=(item.item_type, [item])) + s = mock.Mock(rel_path="a/fuzzy.html", rel_path_parts=("a", "fuzzy.html"), hash="0"*40) + s.manifest_items = mock.Mock(return_value=(item.item_type, [item])) - manifest = wptmanifest.Manifest() + manifest = wptmanifest.Manifest("") - assert manifest.update([(s, True)]) is True + tree, sourcefile_mock = tree_and_sourcefile_mocks([(s, None, True)]) + with mock.patch("manifest.manifest.SourceFile", side_effect=sourcefile_mock): + assert manifest.update(tree) is True test_metadata = manifestexpected.static.compile(BytesIO(test_fuzzy), {}, diff --git a/tests/wpt/web-platform-tests/web-animations/animation-model/animation-types/property-list.js b/tests/wpt/web-platform-tests/web-animations/animation-model/animation-types/property-list.js index 32de670ed3c..3c3bf5de56d 100644 --- a/tests/wpt/web-platform-tests/web-animations/animation-model/animation-types/property-list.js +++ b/tests/wpt/web-platform-tests/web-animations/animation-model/animation-types/property-list.js @@ -599,7 +599,7 @@ const gCSSProperties1 = { types: [ 'fontVariationSettings', { type: 'discrete', - options: [ ['"wght" 1.1, "wdth" 1', '"wdth" 5'], + options: [ ['"wdth" 1, "wght" 1.1', '"wdth" 5'], ['"wdth" 5', 'normal'] ] }, ] diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-duration-loop.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-duration-loop.html deleted file mode 100644 index faa70e11c47..00000000000 --- a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-duration-loop.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Test AudioBufferSourceNode With Looping And Duration - - - - - - - - - - diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-oscillatornode-interface/osc-basic-waveform.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-oscillatornode-interface/osc-basic-waveform.html new file mode 100644 index 00000000000..bebcc6abc43 --- /dev/null +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-oscillatornode-interface/osc-basic-waveform.html @@ -0,0 +1,229 @@ + + + + + Test Basic Oscillator Sine Wave Test + + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html new file mode 100644 index 00000000000..af1898cac2e --- /dev/null +++ b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html @@ -0,0 +1,95 @@ + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html new file mode 100644 index 00000000000..a2f43878181 --- /dev/null +++ b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html @@ -0,0 +1,123 @@ + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html new file mode 100644 index 00000000000..1625538d754 --- /dev/null +++ b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html @@ -0,0 +1,73 @@ + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html new file mode 100644 index 00000000000..d3cc4c72dd2 --- /dev/null +++ b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html @@ -0,0 +1,116 @@ + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_states.https.html b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_states.https.html index 06bc6798839..1872cf527b8 100644 --- a/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_states.https.html +++ b/tests/wpt/web-platform-tests/webxr/anchors/ar_anchor_states.https.html @@ -30,7 +30,7 @@ const testFunctionGenerator = function(expectSucceeded, endSession, expectedErro const testFunction = function(session, fakeDeviceController, t) { - let debug = xr_debug.bind(this, 'testAnchorStates'); + const debug = xr_debug.bind(this, 'testAnchorStates'); fakeDeviceController.setAnchorCreationCallback((parameters, controller) => { // All anchor creation requests that reach this stage should be marked as successful. @@ -39,9 +39,9 @@ const testFunctionGenerator = function(expectSucceeded, endSession, expectedErro return Promise.resolve(true); }); - let watcherDone = new Event("watcherdone"); - let eventWatcher = new EventWatcher(t, session, ["watcherdone"]); - let eventPromise = eventWatcher.wait_for(["watcherdone"]); + const watcherDone = new Event("watcherdone"); + const eventWatcher = new EventWatcher(t, session, ["watcherdone"]); + const eventPromise = eventWatcher.wait_for(["watcherdone"]); session.requestReferenceSpace('local').then((localRefSpace) => { diff --git a/tests/wpt/web-platform-tests/webxr/resources/webxr_util.js b/tests/wpt/web-platform-tests/webxr/resources/webxr_util.js index 81dc3d620aa..a987ca1f442 100644 --- a/tests/wpt/web-platform-tests/webxr/resources/webxr_util.js +++ b/tests/wpt/web-platform-tests/webxr/resources/webxr_util.js @@ -1,3 +1,5 @@ +'use strict'; + // These tests rely on the User Agent providing an implementation of the // WebXR Testing API (https://github.com/immersive-web/webxr-test-api). // @@ -9,22 +11,34 @@ // Debugging message helper, by default does nothing. Implementations can // override this. -var xr_debug = function(name, msg) {} -var isChromiumBased = 'MojoInterfaceInterceptor' in self; -var isWebKitBased = 'internals' in self && 'xrTest' in internals; +var xr_debug = function(name, msg) {}; function xr_promise_test(name, func, properties) { promise_test(async (t) => { // Perform any required test setup: xr_debug(name, 'setup'); + // Only set up once. if (!navigator.xr.test) { + // Load test-only API helpers. + const script = document.createElement('script'); + script.src = '/resources/test-only-api.js'; + script.async = false; + const p = new Promise((resolve, reject) => { + script.onload = () => { resolve(); }; + script.onerror = e => { reject(e); }; + }) + document.head.appendChild(script); + await p; + if (isChromiumBased) { // Chrome setup await loadChromiumResources(); } else if (isWebKitBased) { // WebKit setup await setupWebKitWebXRTestAPI(); + } else { + assert_implements(false, "missing navigator.xr.test"); } } @@ -185,19 +199,27 @@ function forEachWebxrObject(callback) { } // Code for loading test API in Chromium. -function loadChromiumResources() { +async function loadChromiumResources() { let chromiumResources = [ - '/gen/layout_test_data/mojo/public/js/mojo_bindings.js', '/gen/mojo/public/mojom/base/time.mojom.js', - '/gen/gpu/ipc/common/mailbox_holder.mojom.js', + '/gen/mojo/public/mojom/base/shared_memory.mojom.js', + '/gen/mojo/public/mojom/base/unguessable_token.mojom.js', '/gen/gpu/ipc/common/sync_token.mojom.js', - '/gen/ui/display/mojom/display.mojom.js', + '/gen/gpu/ipc/common/mailbox.mojom.js', + '/gen/gpu/ipc/common/mailbox_holder.mojom.js', '/gen/ui/gfx/geometry/mojom/geometry.mojom.js', + '/gen/ui/gfx/mojom/native_handle_types.mojom.js', + '/gen/ui/gfx/mojom/buffer_types.mojom.js', + '/gen/ui/gfx/mojom/color_space.mojom.js', + '/gen/ui/gfx/mojom/display_color_spaces.mojom.js', '/gen/ui/gfx/mojom/gpu_fence_handle.mojom.js', '/gen/ui/gfx/mojom/transform.mojom.js', + '/gen/ui/display/mojom/display.mojom.js', + '/gen/device/gamepad/public/mojom/gamepad.mojom.js', '/gen/device/vr/public/mojom/vr_service.mojom.js', '/resources/chromium/webxr-test-math-helper.js', '/resources/chromium/webxr-test.js', + // Required only by resources/chromium/webxr-test.js '/resources/testdriver.js', '/resources/testdriver-vendor.js', ]; @@ -210,22 +232,9 @@ function loadChromiumResources() { chromiumResources = chromiumResources.concat(additionalChromiumResources); } - let chain = Promise.resolve(); - chromiumResources.forEach(path => { - let script = document.createElement('script'); - script.src = path; - script.async = false; - chain = chain.then(() => new Promise(resolve => { - script.onload = () => resolve(); - })); - document.head.appendChild(script); - }); + await loadMojoResources(chromiumResources); - chain = chain.then(() => { - xr_debug = navigator.xr.test.Debug; - }); - - return chain; + xr_debug = navigator.xr.test.Debug; } function setupWebKitWebXRTestAPI() { diff --git a/tests/wpt/web-platform-tests/webxr/xrInputSourceArray_iterable.html b/tests/wpt/web-platform-tests/webxr/xrInputSourceArray_iterable.html deleted file mode 100644 index de784d5d1a6..00000000000 --- a/tests/wpt/web-platform-tests/webxr/xrInputSourceArray_iterable.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - diff --git a/tests/wpt/web-platform-tests/wpt b/tests/wpt/web-platform-tests/wpt index 9930d77d0c9..329ea66852c 100755 --- a/tests/wpt/web-platform-tests/wpt +++ b/tests/wpt/web-platform-tests/wpt @@ -10,7 +10,7 @@ if __name__ == "__main__": if (args.py3 or py3only) and sys.version_info.major < 3: from subprocess import call try: - sys.exit(call(['python3', sys.argv[0]] + [args.command] + extra)) + sys.exit(call(['python3'] + sys.argv)) except OSError as e: if e.errno == 2: sys.stderr.write("python3 is needed to run this command\n")