зеркало из https://github.com/mozilla/gecko-dev.git
Bug 658738 - reset TabContextMenu.contextTab when manually calling TabContextMenu.updateContextMenu
This commit is contained in:
Родитель
dc7b553ee6
Коммит
9d6577b4a0
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
is(TabContextMenu.contextTab, tab, "TabContextMenu context is the expected tab");
|
||||
TabContextMenu.contextTab = null;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче