Revision control
Copy as Markdown
Other Tools
/* Any copyright is dedicated to the Public Domain.
*/
// This introduced isTabEmpty() and isBrowserEmpty() functions, the latter
// being used in openUILinkIn() which in turn is used by switchToTabHavingURI()
var gWindowObject;
var gTabCount;
function test() {
waitForExplicitFinish();
gTabCount = gBrowser.tabs.length;
gBrowser.selectedTab = gBrowser.addTab();
is(isTabEmpty(gBrowser.selectedTab), true, "Added tab is empty");
switchToTabHavingURI("about:", true, {
browserCallback: function(aBrowser) {
gWindowObject = aBrowser.contentWindow.wrappedJSObject;
end_test();
}
});
}
function end_test() {
gWindowObject.close();
is(gBrowser.tabs.length, gTabCount, "We're still at the same number of tabs");
finish();
}