michael@0: function numClosedTabs() michael@0: SessionStore.getClosedTabCount(window); michael@0: michael@0: function isUndoCloseEnabled() { michael@0: updateTabContextMenu(); michael@0: return !document.getElementById("context_undoCloseTab").disabled; michael@0: } michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: gPrefService.setIntPref("browser.sessionstore.max_tabs_undo", 0); michael@0: gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo"); michael@0: is(numClosedTabs(), 0, "There should be 0 closed tabs."); michael@0: ok(!isUndoCloseEnabled(), "Undo Close Tab should be disabled."); michael@0: michael@0: var tab = gBrowser.addTab("http://mochi.test:8888/"); michael@0: var browser = gBrowser.getBrowserForTab(tab); michael@0: browser.addEventListener("load", function() { michael@0: browser.removeEventListener("load", arguments.callee, true); michael@0: michael@0: gBrowser.removeTab(tab); michael@0: ok(isUndoCloseEnabled(), "Undo Close Tab should be enabled."); michael@0: michael@0: finish(); michael@0: }, true); michael@0: }