From 9db88469416440e6008c7c2c1dea04d1f17c0593 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 17 May 2019 14:40:18 +0000 Subject: [PATCH] Bug 1550197 [wpt PR 16330] - HTML: ensure BarProps are visible for noopener/noreferrer, a=testonly Automatic update from web-platform-tests HTML: ensure BarProps are visible for noopener/noreferrer For https://github.com/whatwg/html/pull/3297. -- wpt-commits: ce675f004d08b1dfd7f4bbf3dbb422229addedac wpt-pr: 16330 --- .../noopener-noreferrer-BarProp.window.js | 23 +++++++++++++++++++ .../support/BarProp-target.html | 17 ++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html diff --git a/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js new file mode 100644 index 0000000000000..a75a0346501a8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js @@ -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`); +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html new file mode 100644 index 0000000000000..9921e7a5773db --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html @@ -0,0 +1,17 @@ + +