noopener-noreferrer-sizing.window.js (667B)
1 const windowProps = ["innerWidth", "innerHeight"]; 2 3 ["noopener", "noreferrer"].forEach(openerStyle => { 4 async_test(t => { 5 const channelName = "34342" + openerStyle + "8907"; 6 const channel = new BroadcastChannel(channelName); 7 window.open("support/sizing-target.html?" + channelName, "", openerStyle); 8 channel.onmessage = t.step_func_done(e => { 9 // Send message first so if asserts throw the popup is still closed 10 channel.postMessage(null); 11 12 for(const prop of windowProps) { 13 assert_equals(window[prop], e.data[prop]); 14 } 15 }); 16 }, `window.open() with ${openerStyle} should have equal viewport width and height`); 17 });