Backed out changeset 3f7826efc5de (bug 1121671) for test failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 02 Apr 2015 23:11:31 -0400
changeset 258235 ffb13ef5ff0a
parent 258234 9c755cdc241c
child 258236 b7e7470e83b3
push id4624
push userryanvm@gmail.com
push date2015-04-03 03:11 +0000
treeherdermozilla-beta@ffb13ef5ff0a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1121671
milestone38.0
backs out3f7826efc5de
Backed out changeset 3f7826efc5de (bug 1121671) for test failures.
testing/mochitest/tests/browser/browser_waitForFocus.js
--- a/testing/mochitest/tests/browser/browser_waitForFocus.js
+++ b/testing/mochitest/tests/browser/browser_waitForFocus.js
@@ -18,29 +18,21 @@ function *promiseTabLoadEvent(tab, url)
     tab.linkedBrowser.addEventListener("load", handleLoadEvent, true, true);
     if (url)
       tab.linkedBrowser.loadURI(url);
   });
 }
 
 // Load a new blank tab
 add_task(function *() {
-  let tab;
+  let tab = gBrowser.addTab();
+  gBrowser.selectedTab = tab;
 
-  yield new Promise(resolve => {
-    gBrowser.addEventListener("TabSwitchDone", function onSwitch() {
-      gBrowser.removeEventListener("TabSwitchDone", onSwitch);
-      executeSoon(resolve);
-    });
-    tab = gBrowser.selectedTab = gBrowser.addTab();
-  });
+  let browser = gBrowser.getBrowserForTab(tab);
 
-  gURLBar.focus();
-
-  let browser = gBrowser.selectedBrowser;
   yield SimpleTest.promiseFocus(browser.contentWindowAsCPOW, true);
 
   is(document.activeElement, browser, "Browser is focused when about:blank is loaded");
 
   gBrowser.removeCurrentTab();
   gURLBar.focus();
 });