unload-disallowed-frameset.tentative.window.js (952B)
1 // META: title='unload' Policy : disallowed in frames when disallowed in main frame. 2 // META: script=/common/dispatcher/dispatcher.js 3 // META: script=/common/utils.js 4 // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 5 // META: script=./resources/unload-helper.js 6 // META: timeout=long 7 8 'use strict'; 9 10 promise_test(async t => { 11 const rcHelper = new RemoteContextHelper({ 12 scripts: ['./resources/unload-helper.js'], 13 }); 14 // In the same browsing context group to ensure BFCache is not used. 15 const main = await rcHelper.addWindow( 16 {headers: [['Permissions-Policy', 'unload=()']]}, 17 ); 18 19 const subframe = await main.addFrame( 20 /*extraConfig=*/ {headers: [['Permissions-Policy', 'unload=self']]}, 21 /*attributes=*/ {}); 22 await assertWindowRunsUnload(subframe, 'subframe', {shouldRunUnload: false}); 23 24 await assertWindowRunsUnload(main, 'main', {shouldRunUnload: false}); 25 });