Bug 876096 - Add waitForFocus to fix test_activation.xul. a=test-only
authorMarkus Stange <mstange@themasta.com>
Thu, 22 Aug 2013 15:33:58 +0200
changeset 153861 4c6d2a6c4e818e9ef8203472916fd3d75f4a8443
parent 153860 3987a287ccc8fd886abe9abc5d1b8c82b91ba414
child 153862 34b2938a8dde62e519ea4117fd26665712fa91ff
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs876096
milestone25.0a2
Bug 876096 - Add waitForFocus to fix test_activation.xul. a=test-only
dom/tests/mochitest/chrome/window_activation.xul
--- a/dom/tests/mochitest/chrome/window_activation.xul
+++ b/dom/tests/mochitest/chrome/window_activation.xul
@@ -16,21 +16,22 @@
 
 <box id="box" height="100"/>
 
 <script type="application/javascript"><![CDATA[
 
 var ok = window.opener.wrappedJSObject.ok;
 var complete = window.opener.wrappedJSObject.complete;
 var openerDoc = window.opener.wrappedJSObject.document;
+var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
 
-window.onfocus = function () {
+SimpleTest.waitForFocus(function () {
   ok(getComputedStyle(document.getElementById("box"), "").backgroundColor, "rgb(0, 0, 255)");
   ok(getComputedStyle(openerDoc.getElementById("box"), "").backgroundColor, "rgb(0, 255, 255)");
   window.opener.focus();
   ok(getComputedStyle(document.getElementById("box"), "").backgroundColor, "rgb(0, 255, 255)");
   ok(getComputedStyle(openerDoc.getElementById("box"), "").backgroundColor, "rgb(0, 0, 255)");
   complete();
-}
+}, window);
 
 ]]></script>
 
 </window>