Bug 468053 - treat gBrowser.addTab(null) and gBrowser.addTab("about:blank") equally. r=mano, a=dveditz
☠☠ backed out by 91a46b3f3f97 ☠ ☠
authorDão Gottwald <dao@mozilla.com>
Wed, 14 Oct 2009 14:50:52 +0200
changeset 34066 74a86bea13aea6c5288dce19ce35557c8fc19d4c
parent 34065 5a51c5876cb3860b07c4881c2ea78979b467aba6
child 34068 e13313cdac91eb0f35b949430689dc4d39999f7a
push id1249
push userreed@reedloden.com
push dateTue, 13 Apr 2010 04:59:09 +0000
reviewersmano, dveditz
bugs468053
milestone1.9.2.4pre
Bug 468053 - treat gBrowser.addTab(null) and gBrowser.addTab("about:blank") equally. r=mano, a=dveditz
browser/base/content/tabbrowser.xml
browser/components/sessionstore/test/browser/browser_350525.js
browser/components/sessionstore/test/browser/browser_394759.js
browser/components/sessionstore/test/browser/browser_448741.js
browser/components/sessionstore/test/browser/browser_493467.js
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1221,17 +1221,17 @@
             // if we're adding tabs, we're past interrupt mode, ditch the owner
             if (this.mCurrentTab.owner)
               this.mCurrentTab.owner = null;
 
             var t = document.createElementNS(
               "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"));
             else
               t.setAttribute("label", aURI);
 
             t.setAttribute("crop", "end");
             t.maxWidth = this.mTabContainer.mTabMaxWidth;
--- a/browser/components/sessionstore/test/browser/browser_350525.js
+++ b/browser/components/sessionstore/test/browser/browser_350525.js
@@ -40,16 +40,17 @@ function test() {
   is(ss.getWindowValue(window, key), "", "window value was deleted");
   
   /////////////////////////
   // setTabValue, et al. //
   /////////////////////////
   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");
   
   // test retrieving
   is(ss.getTabValue(tab, key), value, "stored tab value match original");
   
   // test deleting 
--- a/browser/components/sessionstore/test/browser/browser_394759.js
+++ b/browser/components/sessionstore/test/browser/browser_394759.js
@@ -58,17 +58,17 @@ function test() {
   
     let newWin = openDialog(location, "_blank", "chrome,all,dialog=no", testURL);
     newWin.addEventListener("load", function(aEvent) {
       newWin.removeEventListener("load", arguments.callee, false);
       newWin.gBrowser.addEventListener("load", function(aEvent) {
         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);
             let textbox = newWin.content.document.getElementById("textbox");
             textbox.wrappedJSObject.value = uniqueText;
 
             newWin.close();
 
--- a/browser/components/sessionstore/test/browser/browser_448741.js
+++ b/browser/components/sessionstore/test/browser/browser_448741.js
@@ -43,16 +43,17 @@ function test() {
   let tabbrowser = getBrowser();
   waitForExplicitFinish();
   
   let uniqueName = "bug 448741";
   let uniqueValue = "as good as unique: " + Date.now();
   
   // set a unique value on a new, blank tab
   var tab = tabbrowser.addTab();
+  tab.linkedBrowser.stop();
   ss.setTabValue(tab, uniqueName, uniqueValue);
   let valueWasCleaned = false;
   
   // prevent our value from being written to disk
   let cleaningObserver = {
     observe: function(aSubject, aTopic, aData) {
       ok(aTopic == "sessionstore-state-write", "observed correct topic?");
       ok(aSubject instanceof Ci.nsISupportsString, "subject is a string?");
--- a/browser/components/sessionstore/test/browser/browser_493467.js
+++ b/browser/components/sessionstore/test/browser/browser_493467.js
@@ -35,16 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 493467 **/
   
   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");
   
   // collect all permissions that can be set on a docShell (i.e. all
   // attributes starting with "allow" such as "allowJavascript") and
   // disallow them all, as SessionStore only remembers disallowed ones
   let permissions = [];
   let docShell = tab.linkedBrowser.docShell;