diff --git a/dom/tests/browser/browser_focus_steal_from_chrome.js b/dom/tests/browser/browser_focus_steal_from_chrome.js index b5d032ba3c1c..0c23d2818270 100644 --- a/dom/tests/browser/browser_focus_steal_from_chrome.js +++ b/dom/tests/browser/browser_focus_steal_from_chrome.js @@ -8,7 +8,8 @@ function test() { let fm = Components.classes["@mozilla.org/focus-manager;1"] .getService(Components.interfaces.nsIFocusManager); - let tabs = [ gBrowser.selectedTab, gBrowser.addTab() ]; + let tabs = [ gBrowser.addTab(), gBrowser.addTab() ]; + gBrowser.selectedTab = tabs[0]; let testingList = [ { uri: "data:text/html,", @@ -61,7 +62,6 @@ function test() { function runNextTest() { if (++testingIndex >= testingList.length) { // cleaning-up... - gBrowser.addTab(); for (let i = 0; i < tabs.length; i++) { gBrowser.removeTab(tabs[i]); } diff --git a/dom/tests/browser/browser_focus_steal_from_chrome_during_mousedown.js b/dom/tests/browser/browser_focus_steal_from_chrome_during_mousedown.js index 8b11e4a9a842..e96019de6643 100644 --- a/dom/tests/browser/browser_focus_steal_from_chrome_during_mousedown.js +++ b/dom/tests/browser/browser_focus_steal_from_chrome_during_mousedown.js @@ -13,7 +13,8 @@ function test() { "" + ""; - let tab = gBrowser.selectedTab; + let tab = gBrowser.addTab(); + gBrowser.selectedTab = tab; // Set the focus to the contents. tab.linkedBrowser.focus(); @@ -52,7 +53,6 @@ function test() { button); } - gBrowser.addTab(); gBrowser.removeTab(tab); finish(); }