Bug 869832 - browser_typeAheadFind.js should use whenDelayedStartupFinished and initialize the find bar in the original browser window rather than in the purposefully opened one. r=gavin
authorDão Gottwald <dao@mozilla.com>
Fri, 10 May 2013 20:55:27 +0200
changeset 131611 e3b527872ef0ede55efe4b2638123212a4b9af42
parent 131610 ada852fc265a9f475f741199d3838c4bec801586
child 131612 36401ffaee14f73d2b789e40fc3f99759b440127
push id24665
push userdbaron@mozilla.com
push dateSun, 12 May 2013 05:31:48 +0000
treeherdermozilla-central@d68224f5325b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs869832
milestone23.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 869832 - browser_typeAheadFind.js should use whenDelayedStartupFinished and initialize the find bar in the original browser window rather than in the purposefully opened one. r=gavin
browser/base/content/test/browser_typeAheadFind.js
--- a/browser/base/content/test/browser_typeAheadFind.js
+++ b/browser/base/content/test/browser_typeAheadFind.js
@@ -3,32 +3,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 let testWindow = null;
 
 function test() {
   waitForExplicitFinish();
 
   testWindow = OpenBrowserWindow();
-  testWindow.addEventListener("load", function() {
-    testWindow.removeEventListener("load", arguments.callee, false);
-    ok(true, "Load listener called");
-
-    executeSoon(function() {
-      let selectedBrowser = testWindow.gBrowser.selectedBrowser;
-      selectedBrowser.addEventListener("pageshow", function() {
-        selectedBrowser.removeEventListener("pageshow", arguments.callee,
-                                            false);
-        ok(true, "pageshow listener called");
-        waitForFocus(onFocus, testWindow.content);
-      }, true);
-      testWindow.content.location = "data:text/html,<h1>A Page</h1>";
-    });
-  }, false);
+  whenDelayedStartupFinished(testWindow, function () {
+    let selectedBrowser = testWindow.gBrowser.selectedBrowser;
+    selectedBrowser.addEventListener("pageshow", function() {
+      selectedBrowser.removeEventListener("pageshow", arguments.callee, true);
+      ok(true, "pageshow listener called");
+      waitForFocus(onFocus, testWindow.content);
+    }, true);
+    gBrowser.loadURI("data:text/html,<h1>A Page</h1>");
+  });
 }
 
 function onFocus() {
-  EventUtils.synthesizeKey("/", {});
-  ok(gFindBarInitialized, "find bar is now initialized");
-  testWindow.gFindBar.close();
+  ok(!testWindow.gFindBarInitialized, "find bar is not initialized");
+  EventUtils.synthesizeKey("/", {}, testWindow);
+  ok(testWindow.gFindBarInitialized, "find bar is now initialized");
   testWindow.close();
   finish();
 }