Bug 592402, see if using waitForFocus helps this test, a=testfixonly
authorNeil Deakin <neil@mozilla.com>
Thu, 09 Dec 2010 09:18:32 -0500
changeset 58971 36d993e971587bba6fae79ce14e985c98d549afd
parent 58970 88c1ac7b4d13919347ba62c4ab2adff6bb2bf7f0
child 58972 22bb9d6626c55a06df98fc12e5617fb9f04b2d43
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewerstestfixonly
bugs592402
milestone2.0b8pre
Bug 592402, see if using waitForFocus helps this test, a=testfixonly
dom/tests/mochitest/general/test_offsets.xul
--- a/dom/tests/mochitest/general/test_offsets.xul
+++ b/dom/tests/mochitest/general/test_offsets.xul
@@ -1,16 +1,15 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
 <!--
   XUL Tests for client/scroll properties
   -->
 <window title="Test Offset/Client/Scroll Properties" width="500" height="600"
-        onload="setTimeout(testElements, 0, 'testelements', doneTests);"
         style="margin: 1px !important"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="text/javascript" src="/MochiKit/packed.js"/>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"/>
   <script type="text/javascript" src="test_offsets.js"/>
 
 <vbox id="testelements" style="margin: 0; padding: 0; border: 0;">
 <vbox id="vbox" style="margin: 5px 0 0 2px;">
@@ -63,28 +62,35 @@
   <script type="application/javascript"><![CDATA[
 
 var gTestSet = "box";
 
 var whichpopup = "outer";
 
 SimpleTest.waitForExplicitFinish();
 
+function startTests()
+{
+  testElements('testelements', doneTests);
+}
+
 function doneTests()
 {
   if (gTestSet == "box") {
     gTestSet = "popup";
     // only test this on Mac for now
     if (navigator.platform.indexOf("Mac") >= 0) {
       checkScrollState($("outerpopup"), 0, 0, 0, 0, "popup before open");
       checkClientState($("outerpopup"), 0, 0, 0, 0, "popup before open");
     }
     $("outermenu").open = true;
   }
   else {
     $("outermenu").open = false;
   }
 }
 
+SimpleTest.waitForFocus(startTests);
+
 ]]>
 </script>
 
 </window>