Bug 1116669 - Wait for focus before running test_offlineNotification.html. r=dao, a=test-only
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 02 Jan 2015 11:56:28 -0500
changeset 234391 c99650ee50b00b4b8fc6a7685476f90f255a20df
parent 234390 967c2c33bcbea9a17b8d2611050734f391871767
child 234392 ea9e532e6b0f67c4a0e37287c07e9160696bb58e
push id4297
push userryanvm@gmail.com
push dateMon, 05 Jan 2015 14:25:01 +0000
treeherdermozilla-beta@c99650ee50b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, test-only
bugs1116669
milestone35.0
Bug 1116669 - Wait for focus before running test_offlineNotification.html. r=dao, a=test-only
browser/base/content/test/general/test_offlineNotification.html
--- a/browser/base/content/test/general/test_offlineNotification.html
+++ b/browser/base/content/test/general/test_offlineNotification.html
@@ -4,17 +4,17 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=462856
 -->
 <head>
   <title>Test offline app notification</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="offlineByDefault.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
-<body onload="loaded()">
+<body>
 <p id="display">
 <!-- Load the test frame twice from the same domain,
      to make sure we get notifications for both -->
 <iframe name="testFrame" src="offlineChild.html"></iframe>
 <iframe name="testFrame2" src="offlineChild2.html"></iframe>
 <!-- Load from another domain to make sure we get a second allow/deny
      notification -->
 <iframe name="testFrame3" src="http://example.com/tests/browser/base/content/test/general/offlineChild.html"></iframe>
@@ -118,12 +118,14 @@ function loaded() {
   is(panel.childElementCount, 2, "2 notifications being displayed");
   panel.firstElementChild.button.click();
 
   // should have dismissed one of the notifications.
   is(panel.childElementCount, 1, "1 notification now being displayed");
   panel.firstElementChild.button.click();
 }
 
+SimpleTest.waitForFocus(loaded);
+
 </script>
 </pre>
 </body>
 </html>