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 234545 5328098d29311191913ee4e10e09b88b0f0ff811
parent 234544 7777266ef58b611883982c812c8ad636579ab2c2
child 234546 4c70d76342e9e7934ec31da9f621df013a4386d7
push id7428
push userryanvm@gmail.com
push dateMon, 05 Jan 2015 14:31:51 +0000
treeherdermozilla-aurora@e26d31752fd7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, test-only
bugs1116669
milestone36.0a2
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>