addIframe-srcdoc-startOn.window.js (750B)
1 // META: title=RemoteContextWrapper addIframe with srcdoc and startOn 2 // META: script=/common/dispatcher/dispatcher.js 3 // META: script=/common/get-host-info.sub.js 4 // META: script=/common/utils.js 5 // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js 6 // META: script=./resources/test-helper.js 7 8 'use strict'; 9 10 promise_test(async t => { 11 const rcHelper = new RemoteContextHelper(); 12 13 const main = await rcHelper.addWindow(); 14 15 const iframe = await main.addIframeSrcdoc( 16 /*extraConfig=*/ {startOn: 'pageshow'}); 17 18 await assertSimplestScriptRuns(iframe); 19 await assert_equals( 20 await iframe.executeScript(() => { 21 return executorStartEvent.type; 22 }), 23 'pageshow'); 24 });