Bug 1144826 - Wait for focus before trying to invoke a menu
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 12 Sep 2015 15:20:12 -0400
changeset 294813 cd8b8017370cf14c472c107d256bb98ce7a19270
parent 294812 31a26ed444843f086c468a98236e8c98b7115b44
child 294814 24515d221f0a98f7e63e3f31eb9650ffacbbe82a
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1144826
milestone43.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 1144826 - Wait for focus before trying to invoke a menu
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_popupblocker.js
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_popupblocker.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_popupblocker.js
@@ -47,21 +47,24 @@ add_task(function* test() {
       });
 
     }, false);
 
     aWindow.gBrowser.selectedBrowser.loadURI(testURI);
   }
 
   let win1 = yield BrowserTestUtils.openNewBrowserWindow();
+  yield new Promise(resolve => waitForFocus(resolve, win1));
   yield new Promise(resolve => testPopupBlockerMenuItem(false, win1, resolve));
 
   let win2 = yield BrowserTestUtils.openNewBrowserWindow({private: true});
+  yield new Promise(resolve => waitForFocus(resolve, win2));
   yield new Promise(resolve => testPopupBlockerMenuItem(true, win2, resolve));
 
   let win3 = yield BrowserTestUtils.openNewBrowserWindow();
+  yield new Promise(resolve => waitForFocus(resolve, win3));
   yield new Promise(resolve => testPopupBlockerMenuItem(false, win3, resolve));
 
   // Cleanup
   yield BrowserTestUtils.closeWindow(win1);
   yield BrowserTestUtils.closeWindow(win2);
   yield BrowserTestUtils.closeWindow(win3);
 });