Backed out 3 changesets (bug 1435142) for Mochitest failure on browser/base/content/test/tabs/browser_close_tab_by_dblclick.js
authorDorel Luca <dluca@mozilla.com>
Mon, 19 Mar 2018 17:54:01 +0200
changeset 769703 ea5c6ffc930ecf532368ac533f002367c1905dea
parent 769702 c161a8b11ba770706f2dc345679af86d92dd06e6
child 769704 44eb7c6b5b76da28cbe8b997164e40e24357da35
push id103206
push userbmo:bdahl@mozilla.com
push dateMon, 19 Mar 2018 23:33:04 +0000
bugs1435142
milestone61.0a1
backs outbcde232543f89e90211e4eb7d760c2fe53503030
e9ddfb08a712c1698441277bef7cfda96dee38c7
069febd18b9e2b445ecdaf4e6f2151c9450d6247
Backed out 3 changesets (bug 1435142) for Mochitest failure on browser/base/content/test/tabs/browser_close_tab_by_dblclick.js Backed out changeset bcde232543f8 (bug 1435142) Backed out changeset e9ddfb08a712 (bug 1435142) Backed out changeset 069febd18b9e (bug 1435142)
browser/app/profile/firefox.js
browser/base/content/tabbrowser.xml
browser/base/content/test/tabs/browser.ini
browser/base/content/test/tabs/browser_close_tab_by_dblclick.js
toolkit/components/extensions/ext-browserSettings.js
toolkit/components/extensions/schemas/browser_settings.json
toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -453,17 +453,16 @@ pref("browser.link.open_newwindow.restri
 // different.
 #ifdef XP_MACOSX
 pref("browser.link.open_newwindow.disabled_in_fullscreen", true);
 #else
 pref("browser.link.open_newwindow.disabled_in_fullscreen", false);
 #endif
 
 // Tabbed browser
-pref("browser.tabs.closeTabByDblclick", false);
 pref("browser.tabs.closeWindowWithLastTab", true);
 pref("browser.tabs.insertRelatedAfterCurrent", true);
 pref("browser.tabs.warnOnClose", true);
 pref("browser.tabs.warnOnCloseOtherTabs", true);
 pref("browser.tabs.warnOnOpen", true);
 pref("browser.tabs.maxOpenBeforeWarn", 15);
 pref("browser.tabs.loadInBackground", true);
 pref("browser.tabs.opentabfor.middleclick", true);
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -138,19 +138,16 @@
           );
 
           this._tabMinWidth = this._tabMinWidthPref;
 
           this._setPositionalAttributes();
 
           CustomizableUI.addListener(this);
           this._updateNewTabVisibility();
-
-          XPCOMUtils.defineLazyPreferenceGetter(this, "_closeTabByDblclick",
-            "browser.tabs.closeTabByDblclick", false);
         ]]>
       </constructor>
 
       <destructor>
         <![CDATA[
           Services.prefs.removeObserver("privacy.userContext", this);
 
           CustomizableUI.removeListener(this);
@@ -1687,17 +1684,16 @@
           if (!gMultiProcessBrowser || (val && this.hasAttribute("visuallyselected"))) {
             this._visuallySelected = val;
           }
 
           return val;
         ]]>
         </setter>
       </property>
-      <field name="_selectedOnFirstMouseDown">false</field>
 
       <property name="pinned" readonly="true">
         <getter>
           return this.getAttribute("pinned") == "true";
         </getter>
       </property>
       <property name="hidden" readonly="true">
         <getter>
@@ -1985,23 +1981,16 @@
       <handler event="dragstart"><![CDATA[
         if (this.mOverCloseButton) {
           event.stopPropagation();
         }
       ]]></handler>
 
       <handler event="mousedown" phase="capturing">
       <![CDATA[
-        let tabContainer = this.parentNode;
-        if (tabContainer._closeTabByDblclick &&
-            event.button == 0 &&
-            event.detail == 1) {
-          this._selectedOnFirstMouseDown = this.selected;
-        }
-
         if (this.selected) {
           this.style.MozUserFocus = "ignore";
         } else if (this.mOverCloseButton ||
                    this._overPlayingIcon) {
           // Prevent tabbox.xml from selecting the tab.
           event.stopPropagation();
         }
       ]]>
@@ -2027,27 +2016,16 @@
         }
       ]]></handler>
 
       <handler event="dblclick" button="0" phase="capturing"><![CDATA[
         // for the one-close-button case
         if (event.originalTarget.getAttribute("anonid") == "close-button") {
           event.stopPropagation();
         }
-
-        let tabContainer = this.parentNode;
-        if (tabContainer._closeTabByDblclick &&
-            this._selectedOnFirstMouseDown &&
-            this.selected &&
-            !this._overPlayingIcon) {
-          gBrowser.removeTab(this, {
-            animate: true,
-            byMouse: event.mozInputSource == MouseEvent.MOZ_SOURCE_MOUSE,
-          });
-        }
       ]]></handler>
 
       <handler event="animationend">
       <![CDATA[
         if (event.originalTarget.getAttribute("anonid") == "tab-loading-burst") {
           this.removeAttribute("bursting");
         }
       ]]>
