diff --git a/browser/base/content/test/browser_bug580956.js b/browser/base/content/test/browser_bug580956.js index a5230ffb19c7..fc26754785cb 100644 --- a/browser/base/content/test/browser_bug580956.js +++ b/browser/base/content/test/browser_bug580956.js @@ -6,6 +6,7 @@ function numClosedTabs() function isUndoCloseEnabled() { document.popupNode = gBrowser.tabs[0]; TabContextMenu.updateContextMenu(document.getElementById("tabContextMenu")); + TabContextMenu.contextTab = null; return !document.getElementById("context_undoCloseTab").disabled; } diff --git a/browser/base/content/test/browser_visibleTabs_bookmarkAllTabs.js b/browser/base/content/test/browser_visibleTabs_bookmarkAllTabs.js index a7b7c817cd65..93715d764580 100644 --- a/browser/base/content/test/browser_visibleTabs_bookmarkAllTabs.js +++ b/browser/base/content/test/browser_visibleTabs_bookmarkAllTabs.js @@ -91,12 +91,13 @@ function test() { function Disabled() { document.popupNode = gBrowser.selectedTab; TabContextMenu.updateContextMenu(document.getElementById("tabContextMenu")); - let command = document.getElementById("Browser:BookmarkAllTabs"); - return command.hasAttribute("disabled") && command.getAttribute("disabled") === "true"; + TabContextMenu.contextTab = null; + return document.getElementById("Browser:BookmarkAllTabs").getAttribute("disabled") == "true"; } function Hidden() { document.popupNode = gBrowser.selectedTab; TabContextMenu.updateContextMenu(document.getElementById("tabContextMenu")); + TabContextMenu.contextTab = null; return document.getElementById("context_bookmarkAllTabs").hidden; } diff --git a/browser/base/content/test/browser_visibleTabs_contextMenu.js b/browser/base/content/test/browser_visibleTabs_contextMenu.js index 1441ccc66c64..4d07901b633f 100644 --- a/browser/base/content/test/browser_visibleTabs_contextMenu.js +++ b/browser/base/content/test/browser_visibleTabs_contextMenu.js @@ -44,7 +44,6 @@ function test() { // Check the context menu with two tabs popup(origTab); - is(TabContextMenu.contextTab, origTab, "TabContextMenu context is the original tab"); is(document.getElementById("context_closeTab").disabled, false, "Close Tab is enabled"); is(document.getElementById("context_reloadAllTabs").disabled, false, "Reload All Tabs is enabled"); @@ -55,7 +54,6 @@ function test() { // Check the context menu with one tab. popup(testTab); - is(TabContextMenu.contextTab, testTab, "TabContextMenu context is the test tab"); is(document.getElementById("context_closeTab").disabled, false, "Close Tab is enabled when more than one tab exists"); is(document.getElementById("context_reloadAllTabs").disabled, true, "Reload All Tabs is disabled"); @@ -67,7 +65,6 @@ function test() { // Check the context menu on the unpinned visible tab popup(testTab); - is(TabContextMenu.contextTab, testTab, "TabContextMenu context is again the test tab"); is(document.getElementById("context_closeOtherTabs").disabled, true, "Close Other Tabs is disabled"); // Show all tabs @@ -76,7 +73,6 @@ function test() { // Check the context menu now popup(testTab); - is(TabContextMenu.contextTab, testTab, "TabContextMenu context is yet again the test tab"); is(document.getElementById("context_closeOtherTabs").disabled, false, "Close Other Tabs is enabled"); gBrowser.removeTab(testTab); @@ -86,4 +82,6 @@ function test() { function popup(tab) { document.popupNode = tab; TabContextMenu.updateContextMenu(document.getElementById("tabContextMenu")); -} \ No newline at end of file + is(TabContextMenu.contextTab, tab, "TabContextMenu context is the expected tab"); + TabContextMenu.contextTab = null; +} diff --git a/browser/base/content/test/tabview/browser_tabview_bug625195.js b/browser/base/content/test/tabview/browser_tabview_bug625195.js index 9b857090436c..1b87ef7e8dcd 100644 --- a/browser/base/content/test/tabview/browser_tabview_bug625195.js +++ b/browser/base/content/test/tabview/browser_tabview_bug625195.js @@ -49,5 +49,7 @@ function test() { function popup(tab) { document.popupNode = tab; TabContextMenu.updateContextMenu(document.getElementById("tabContextMenu")); + is(TabContextMenu.contextTab, tab, "TabContextMenu context is the expected tab"); + TabContextMenu.contextTab = null; } diff --git a/browser/base/content/test/tabview/browser_tabview_bug626791.js b/browser/base/content/test/tabview/browser_tabview_bug626791.js index 4029255d6a61..309b0611978b 100644 --- a/browser/base/content/test/tabview/browser_tabview_bug626791.js +++ b/browser/base/content/test/tabview/browser_tabview_bug626791.js @@ -139,6 +139,9 @@ function test() { testDragToCreateOrphan, testReAddingAfterRemoval]; let next = function () { + if (win) + win.close(); + let test = tests.shift(); if (!test) { @@ -146,15 +149,12 @@ function test() { return; } - if (win) - win.close(); - TabView.firstUseExperienced = false; let onLoad = function (newWin) { win = newWin; removeToolbarButton(); - } + }; let onShow = function () { cw = win.TabView.getContentWindow(); @@ -167,13 +167,12 @@ function test() { assertToolbarButtonNotExists(); test(); }, cw); - } + }; newWindowWithTabView(onShow, onLoad); } waitForExplicitFinish(); - registerCleanupFunction(function () win && win.close()); next(); }