test_bug1686822.xhtml (1114B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> 3 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> 4 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 5 <html:script><![CDATA[ 6 SimpleTest.waitForExplicitFinish(); 7 let chromeWindow = browsingContext.topChromeWindow; 8 9 let resolve; 10 let i = 0; 11 chromeWindow.moduleScriptRan = function() { 12 ok(true, "Module script executed: " + ++i) 13 resolve(); 14 resolve = null; 15 } 16 17 function testOnce() { 18 let currentWin; 19 return new Promise(r => { 20 currentWin = chromeWindow.open("window_bug1686822.xhtml", "", "chrome"); 21 resolve = r; 22 }).then(function() { 23 currentWin.close(); 24 }); 25 } 26 27 (async function() { 28 // The first and second loads are different so make sure we test both code paths. 29 await testOnce(); 30 await testOnce(); 31 delete chromeWindow.moduleScriptRan; 32 SimpleTest.finish(); 33 }()); 34 ]]></html:script> 35 </window>