Bug 468053 - treat gBrowser.addTab(null) and gBrowser.addTab("about:blank") equally. r=mano

This commit is contained in:
Dão Gottwald 2009-10-14 14:50:52 +02:00
parent 9437300eb2
commit d9f27bea07
5 changed files with 5 additions and 2 deletions

View File

@ -1266,7 +1266,7 @@
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"tab");
var blank = (aURI == "about:blank");
var blank = !aURI || (aURI == "about:blank");
if (blank)
t.setAttribute("label", this.mStringBundle.getString("tabs.untitled"));

View File

@ -45,6 +45,7 @@ function test() {
key = "Unique name: " + Math.random();
value = "Unique value: " + Date.now();
let tab = tabbrowser.addTab();
tab.linkedBrowser.stop();
// test adding
ok(test(function() ss.setTabValue(tab, key, value)), "store a tab value");

View File

@ -63,7 +63,7 @@ function test() {
newWin.gBrowser.removeEventListener("load", arguments.callee, true);
executeSoon(function() {
newWin.gBrowser.addTab();
newWin.gBrowser.addTab().linkedBrowser.stop();
executeSoon(function() {
// mark the window with some unique data to be restored later on
ss.setWindowValue(newWin, uniqueKey, uniqueValue);

View File

@ -47,6 +47,7 @@ function test() {
// set a unique value on a new, blank tab
var tab = gBrowser.addTab();
tab.linkedBrowser.stop();
ss.setTabValue(tab, uniqueName, uniqueValue);
let valueWasCleaned = false;

View File

@ -40,6 +40,7 @@ function test() {
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
let tab = gBrowser.addTab();
tab.linkedBrowser.stop();
let tabState = JSON.parse(ss.getTabState(tab));
is(tabState.disallow || "", "", "Everything is allowed per default");