Bug 1266510: Also explicitly focus the second browser window after creation. r=me a=test-only
authorKris Maglione <maglione.k@gmail.com>
Sun, 20 Nov 2016 10:37:02 -0800
changeset 352559 c684ebca8623a319e2ebd93a8140de680bf88456
parent 352558 d10dd0e435a92cdf940fbc5e5ab6529806380acf
child 352560 5468cd9ed8e4a4cc32d37135842c04a7df8a58ee
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, test-only
bugs1266510
milestone52.0a2
Bug 1266510: Also explicitly focus the second browser window after creation. r=me a=test-only MozReview-Commit-ID: 5G81rXCXnyg
browser/components/extensions/test/browser/browser_ext_windows_events.js
--- a/browser/components/extensions/test/browser/browser_ext_windows_events.js
+++ b/browser/components/extensions/test/browser/browser_ext_windows_events.js
@@ -79,16 +79,18 @@ add_task(function* testWindowsEvents() {
   let winId = yield extension.awaitMessage(`window-focus-changed`);
   is(winId, win1Id, "Got focus change event for the correct window ID.");
 
   info(`Create browser window 2`);
   let win2 = yield BrowserTestUtils.openNewBrowserWindow();
   let win2Id = yield extension.awaitMessage("window-created");
   info(`Window 2 ID: ${win2Id}`);
 
+  win2.focus();
+
   winId = yield extension.awaitMessage(`window-focus-changed`);
   is(winId, win2Id, "Got focus change event for the correct window ID.");
 
   info(`Focus browser window 1`);
   yield focusWindow(win1);
 
   winId = yield extension.awaitMessage(`window-focus-changed`);
   is(winId, win1Id, "Got focus change event for the correct window ID.");