--- a/browser/base/content/test/tabs/browser.ini
+++ b/browser/base/content/test/tabs/browser.ini
@@ -2,17 +2,16 @@
 support-files =
   head.js
   dummy_page.html
 
 [browser_abandonment_telemetry.js]
 [browser_accessibility_indicator.js]
 [browser_allow_process_switches_despite_related_browser.js]
 [browser_bug580956.js]
-[browser_close_tab_by_dblclick.js]
 [browser_contextmenu_openlink_after_tabnavigated.js]
 support-files =
   test_bug1358314.html
 [browser_isLocalAboutURI.js]
 [browser_tabCloseProbes.js]
 [browser_tabSpinnerProbe.js]
 skip-if = !e10s # Tab spinner is e10s only.
 [browser_tabSwitchPrintPreview.js]
deleted file mode 100644
--- a/browser/base/content/test/tabs/browser_close_tab_by_dblclick.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-const PREF_CLOSE_TAB_BY_DBLCLICK = "browser.tabs.closeTabByDblclick";
-
-function triggerDblclickOn(target) {
-  EventUtils.synthesizeMouseAtCenter(target, { clickCount: 1 });
-  EventUtils.synthesizeMouseAtCenter(target, { clickCount: 2 });
-}
-
-add_task(async function dblclick() {
-  let tab = gBrowser.selectedTab;
-
-  let promise = BrowserTestUtils.waitForEvent(tab, "dblclick");
-  triggerDblclickOn(tab);
-  await promise;
-  ok(!tab.closing, "Double click the selected tab won't close it");
-});
-
-add_task(async function dblclickWithPrefSet() {
-  await SpecialPowers.pushPrefEnv({set: [
-    [PREF_CLOSE_TAB_BY_DBLCLICK, true]
-  ]});
-
-  let promise = BrowserTestUtils.waitForNewTab(gBrowser, "about:mozilla");
-  BrowserTestUtils.addTab(gBrowser, "about:mozilla");
-  let tab = await promise;
-  isnot(tab, gBrowser.selectedTab, "The new tab is in the background");
-
-  promise = BrowserTestUtils.waitForEvent(tab, "dblclick");
-  triggerDblclickOn(tab);
-  await promise;
-  is(tab, gBrowser.selectedTab, "Double click a background tab will select it");
-
-  promise = BrowserTestUtils.waitForEvent(tab, "dblclick");
-  triggerDblclickOn(tab);
-  await promise;
-  ok(tab.closing, "Double click the selected tab will close it");
-
-  await BrowserTestUtils.waitForSessionStoreUpdate(tab);
-});
--- a/toolkit/components/extensions/ext-browserSettings.js
+++ b/toolkit/components/extensions/ext-browserSettings.js
@@ -100,26 +100,16 @@ ExtensionPreferencesManager.addSetting("
     let returnObj = {};
     for (let pref of this.prefNames) {
       returnObj[pref] = value;
     }
     return returnObj;
   },
 });
 
-ExtensionPreferencesManager.addSetting("closeTabsByDoubleClick", {
-  prefNames: [
-    "browser.tabs.closeTabByDblclick",
-  ],
-
-  setCallback(value) {
-    return {[this.prefNames[0]]: value};
-  },
-});
-
 ExtensionPreferencesManager.addSetting("contextMenuShowEvent", {
   prefNames: [
     "ui.context_menus.after_mouseup",
   ],
 
   setCallback(value) {
     return {[this.prefNames[0]]: value === "mouseup"};
   },
@@ -226,21 +216,16 @@ this.browserSettings = class extends Ext
             return Services.prefs.getCharPref("dom.popup_allowed_events") != "";
           }),
         cacheEnabled: getSettingsAPI(
           extension, "cacheEnabled",
           () => {
             return Services.prefs.getBoolPref("browser.cache.disk.enable") &&
               Services.prefs.getBoolPref("browser.cache.memory.enable");
           }),
