Backed out changeset 43c3f5bc92ee (bug 1364127) for developer's request
authorIris Hsiao <ihsiao@mozilla.com>
Fri, 12 May 2017 10:28:32 +0800
changeset 358052 0b3de3cdbf997a44fc3c0b55cf5ab60488097779
parent 358051 5651b5f9b4bfb7a16463cf46d20138927cd82c8a
child 358053 39a2a527f529c7bdf162fdc7100f9b062a91046c
push id90256
push userryanvm@gmail.com
push dateFri, 12 May 2017 16:11:50 +0000
treeherdermozilla-inbound@823615e72783 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1364127
milestone55.0a1
backs out43c3f5bc92eeaceeb1d6e46400c461cbb4565024
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 43c3f5bc92ee (bug 1364127) for developer's request
browser/base/content/tabbrowser.xml
browser/components/sessionstore/SessionStore.jsm
browser/components/sessionstore/test/browser.ini
browser/components/sessionstore/test/browser_suppress_transient_tab_title.js
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1411,23 +1411,16 @@
 
       <method name="setTabTitle">
         <parameter name="aTab"/>
         <body>
           <![CDATA[
             var browser = this.getBrowserForTab(aTab);
             var title = browser.contentTitle;
 
-            if (aTab._suppressTransientLabel) {
-              delete aTab._suppressTransientLabel;
-              if (!title) {
-                return false;
-              }
-            }
-
             if (!title) {
               if (browser.currentURI.spec) {
                 try {
                   title = this.mURIFixup.createExposableURI(browser.currentURI).spec;
                 } catch (ex) {
                   title = browser.currentURI.spec;
                 }
               }
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -3781,17 +3781,16 @@ var SessionStoreInternal = {
 
     // Increase our internal count.
     this._tabsRestoringCount++;
 
     // Set this tab's state to restoring
     browser.__SS_restoreState = TAB_STATE_RESTORING;
     browser.removeAttribute("pending");
     aTab.removeAttribute("pending");
-    aTab._suppressTransientLabel = true;
   },
 
   /**
    * This _attempts_ to restore the next available tab. If the restore fails,
    * then we will attempt the next one.
    * There are conditions where this won't do anything:
    *   if we're in the process of quitting
    *   if there are no tabs to restore
--- a/browser/components/sessionstore/test/browser.ini
+++ b/browser/components/sessionstore/test/browser.ini
@@ -107,23 +107,21 @@ skip-if = e10s # Bug 1271024
 [browser_replace_load.js]
 [browser_restore_redirect.js]
 [browser_restore_cookies_noOriginAttributes.js]
 [browser_scrollPositions.js]
 [browser_scrollPositionsReaderMode.js]
 [browser_sessionHistory.js]
 [browser_sessionStorage.js]
 [browser_sessionStorage_size.js]
-[browser_suppress_transient_tab_title.js]
 [browser_swapDocShells.js]
 [browser_switch_remoteness.js]
 run-if = e10s
 [browser_upgrade_backup.js]
 [browser_windowRestore_perwindowpb.js]
-
 [browser_248970_b_perwindowpb.js]
 # Disabled because of leaks.
 # Re-enabling and rewriting this test is tracked in bug 936919.
 skip-if = true
 [browser_339445.js]
 [browser_345898.js]
 [browser_350525.js]
 [browser_354894_perwindowpb.js]
deleted file mode 100644
--- a/browser/components/sessionstore/test/browser_suppress_transient_tab_title.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Test that we suppress unnecessary tab label changes when restoring a tab.
- */
-
-add_task(async function() {
-  await SpecialPowers.pushPrefEnv({
-    "set": [
-      ["browser.sessionstore.restore_on_demand", true],
-      ["browser.sessionstore.restore_tabs_lazily", true],
-    ]
-  });
-  const BACKUP_STATE = SessionStore.getBrowserState();
-  const TEST_URL = "http://example.com/";
-
-  function observeLabelChanges(tab) {
-    let labelChangeCount = 0;
-    function TabAttrModifiedListener(event) {
-      if (event.detail.changed.some(attr => { return attr == "label" })) {
-        labelChangeCount++;
-      }
-    }
-    tab.addEventListener("TabAttrModified", TabAttrModifiedListener);
-    return (expectedCount) => {
-      tab.removeEventListener("TabAttrModified", TabAttrModifiedListener);
-      is(labelChangeCount, expectedCount, "observed tab label changes");
-    }
-  }
-
-  info("setting test browser state");
-  let browserLoadedPromise = BrowserTestUtils.firstBrowserLoaded(window, false);
-  await promiseBrowserState({
-    windows: [{
-      tabs: [
-        { entries: [{ url: TEST_URL }] },
-        { entries: [{ url: TEST_URL }] },
-      ]
-    }]
-  });
-  let [firstTab, secondTab] = gBrowser.tabs;
-  is(gBrowser.selectedTab, firstTab, "first tab is selected");
-
-  await browserLoadedPromise;
-  const CONTENT_TITLE = firstTab.linkedBrowser.contentTitle;
-  is(firstTab.linkedBrowser.currentURI.spec, TEST_URL, "correct URL loaded in first tab");
-  is(typeof CONTENT_TITLE, "string", "content title is a string");
-  isnot(CONTENT_TITLE.length, 0, "content title isn't empty");
-  isnot(CONTENT_TITLE, TEST_URL, "content title is different from the URL");
-  is(firstTab.label, CONTENT_TITLE, "first tab displays content title");
-  ok(secondTab.hasAttribute("pending"), "second tab is pending");
-  is(secondTab.label, TEST_URL, "second tab displays URL as its title");
-  let checkLabelChangeCount = observeLabelChanges(secondTab);
-
-  info("selecting the second tab");
-  browserLoadedPromise = BrowserTestUtils.browserLoaded(secondTab.linkedBrowser, false, TEST_URL);
-  gBrowser.selectedTab = secondTab;
-  await browserLoadedPromise;
-  ok(!secondTab.hasAttribute("pending"), "second tab isn't pending anymore");
-  is(gBrowser.selectedTab.label, CONTENT_TITLE, "second tab displays content title");
-  checkLabelChangeCount(1);
-
-  info("restoring the modified browser state");
-  await TabStateFlusher.flushWindow(window);
-  await promiseBrowserState(SessionStore.getBrowserState());
-  [firstTab, secondTab] = gBrowser.tabs;
-  is(secondTab, gBrowser.selectedTab, "second tab is selected after restoring");
-  ok(firstTab.hasAttribute("pending"), "first tab is pending after restoring");
-  is(firstTab.label, CONTENT_TITLE, "first tab displays content title after restoring");
-
-  info("selecting the first tab");
-  checkLabelChangeCount = observeLabelChanges(firstTab);
-  let tabContentRestored = TestUtils.topicObserved("sessionstore-debug-tab-restored");
-  gBrowser.selectedTab = firstTab;
-  await tabContentRestored;
-  ok(!firstTab.hasAttribute("pending"), "first tab isn't pending anymore");
-  checkLabelChangeCount(0);
-  is(firstTab.label, CONTENT_TITLE, "first tab displays content title after restoring content");
-
-  await promiseBrowserState(BACKUP_STATE);
-});
-