Diff
Modified: trunk/LayoutTests/TestExpectations (249122 => 249123)
--- trunk/LayoutTests/TestExpectations 2019-08-26 23:01:47 UTC (rev 249122)
+++ trunk/LayoutTests/TestExpectations 2019-08-26 23:20:45 UTC (rev 249123)
@@ -239,6 +239,10 @@
imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.html [ Skip ]
imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/tasks.window.html [ Skip ]
+# Requires BroadcastChannel.
+imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.html [ Skip ]
+imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.html [ Skip ]
+
# Requires additional test infrastructure.
imported/w3c/web-platform-tests/service-workers/service-worker/update-after-oneday.https.html [ Skip ]
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (249122 => 249123)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2019-08-26 23:01:47 UTC (rev 249122)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2019-08-26 23:20:45 UTC (rev 249123)
@@ -1,3 +1,15 @@
+2019-08-26 Chris Dumez <[email protected]>
+
+ Resync web-platform-tests/html/browsers/the-window-object from upstream
+ https://bugs.webkit.org/show_bug.cgi?id=201145
+
+ Reviewed by Youenn Fablet.
+
+ Resync web-platform-tests/html/browsers/the-window-object from upstream 552bd3bf8bc1be.
+
+ * resources/resource-files.json:
+ * web-platform-tests/html/browsers/the-window-object/*:
+
2019-08-26 Youenn Fablet <[email protected]>
Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
Modified: trunk/LayoutTests/imported/w3c/resources/resource-files.json (249122 => 249123)
--- trunk/LayoutTests/imported/w3c/resources/resource-files.json 2019-08-26 23:01:47 UTC (rev 249122)
+++ trunk/LayoutTests/imported/w3c/resources/resource-files.json 2019-08-26 23:20:45 UTC (rev 249123)
@@ -989,7 +989,11 @@
"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html",
"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html",
"web-platform-tests/html/browsers/the-window-object/named-access-on-the-window-object/test.html",
+ "web-platform-tests/html/browsers/the-window-object/support/BarProp-target.html",
+ "web-platform-tests/html/browsers/the-window-object/support/closed.html",
"web-platform-tests/html/browsers/the-window-object/support/noopener-target.html",
+ "web-platform-tests/html/browsers/the-window-object/support/noreferrer-target.html",
+ "web-platform-tests/html/browsers/the-window-object/support/sizing-target.html",
"web-platform-tests/html/browsers/windows/browsing-context-names/001-1.html",
"web-platform-tests/html/browsers/windows/browsing-context-names/002-1.html",
"web-platform-tests/html/browsers/windows/browsing-context-names/existing.html",
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/closed-attribute.window-expected.txt (249122 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/closed-attribute.window-expected.txt 2019-08-26 23:01:47 UTC (rev 249122)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/closed-attribute.window-expected.txt 2019-08-26 23:20:45 UTC (rev 249123)
@@ -1,10 +1,8 @@
-Harness Error (TIMEOUT), message = null
-
PASS closed and same-origin nested browsing context
PASS closed/close() and same-origin auxiliary browsing context
-TIMEOUT closed and cross-origin nested browsing context Test timed out
-TIMEOUT closed/close() and cross-origin auxiliary browsing context Test timed out
-TIMEOUT closed and cross-site nested browsing context Test timed out
-TIMEOUT closed/close() and cross-site auxiliary browsing context Test timed out
+PASS closed and cross-origin nested browsing context
+PASS closed/close() and cross-origin auxiliary browsing context
+PASS closed and cross-site nested browsing context
+PASS closed/close() and cross-site auxiliary browsing context
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window-expected.txt (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window-expected.txt 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,5 @@
+
+PASS All bars visible
+FAIL window.open() with noopener should have all bars visible Can't find variable: BroadcastChannel
+FAIL window.open() with noreferrer should have all bars visible Can't find variable: BroadcastChannel
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.html (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.html 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,23 @@
+const barProps = ["locationbar", "menubar", "personalbar", "scrollbars", "statusbar", "toolbar"];
+
+test(() => {
+ for(const prop of barProps) {
+ assert_true(window[prop].visible);
+ }
+}, "All bars visible");
+
+["noopener", "noreferrer"].forEach(openerStyle => {
+ async_test(t => {
+ const channelName = "5454" + openerStyle + "34324";
+ const channel = new BroadcastChannel(channelName);
+ window.open("support/BarProp-target.html?" + channelName, "", openerStyle);
+ channel._onmessage_ = t.step_func_done(e => {
+ // Send message first so if asserts throw the popup is still closed
+ channel.postMessage(null);
+
+ for(const prop of barProps) {
+ assert_true(e.data[prop]);
+ }
+ });
+ }, `window.open() with ${openerStyle} should have all bars visible`);
+});
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window-expected.txt (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window-expected.txt 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,4 @@
+
+FAIL window.open() with noopener should have equal viewport width and height Can't find variable: BroadcastChannel
+FAIL window.open() with noreferrer should have equal viewport width and height Can't find variable: BroadcastChannel
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.html (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.html 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,17 @@
+const windowProps = ["innerWidth", "innerHeight"];
+
+["noopener", "noreferrer"].forEach(openerStyle => {
+ async_test(t => {
+ const channelName = "34342" + openerStyle + "8907";
+ const channel = new BroadcastChannel(channelName);
+ window.open("support/sizing-target.html?" + channelName, "", openerStyle);
+ channel._onmessage_ = t.step_func_done(e => {
+ // Send message first so if asserts throw the popup is still closed
+ channel.postMessage(null);
+
+ for(const prop of windowProps) {
+ assert_equals(window[prop], e.data[prop]);
+ }
+ });
+ }, `window.open() with ${openerStyle} should have equal viewport width and height`);
+});
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/BarProp-target.html (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/BarProp-target.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/BarProp-target.html 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script>
+ const barProps = ["locationbar", "menubar", "personalbar", "scrollbars", "statusbar", "toolbar"];
+ const barPropsObj = {};
+ const channelName = location.search.substr(1);
+ const channel = new BroadcastChannel(channelName);
+ for (const prop of barProps) {
+ barPropsObj[prop] = window[prop].visible;
+ }
+ channel.postMessage(barPropsObj);
+
+ // Because messages are not delivered synchronously and because closing a
+ // browsing context prompts the eventual clearing of all task sources, this
+ // document should not be closed until the opener document has confirmed
+ // receipt.
+ channel._onmessage_ = () => { window.close() };
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/closed.html (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/closed.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/closed.html 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<!--
+ There's two URL parameters supported here:
+
+ window: The property name of a getter on the global object that returns the relevant WindowProxy
+ object to message.
+ ident: A reasonably unique identifier that will be echoed as the message.
+-->
+<script>
+ const params = new URLSearchParams(location.search);
+ self[params.get("window")].postMessage(params.get("ident"), "*");
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/noreferrer-target.html (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/noreferrer-target.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/noreferrer-target.html 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,13 @@
+<script>
+ const channelName = location.search.substr(1),
+ channel = new BroadcastChannel(channelName);
+ channel.postMessage({ name: window.name,
+ haveOpener: window.opener !== null,
+ referrer: document.referrer });
+
+ // Because messages are not delivered synchronously and because closing a
+ // browsing context prompts the eventual clearing of all task sources, this
+ // document should not be closed until the opener document has confirmed
+ // receipt.
+ channel._onmessage_ = () => window.close();
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/sizing-target.html (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/sizing-target.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/sizing-target.html 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script>
+ const windowProps = ["innerWidth", "innerHeight"];
+ const windowPropsObj = {};
+ const channelName = location.search.substr(1);
+ const channel = new BroadcastChannel(channelName);
+ for (const prop of windowProps) {
+ windowPropsObj[prop] = window[prop];
+ }
+ channel.postMessage(windowPropsObj);
+
+ // Because messages are not delivered synchronously and because closing a
+ // browsing context prompts the eventual clearing of all task sources, this
+ // document should not be closed until the opener document has confirmed
+ // receipt.
+ channel._onmessage_ = () => { window.close() };
+</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/w3c-import.log (249122 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/w3c-import.log 2019-08-26 23:01:47 UTC (rev 249122)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/w3c-import.log 2019-08-26 23:20:45 UTC (rev 249123)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
@@ -14,4 +14,8 @@
None
------------------------------------------------------------------------
List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/BarProp-target.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/closed.html
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/noopener-target.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/noreferrer-target.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/sizing-target.html
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/w3c-import.log (249122 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/w3c-import.log 2019-08-26 23:01:47 UTC (rev 249122)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/w3c-import.log 2019-08-26 23:20:45 UTC (rev 249123)
@@ -24,10 +24,13 @@
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/historical.window.js
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/length-attribute.window.js
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/name-attribute.window.js
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/self-et-al.window.js
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-aliases.html
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict.html
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window.js
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noopener.html
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noreferrer.html
/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-properties.https.html
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window-expected.txt (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window-expected.txt 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,3 @@
+
+FAIL window.open()'s url parameter default assert_unreached: Reached unreachable code
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window.html (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window.html 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window.js (0 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-defaults.window.js 2019-08-26 23:20:45 UTC (rev 249123)
@@ -0,0 +1,12 @@
+async_test(t => {
+ const frame = document.createElement("iframe");
+ t.add_cleanup(() => frame.remove());
+ frame.name = "foo";
+ frame.src = ""
+ frame._onload_ = t.step_func(() => {
+ frame._onload_ = t.unreached_func();
+ t.step_timeout(() => t.done(), 500);
+ assert_equals(window[0], window.open(undefined, "foo"));
+ });
+ document.body.append(frame);
+}, "window.open()'s url parameter default");
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noopener-expected.txt (249122 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noopener-expected.txt 2019-08-26 23:01:47 UTC (rev 249122)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noopener-expected.txt 2019-08-26 23:20:45 UTC (rev 249123)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 117: testError: special target must be one of: _self, _parent, _top
+CONSOLE MESSAGE: line 120: testError: special target must be one of: _self, _parent, _top
FAIL window.open() with "noopener" tests testError: special target must be one of: _self, _parent, _top
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noopener.html (249122 => 249123)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noopener.html 2019-08-26 23:01:47 UTC (rev 249122)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noopener.html 2019-08-26 23:20:45 UTC (rev 249123)
@@ -12,27 +12,30 @@
<script src=""
<script>
var testData = [
- { testDescription: "window.open() with 'noopener' should not reuse existing target",
+ { testDescription: "window.open() with 'noopener' should reuse existing target",
secondWindowFeatureString: "noopener",
- shouldReuse: false },
+ shouldReturnWindow: false },
{ testDescription: "noopener=1 means the same as noopener",
secondWindowFeatureString: "noopener=1",
- shouldReuse: false },
+ shouldReturnWindow: false },
{ testDescription: "noopener=0 means lack of noopener",
secondWindowFeatureString: "noopener=0",
- shouldReuse: true },
- { testDescription: "noopener needs to be present as a token on its own",
+ shouldReturnWindow: true },
+ { testDescription: "noopener separated only by spaces should work",
secondWindowFeatureString: "make me noopener",
- shouldReuse: true },
+ shouldReturnWindow: false },
{ testDescription: "Trailing noopener should work",
secondWindowFeatureString: "abc def, \n\r noopener",
- shouldReuse: false },
+ shouldReturnWindow: false },
{ testDescription: "Leading noopener should work",
secondWindowFeatureString: "noopener \f\t , hey, there",
- shouldReuse: false },
+ shouldReturnWindow: false },
{ testDescription: "Interior noopener should work",
secondWindowFeatureString: "and now, noopener , hey, there",
- shouldReuse: false },
+ shouldReturnWindow: false },
+ { testDescription: "noreferrer should also suppress opener when reusing existing target",
+ secondWindowFeatureString: "noreferrer",
+ shouldReturnWindow: false },
];
/**
@@ -54,7 +57,7 @@
t.secondWindowFeatureString = test.secondWindowFeatureString;
t.windowName = "someuniquename" + i;
- if (test.shouldReuse) {
+ if (test.shouldReturnWindow) {
t.step(function() {
var windowName = this.windowName;
@@ -83,9 +86,9 @@
channel._onmessage_ = this.step_func_done(function(e) {
var data = ""
assert_equals(data.name, windowName, "Should have the right name");
- assert_equals(data.haveOpener, false, "Should not have opener");
+ assert_equals(data.haveOpener, true, "Should still have opener");
assert_equals(w1.opener, window);
- assert_equals(w1.location.href, "about:blank");
+ assert_not_equals(w1.location.href, "about:blank", "Should have navigated");
});
w1 = window.open("", windowName);