file_bug1224790-2_nonmodal.xhtml (1246B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?> 3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?> 4 <!-- 5 https://bugzilla.mozilla.org/show_bug.cgi?id=1224790 6 --> 7 <window title="Mozilla Bug 1224790" 8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> 10 11 <!-- test results are displayed in the html:body --> 12 <body xmlns="http://www.w3.org/1999/xhtml"> 13 </body> 14 15 <!-- test code goes here --> 16 <script type="application/javascript"> 17 <![CDATA[ 18 /** Test for Bug 1224790 */ 19 20 function runTests() { 21 opener.wrappedJSObject.nonModalOpened() 22 } 23 24 function modalClosed(grandparent) { 25 // Request cycle collection to trigger destructor for parent modal window, 26 // that mutates mAncestorLink of this window. 27 var windowUtils = window.windowUtils; 28 29 Services.obs.notifyObservers(null, "child-cc-request"); 30 windowUtils.cycleCollect(); 31 32 // Wait for a while. 33 setTimeout(function() { 34 window.close(); 35 grandparent.wrappedJSObject.nonModalClosed(); 36 }, 3000); 37 } 38 39 SimpleTest.waitForFocus(runTests); 40 ]]> 41 </script> 42 </window>