Bug 1882465 - Update .hg-annotate-ignore-revs and .git-blame-ignore-revs to reflect...
[gecko.git] / dom / xul / test / test_bug1686822.xhtml
blobcdad585d00360429c97c59e6ed5aa83d6bcfcd84
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;
9 let resolve;
10 let i = 0;
11 chromeWindow.moduleScriptRan = function() {
12 ok(true, "Module script executed: " + ++i)
13 resolve();
14 resolve = null;
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 });
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>