Backed out 3 changesets (bug 1387976) because of merge conflicts on AsyncTabSwitcher.jsm.
authorCosmin Sabou <csabou@mozilla.com>
Tue, 06 Mar 2018 06:25:54 +0200
changeset 461708 7c01c3875cae3d9b8a3fab22c4b07efe20f6d48f
parent 461707 61ca8af8e31332158c4307c8277282d27012d46e
child 461709 19838b896cd704a4cbf50d7e57b8d7dd8cafcbfd
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1387976
milestone60.0a1
backs outd91b6a40b32a811e56afc210161470c52ed0f093
b708ab55bc7258adf56d8c7c19ce3056bbf7a993
7958b0ccbe0bb24b2795d68c60a6003740a98ac4
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 3 changesets (bug 1387976) because of merge conflicts on AsyncTabSwitcher.jsm. Backed out changeset d91b6a40b32a (bug 1387976) Backed out changeset b708ab55bc72 (bug 1387976) Backed out changeset 7958b0ccbe0b (bug 1387976)
browser/base/content/tabbrowser.js
browser/base/content/tabbrowser.xml
browser/base/content/test/tabs/browser.ini
browser/base/content/test/tabs/browser_bug_1387976_restore_lazy_tab_browser_muted_state.js
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -111,17 +111,17 @@ class TabBrowser {
       "preferences", "imageDocument", "isRemoteBrowser", "messageManager",
       "getTabBrowser", "finder", "fastFind", "sessionHistory", "contentTitle",
       "characterSet", "fullZoom", "textZoom", "webProgress",
       "addProgressListener", "removeProgressListener", "audioPlaybackStarted",
       "audioPlaybackStopped", "pauseMedia", "stopMedia",
       "resumeMedia", "mute", "unmute", "blockedPopups", "lastURI",
       "purgeSessionHistory", "stopScroll", "startScroll",
       "userTypedValue", "userTypedClear", "mediaBlocked",
-      "didStartLoadSinceLastUserTyping", "audioMuted"
+      "didStartLoadSinceLastUserTyping"
     ];
 
     this._removingTabs = [];
 
     /**
      * Tab close requests are ignored if the window is closing anyway,
      * e.g. when holding Ctrl+W.
      */
@@ -1960,17 +1960,17 @@ class TabBrowser {
     let names = this._browserBindingProperties;
 
     for (let i = 0; i < names.length; i++) {
       let name = names[i];
       let getter;
       let setter;
       switch (name) {
         case "audioMuted":
-          getter = () => aTab.hasAttribute("muted");
+          getter = () => false;
           break;
         case "contentTitle":
           getter = () => SessionStore.getLazyTabValue(aTab, "title");
           break;
         case "currentURI":
           getter = () => {
             let url = SessionStore.getLazyTabValue(aTab, "url");
             return Services.io.newURI(url);
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1842,42 +1842,41 @@
           TelemetryStopwatch.finish("TAB_MEDIA_BLOCKING_TIME_MS", this);
         ]]></body>
       </method>
 
       <method name="toggleMuteAudio">
         <parameter name="aMuteReason"/>
         <body>
         <![CDATA[
+          // Do not attempt to toggle mute state if browser is lazy.
+          if (!this.linkedPanel) {
+            return;
+          }
+
           let tabContainer = this.parentNode;
           let browser = this.linkedBrowser;
           let modifiedAttrs = [];
           let hist = Services.telemetry.getHistogramById("TAB_AUDIO_INDICATOR_USED");
 
           if (this.hasAttribute("activemedia-blocked")) {
             this.removeAttribute("activemedia-blocked");
             modifiedAttrs.push("activemedia-blocked");
 
             browser.resumeMedia();
             hist.add(3 /* unblockByClickingIcon */);
             this.finishMediaBlockTimer();
           } else {
             if (browser.audioMuted) {
-              if (this.linkedPanel) {
-                // "Lazy Browser" should not invoke its unmute method
-                browser.unmute();
-              }
+              browser.unmute();
               this.removeAttribute("muted");
               BrowserUITelemetry.countTabMutingEvent("unmute", aMuteReason);
               hist.add(1 /* unmute */);
             } else {
-              if (this.linkedPanel) {
-                // "Lazy Browser" should not invoke its mute method
-                browser.mute();
-              }
+              browser.mute();
               this.setAttribute("muted", "true");
               BrowserUITelemetry.countTabMutingEvent("mute", aMuteReason);
               hist.add(0 /* mute */);
             }
             this.muteReason = aMuteReason || null;
             modifiedAttrs.push("muted");
           }
           tabContainer.tabbrowser._tabAttrModified(this, modifiedAttrs);
--- a/browser/base/content/test/tabs/browser.ini
+++ b/browser/base/content/test/tabs/browser.ini
@@ -30,9 +30,8 @@ skip-if = !e10s # Pref and test only rel
 [browser_preloadedBrowser_zoom.js]
 [browser_reload_deleted_file.js]
 skip-if = (debug && os == 'mac') || (debug && os == 'linux' && bits == 64) #Bug 1421183, disabled on Linux/OSX for leaked windows
 [browser_tabswitch_updatecommands.js]
 [browser_viewsource_of_data_URI_in_file_process.js]
 [browser_visibleTabs_bookmarkAllTabs.js]
 [browser_visibleTabs_contextMenu.js]
 [browser_open_newtab_start_observer_notification.js]
-[browser_bug_1387976_restore_lazy_tab_browser_muted_state.js]
deleted file mode 100644
--- a/browser/base/content/test/tabs/browser_bug_1387976_restore_lazy_tab_browser_muted_state.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const { TabState } = ChromeUtils.import("resource:///modules/sessionstore/TabState.jsm", {});
-
-/**
- * Simulate a restart of a tab by removing it, then add a lazy tab
- * which is restored with the tabData of the removed tab.
- *
- * @param tab
- *        The tab to restart.
- * @return {Object} the restored lazy tab
- */
-const restartTab = async function(tab) {
-  let tabData = TabState.clone(tab);
-  BrowserTestUtils.removeTab(tab);
-
-  let restoredLazyTab = BrowserTestUtils.addTab(gBrowser, "", {createLazyBrowser: true});
-  SessionStore.setTabState(restoredLazyTab, JSON.stringify(tabData));
-  return restoredLazyTab;
-};
-
-function get_tab_state(tab) {
-  const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
-  return JSON.parse(ss.getTabState(tab));
-}
-
-add_task(async function() {
-  const tab = BrowserTestUtils.addTab(gBrowser, "http://mochi.test:8888/");
-  const browser = gBrowser.getBrowserForTab(tab);
-  await BrowserTestUtils.browserLoaded(browser);
-
-  // Let's make sure the tab is not in a muted state at the beginning
-  ok(!("muted" in get_tab_state(tab)), "Tab should not be in a muted state");
-
-  info("toggling Muted audio...");
-  tab.toggleMuteAudio();
-
-  ok("muted" in get_tab_state(tab), "Tab should be in a muted state");
-
-  info("Restarting tab...");
-  let restartedTab = await restartTab(tab);
-
-  ok("muted" in get_tab_state(restartedTab), "Restored tab should still be in a muted state after restart");
-
-  BrowserTestUtils.removeTab(restartedTab);
-});