Bug 1116669 - Wait for focus before running test_offlineNotification.html; r=dao
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 02 Jan 2015 11:56:28 -0500
changeset 247767 c604d191012963321c22f5d16661b7a0839a1f96
parent 247766 2e43d79f82abf9b6675daf186f6360f2969049d1
child 247768 12eb2a10b584566eef05365237deec4e376268f9
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1116669
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1116669 - Wait for focus before running test_offlineNotification.html; r=dao
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>