michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: BrowserOpenTab(); michael@0: michael@0: let tab = gBrowser.selectedTab; michael@0: let browser = tab.linkedBrowser; michael@0: michael@0: registerCleanupFunction(function () { gBrowser.removeTab(tab); }); michael@0: michael@0: whenBrowserLoaded(browser, function () { michael@0: browser.loadURI("http://example.com/"); michael@0: michael@0: whenBrowserLoaded(browser, function () { michael@0: ok(!gBrowser.canGoBack, "about:newtab wasn't added to the session history"); michael@0: finish(); michael@0: }); michael@0: }); michael@0: } michael@0: michael@0: function whenBrowserLoaded(aBrowser, aCallback) { michael@0: if (aBrowser.contentDocument.readyState == "complete") { michael@0: executeSoon(aCallback); michael@0: return; michael@0: } michael@0: michael@0: aBrowser.addEventListener("load", function onLoad() { michael@0: aBrowser.removeEventListener("load", onLoad, true); michael@0: executeSoon(aCallback); michael@0: }, true); michael@0: }