diff --git a/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini b/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini index c8f51681ec5..d1bed36295e 100644 --- a/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini +++ b/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini @@ -9,3 +9,9 @@ [Fetching a blob URL immediately before revoking it works in '; + const blob = new Blob([blob_contents], {type: 'text/html'}); + const url = URL.createObjectURL(blob); + const win = window.open(url); + URL.revokeObjectURL(url); + add_completion_callback(() => { win.close(); }); + + win.onload = t.step_func_done(() => { + assert_equals(win.test_result, run_result); + }); +}, 'Opening a blob URL in a new window immediately before revoking it works.'); + +function receive_message_on_channel(t, channel_name) { + const channel = new BroadcastChannel(channel_name); + return new Promise(resolve => { + channel.addEventListener('message', t.step_func(e => { + resolve(e.data); + })); + }); +} + +function window_contents_for_channel(channel_name) { + return '\n' + + ''; +} + +async_test(t => { + const channel_name = 'noopener-window-test'; + const blob = new Blob([window_contents_for_channel(channel_name)], {type: 'text/html'}); + receive_message_on_channel(t, channel_name).then(t.step_func_done(t => { + assert_equals(t, 'foobar'); + })); + const url = URL.createObjectURL(blob); + const win = window.open(); + win.opener = null; + win.location = url; + URL.revokeObjectURL(url); +}, 'Opening a blob URL in a noopener about:blank window immediately before revoking it works.'); + async_test(t => { const run_result = 'test_script_OK'; const blob_contents = 'window.script_test_result = "' + run_result + '";'; diff --git a/tests/wpt/web-platform-tests/FileAPI/url/url-reload.window.js b/tests/wpt/web-platform-tests/FileAPI/url/url-reload.window.js new file mode 100644 index 00000000000..d333b3a74aa --- /dev/null +++ b/tests/wpt/web-platform-tests/FileAPI/url/url-reload.window.js @@ -0,0 +1,36 @@ +function blob_url_reload_test(t, revoke_before_reload) { + const run_result = 'test_frame_OK'; + const blob_contents = '\n\n' + + ''; + const blob = new Blob([blob_contents], {type: 'text/html'}); + const url = URL.createObjectURL(blob); + + const frame = document.createElement('iframe'); + frame.setAttribute('src', url); + frame.setAttribute('style', 'display:none;'); + document.body.appendChild(frame); + + frame.onload = t.step_func(() => { + if (revoke_before_reload) + URL.revokeObjectURL(url); + assert_equals(frame.contentWindow.test_result, run_result); + frame.contentWindow.test_result = null; + frame.onload = t.step_func_done(() => { + assert_equals(frame.contentWindow.test_result, run_result); + }); + // Slight delay before reloading to ensure revoke actually has had a chance + // to be processed. + t.step_timeout(() => { + frame.contentWindow.location.reload(); + }, 250); + }); +} + +async_test(t => { + blob_url_reload_test(t, false); +}, 'Reloading a blob URL succeeds.'); + + +async_test(t => { + blob_url_reload_test(t, true); +}, 'Reloading a blob URL succeeds even if the URL was revoked.'); diff --git a/tests/wpt/web-platform-tests/README.md b/tests/wpt/web-platform-tests/README.md index a942745c7b0..84cd627eafd 100644 --- a/tests/wpt/web-platform-tests/README.md +++ b/tests/wpt/web-platform-tests/README.md @@ -15,7 +15,7 @@ editors and implementors. Setting Up the Repo =================== -Clone or otherwise get https://github.com/w3c/web-platform-tests. +Clone or otherwise get https://github.com/web-platform-tests/wpt. Note: because of the frequent creation and deletion of branches in this repo, it is recommended to "prune" stale branches when fetching updates, @@ -356,7 +356,7 @@ Issues with web-platform-tests If you spot an issue with a test and are not comfortable providing a pull request per above to fix it, please -[file a new issue](https://github.com/w3c/web-platform-tests/issues/new). +[file a new issue](https://github.com/web-platform-tests/wpt/issues/new). Thank you! Lint tool @@ -432,11 +432,11 @@ upstream review. Search filters to find things to review: -* [Open PRs (excluding vendor exports)](https://github.com/w3c/web-platform-tests/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22) -* [Reviewed but still open PRs (excluding vendor exports)](https://github.com/w3c/web-platform-tests/pulls?q=is%3Apr+is%3Aopen+-label%3Amozilla%3Agecko-sync+-label%3Achromium-export+-label%3Awebkit-export+-label%3Aservo-export+review%3Aapproved) (Merge? Something left to fix? Ping other reviewer?) -* [Open PRs without owners](https://github.com/w3c/web-platform-tests/pulls?q=is%3Apr+is%3Aopen+label%3Astatus%3Aneeds-owners) -* [Open PRs with label `infra` (excluding vendor exports)](https://github.com/w3c/web-platform-tests/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Ainfra+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22) -* [Open PRs with label `docs` (excluding vendor exports)](https://github.com/w3c/web-platform-tests/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Adocs+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22) +* [Open PRs (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22) +* [Reviewed but still open PRs (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?q=is%3Apr+is%3Aopen+-label%3Amozilla%3Agecko-sync+-label%3Achromium-export+-label%3Awebkit-export+-label%3Aservo-export+review%3Aapproved) (Merge? Something left to fix? Ping other reviewer?) +* [Open PRs without owners](https://github.com/web-platform-tests/wpt/pulls?q=is%3Apr+is%3Aopen+label%3Astatus%3Aneeds-owners) +* [Open PRs with label `infra` (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Ainfra+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22) +* [Open PRs with label `docs` (excluding vendor exports)](https://github.com/web-platform-tests/wpt/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Adocs+-label%3A%22mozilla%3Agecko-sync%22+-label%3A%22chromium-export%22+-label%3A%22webkit-export%22+-label%3A%22servo-export%22) Getting Involved ================ @@ -449,7 +449,7 @@ The mailing list is [archived][mailarchive]. Join us on irc #testing ([irc.w3.org][ircw3org], port 6665). The channel is [archived][ircarchive]. -[contributing]: https://github.com/w3c/web-platform-tests/blob/master/CONTRIBUTING.md +[contributing]: https://github.com/web-platform-tests/wpt/blob/master/CONTRIBUTING.md [ircw3org]: https://www.w3.org/wiki/IRC [ircarchive]: https://w3.logbot.info/testing [mailarchive]: https://lists.w3.org/Archives/Public/public-test-infra/ diff --git a/tests/wpt/web-platform-tests/annotation-model/CONTRIBUTING.md b/tests/wpt/web-platform-tests/annotation-model/CONTRIBUTING.md index f591d2a9702..45a338f3a45 100644 --- a/tests/wpt/web-platform-tests/annotation-model/CONTRIBUTING.md +++ b/tests/wpt/web-platform-tests/annotation-model/CONTRIBUTING.md @@ -52,7 +52,7 @@ Context](JSONtest-v1.jsonld). That context defines the following terms: |name | string | The name of this test for display purposes |description | string | A long self-describing paragraph that explains the purpose of the test and the expected input |ref | URI | An optional reference to the portion of the specification to which the test relates -|testType | `automated`, `manual`, `ref` | The type of test - this informs [WPT](https://github.com/w3c/web-platform-tests) how the test should be controlled and presented +|testType | `automated`, `manual`, `ref` | The type of test - this informs [WPT](https://github.com/web-platform-tests/wpt) how the test should be controlled and presented |skipFailures | list of strings | An optional list of assertionType values that, if present, should have their test skipped if the result would be "unexpected". Defaults to the empty list. |assertions | list of URI, List @@@ATRISK@@@, or AssertionObject | The ordered collection of tests the input should be run against. See [JSON Schema Usage](#jsonSchema) for the structure of the objects. URI is relative to the top level folder of the test collection if it has a slash; relative to the current directory if it does not. @@@@ATRISK@@@@ Lists can be nested to define groups of sub-tests. Assertions / groups can be conditionally skipped. See [Assertion Lists](#assertionLists) for more details. |content | URI or object | An object containing content to be checked against the referenced assertions, or a URI from which to retrieve that content diff --git a/tests/wpt/web-platform-tests/conformance-checkers/tools/url.py b/tests/wpt/web-platform-tests/conformance-checkers/tools/url.py index df31eab22af..af89c80f994 100644 --- a/tests/wpt/web-platform-tests/conformance-checkers/tools/url.py +++ b/tests/wpt/web-platform-tests/conformance-checkers/tools/url.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import os ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -# based on https://github.com/w3c/web-platform-tests/blob/275544eab54a0d0c7f74ccc2baae9711293d8908/url/urltestdata.txt +# based on https://github.com/web-platform-tests/wpt/blob/275544eab54a0d0c7f74ccc2baae9711293d8908/url/urltestdata.txt invalid = { "scheme-trailing-space": "a: foo.com", "scheme-trailing-tab": "a:\tfoo.com", diff --git a/tests/wpt/web-platform-tests/content-security-policy/README.html b/tests/wpt/web-platform-tests/content-security-policy/README.html index e2c3e38c6b4..becc48b65ac 100644 --- a/tests/wpt/web-platform-tests/content-security-policy/README.html +++ b/tests/wpt/web-platform-tests/content-security-policy/README.html @@ -14,7 +14,7 @@
The CSP test suite uses the standard W3C testharness.js framework, but there are a few additional things you'll need to do because of the unique way CSP works, even if you're already an expert at writing W3C tests. These tests require the use of the - wptserve server (included in the web-platform-tests repository) to operate correctly.
+ wptserve server (included in the web-platform-tests repository) to operate correctly.-
-
-
+
block-size
< min-block-size
min-block-size
< block-size
≤ max-block-size
block-size
> max-block-size
width
and block-size
in vertical-lrCheck that width
overrides block-size
Check that block-size
overrides width
block-size
< min-block-size
min-block-size
< block-size
≤ max-block-size
block-size
> max-block-size
+
block-size
< min-block-size
min-block-size
< block-size
≤ max-block-size
block-size
> max-block-size
height
and block-size
Check that height
overrides block-size
Check that block-size
overrides height
block-size
< min-block-size
min-block-size
< block-size
≤ max-block-size
block-size
> max-block-size
+
inline-size
< min-inline-size
min-inline-size
< inline-size
≤ max-inline-size
inline-size
> max-inline-size
height
and inline-size
in vertical-lrCheck that height
overrides inline-size
Check that inline-size
overrides height
inline-size
< min-inline-size
min-inline-size
< inline-size
≤ max-inline-size
inline-size
> max-inline-size
+
inline-size
< min-inline-size
min-inline-size
< inline-size
≤ max-inline-size
inline-size
> max-inline-size
width
and inline-size
Check that width
overrides inline-size
Check that inline-size
overrides width
inline-size
< min-inline-size
min-inline-size
< inline-size
≤ max-inline-size
inline-size
> max-inline-size
diff --git a/tests/wpt/web-platform-tests/css/css-scoping/resources/host-green-box.css b/tests/wpt/web-platform-tests/css/css-scoping/resources/host-green-box.css new file mode 100644 index 00000000000..a77b3fdc643 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-scoping/resources/host-green-box.css @@ -0,0 +1,5 @@ +:host { + background: green; + width: 100px; + height: 100px; +} diff --git a/tests/wpt/web-platform-tests/css/css-scoping/shadow-at-import.html b/tests/wpt/web-platform-tests/css/css-scoping/shadow-at-import.html new file mode 100644 index 00000000000..1adf516311f --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-scoping/shadow-at-import.html @@ -0,0 +1,13 @@ + +
Test passes if you see a single 100px by 100px green box below.
+Test passes if the scrollbars in the following box are NOT styled:
+Test passes if the scrollbars in the following box are NOT styled:
+ diff --git a/tests/wpt/web-platform-tests/css/css-scrollbars/viewport-scrollbar-ref.html b/tests/wpt/web-platform-tests/css/css-scrollbars/viewport-scrollbar-ref.html new file mode 100644 index 00000000000..42463d309b9 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-scrollbars/viewport-scrollbar-ref.html @@ -0,0 +1,23 @@ + + +Test passes if the scrollbars in the following box are styled:
+Test passes if the scrollbars in the following box are styled:
+ diff --git a/tests/wpt/web-platform-tests/css/css-shadow-parts/invalidation-change-part-name.html b/tests/wpt/web-platform-tests/css/css-shadow-parts/invalidation-change-part-name.html new file mode 100644 index 00000000000..7e7a310f6b0 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-shadow-parts/invalidation-change-part-name.html @@ -0,0 +1,32 @@ + + + +There should be a green 200x200 rectangle below, and no red.
+ + diff --git a/tests/wpt/web-platform-tests/css/css-writing-modes/test-plan/index.html b/tests/wpt/web-platform-tests/css/css-writing-modes/test-plan/index.html index 95c7cf10a51..926b62e9970 100644 --- a/tests/wpt/web-platform-tests/css/css-writing-modes/test-plan/index.html +++ b/tests/wpt/web-platform-tests/css/css-writing-modes/test-plan/index.html @@ -298,7 +298,7 @@ table.simple {diff --git a/tests/wpt/web-platform-tests/css/cssom-view/scrollIntoView-smooth.html b/tests/wpt/web-platform-tests/css/cssom-view/scrollIntoView-smooth.html index 8799b8bd7a7..70343cb4253 100644 --- a/tests/wpt/web-platform-tests/css/cssom-view/scrollIntoView-smooth.html +++ b/tests/wpt/web-platform-tests/css/cssom-view/scrollIntoView-smooth.html @@ -45,13 +45,13 @@ promise_test(t => { window.scrollTo(0, 0); var expected_x = content.offsetLeft + content_width - window_width; var expected_y = content.offsetTop + content_height - window_height; - assert_not_equals(window.scrollX, expected_x); - assert_not_equals(window.scrollY, expected_y); + assert_not_equals(window.scrollX, expected_x, "scrollX"); + assert_not_equals(window.scrollY, expected_y, "scrollY"); content.scrollIntoView({behavior: "smooth", block: "nearest", inline: "nearest"}); return waitForScrollEnd().then(() => { - assert_approx_equals(window.scrollX, expected_x, 1); - assert_approx_equals(window.scrollY, expected_y, 1); + assert_approx_equals(window.scrollX, expected_x, 1, "scrollX"); + assert_approx_equals(window.scrollY, expected_y, 1, "scrollY"); }); }, "Smooth scrollIntoView should scroll the element to the 'nearest' position"); @@ -59,13 +59,13 @@ promise_test(t => { window.scrollTo(0, 0); var expected_x = content.offsetLeft; var expected_y = content.offsetTop; - assert_not_equals(window.scrollX, expected_x); - assert_not_equals(window.scrollY, expected_y); + assert_not_equals(window.scrollX, expected_x, "scrollX"); + assert_not_equals(window.scrollY, expected_y, "scrollY"); content.scrollIntoView({behavior: "smooth", block: "start", inline: "start"}); return waitForScrollEnd().then(() => { - assert_approx_equals(window.scrollX, expected_x, 1); - assert_approx_equals(window.scrollY, expected_y, 1); + assert_approx_equals(window.scrollX, expected_x, 1, "scrollX"); + assert_approx_equals(window.scrollY, expected_y, 1, "scrollY"); }); }, "Smooth scrollIntoView should scroll the element to the 'start' position"); @@ -73,13 +73,13 @@ promise_test(t => { window.scrollTo(0, 0); var expected_x = content.offsetLeft + (content_width - window_width) / 2; var expected_y = content.offsetTop + (content_height - window_height) / 2; - assert_not_equals(window.scrollX, expected_x); - assert_not_equals(window.scrollY, expected_y); + assert_not_equals(window.scrollX, expected_x, "scrollX"); + assert_not_equals(window.scrollY, expected_y, "scrollY"); content.scrollIntoView({behavior: "smooth", block: "center", inline: "center"}); return waitForScrollEnd().then(() => { - assert_approx_equals(window.scrollX, expected_x, 1); - assert_approx_equals(window.scrollY, expected_y, 1); + assert_approx_equals(window.scrollX, expected_x, 1, "scrollX"); + assert_approx_equals(window.scrollY, expected_y, 1, "scrollY"); }); }, "Smooth scrollIntoView should scroll the element to the 'center' position"); @@ -87,15 +87,15 @@ promise_test(t => { window.scrollTo(0, 0); var expected_x = content.offsetLeft + content_width - window_width; var expected_y = content.offsetTop + content_height - window_height; - assert_not_equals(window.scrollX, expected_x); - assert_not_equals(window.scrollY, expected_y); + assert_not_equals(window.scrollX, expected_x, "scrollX"); + assert_not_equals(window.scrollY, expected_y, "scrollY"); content.scrollIntoView({behavior: "smooth", block: "end", inline: "end"}); return waitForScrollEnd().then(() => { - assert_approx_equals(window.scrollX, expected_x, 1); - assert_approx_equals(window.scrollY, expected_y, 1); + assert_approx_equals(window.scrollX, expected_x, 1, "scrollX"); + assert_approx_equals(window.scrollY, expected_y, 1, "scrollY"); }); }, "Smooth scrollIntoView should scroll the element to the 'end' position"); }); - \ No newline at end of file + diff --git a/tests/wpt/web-platform-tests/css/cssom/at-namespace.html b/tests/wpt/web-platform-tests/css/cssom/at-namespace.html new file mode 100644 index 00000000000..04a8a2289aa --- /dev/null +++ b/tests/wpt/web-platform-tests/css/cssom/at-namespace.html @@ -0,0 +1,29 @@ + +