diff --git a/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js b/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js new file mode 100644 index 00000000000000..cc53ba5f2f5941 --- /dev/null +++ b/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js @@ -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`); +}); diff --git a/html/browsers/the-window-object/support/sizing-target.html b/html/browsers/the-window-object/support/sizing-target.html new file mode 100644 index 00000000000000..7cd5348a858569 --- /dev/null +++ b/html/browsers/the-window-object/support/sizing-target.html @@ -0,0 +1,17 @@ + +