-        closeTabsByDoubleClick: getSettingsAPI(
-          extension, "closeTabsByDoubleClick",
-          () => {
-            return Services.prefs.getBoolPref("browser.tabs.closeTabByDblclick");
-          }, undefined, false, ["android"]),
         contextMenuShowEvent: Object.assign(
           getSettingsAPI(
             extension, "contextMenuShowEvent",
             () => {
               if (AppConstants.platform === "win") {
                 return "mouseup";
               }
               let prefValue = Services.prefs.getBoolPref(
--- a/toolkit/components/extensions/schemas/browser_settings.json
+++ b/toolkit/components/extensions/schemas/browser_settings.json
@@ -112,20 +112,16 @@
       "allowPopupsForUserEvents": {
         "$ref": "types.Setting",
         "description": "Allows or disallows pop-up windows from opening in response to user events."
       },
       "cacheEnabled": {
         "$ref": "types.Setting",
         "description": "Enables or disables the browser cache."
       },
-      "closeTabsByDoubleClick": {
-        "$ref": "types.Setting",
-        "description": "This boolean setting controls whether the selected tab can be closed with a double click."
-      },
       "contextMenuShowEvent": {
         "$ref": "types.Setting",
         "description": "Controls after which mouse event context menus popup. This setting's value is of type ContextMenuMouseEvent, which has possible values of <code>mouseup</code> and <code>mousedown</code>."
       },
       "homepageOverride": {
         "$ref": "types.Setting",
         "description": "Returns the value of the overridden home page. Read-only."
       },
--- a/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js
@@ -25,17 +25,16 @@ add_task(async function test_browser_set
   // Create an object to hold the values to which we will initialize the prefs.
   const PREFS = {
     "browser.cache.disk.enable": true,
     "browser.cache.memory.enable": true,
     "dom.popup_allowed_events": Preferences.get("dom.popup_allowed_events"),
     "image.animation_mode": "none",
     "permissions.default.desktop-notification": PERM_UNKNOWN_ACTION,
     "ui.context_menus.after_mouseup": false,
-    "browser.tabs.closeTabByDblclick": false,
     "browser.tabs.loadBookmarksInTabs": false,
     "browser.search.openintab": false,
     "network.proxy.type": proxySvc.PROXYCONFIG_SYSTEM,
     "network.proxy.http": "",
     "network.proxy.http_port": 0,
     "network.proxy.share_proxy_settings": false,
     "network.proxy.ftp": "",
     "network.proxy.ftp_port": 0,
@@ -160,25 +159,16 @@ add_task(async function test_browser_set
       "contextMenuShowEvent", "mousedown",
       {"ui.context_menus.after_mouseup": AppConstants.platform === "win"});
   } else {
     await testSetting(
       "contextMenuShowEvent", "mousedown",
       {"ui.context_menus.after_mouseup": false});
   }
 
-  if (AppConstants.platform !== "android") {
-    await testSetting(
-      "closeTabsByDoubleClick", true,
-      {"browser.tabs.closeTabByDblclick": true});
-    await testSetting(
-      "closeTabsByDoubleClick", false,
-      {"browser.tabs.closeTabByDblclick": false});
-  }
-
   await testSetting(
     "openBookmarksInNewTabs", true,
     {"browser.tabs.loadBookmarksInTabs": true});
   await testSetting(
     "openBookmarksInNewTabs", false,
     {"browser.tabs.loadBookmarksInTabs": false});
 
   await testSetting(
@@ -356,52 +346,16 @@ add_task(async function test_bad_value()
     },
   });
 
   await extension.startup();
   await extension.awaitMessage("done");
   await extension.unload();
 });
 
-add_task(async function test_bad_value_android() {
-  if (AppConstants.platform !== "android") {
-    return;
-  }
-
-  async function background() {
-    await browser.test.assertRejects(
-      browser.browserSettings.closeTabsByDoubleClick.set({value: true}),
-      /android is not a supported platform for the closeTabsByDoubleClick setting/,
-      "closeTabsByDoubleClick.set rejects on Android.");
-
-    await browser.test.assertRejects(
-      browser.browserSettings.closeTabsByDoubleClick.get({}),
-      /android is not a supported platform for the closeTabsByDoubleClick setting/,
-      "closeTabsByDoubleClick.get rejects on Android.");
-
-    await browser.test.assertRejects(
-      browser.browserSettings.closeTabsByDoubleClick.clear({}),
-      /android is not a supported platform for the closeTabsByDoubleClick setting/,
-      "closeTabsByDoubleClick.clear rejects on Android.");
-
-    browser.test.sendMessage("done");
-  }
-
-  let extension = ExtensionTestUtils.loadExtension({
-    background,
-    manifest: {
-      permissions: ["browserSettings"],
-    },
-  });
-
-  await extension.startup();
-  await extension.awaitMessage("done");
-  await extension.unload();
-});
-
 add_task(async function test_bad_value_proxy_config() {
   let background = AppConstants.platform === "android" ?
     async () => {
       await browser.test.assertRejects(
         browser.browserSettings.proxyConfig.set({value: {
           proxyType: "none",
         }}),
         /proxyConfig is not supported on android/,