Backed out changeset 9760535819af (bug 1616862) for browser_openViewOnFocus.js failures a=backout
authorBogdan Tara <btara@mozilla.com>
Fri, 21 Feb 2020 22:15:48 +0200
changeset 575822 87c0b54d1e78f81d56d33d9e053fad350c3364a5
parent 575821 9760535819af8b55083200a0b8c387dfaf46fa5a
child 575823 2277b58b1038c589ea5e7a143108c99c5b3c646a
push id12754
push userbtara@mozilla.com
push dateFri, 21 Feb 2020 20:16:50 +0000
treeherdermozilla-beta@87c0b54d1e78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1616862
milestone74.0
backs out9760535819af8b55083200a0b8c387dfaf46fa5a
Backed out changeset 9760535819af (bug 1616862) for browser_openViewOnFocus.js failures a=backout
browser/components/urlbar/UrlbarInput.jsm
browser/components/urlbar/tests/browser/browser_dropmarker.js
browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -155,17 +155,16 @@ class UrlbarInput {
         set(val) {
           return (this.inputField[property] = val);
         },
       });
     }
 
     this.inputField = this.querySelector("#urlbar-input");
     this.dropmarker = this.querySelector(".urlbar-history-dropmarker");
-    this.dropmarker.hidden = this.megabar;
     this._inputContainer = this.querySelector("#urlbar-input-container");
     this._identityBox = this.querySelector("#identity-box");
     this._toolbar = this.textbox.closest("toolbar");
 
     XPCOMUtils.defineLazyGetter(this, "valueFormatter", () => {
       return new UrlbarValueFormatter(this);
     });
 
@@ -1082,16 +1081,17 @@ class UrlbarInput {
 
   _setOpenViewOnFocus() {
     // FIXME: Not using UrlbarPrefs because its pref observer may run after
     // this call, so we'd get the previous openViewOnFocus value here. This
     // can be cleaned up after bug 1560013.
     this.openViewOnFocus = Services.prefs.getBoolPref(
       "browser.urlbar.openViewOnFocus"
     );
+    this.dropmarker.hidden = this.openViewOnFocus;
   }
 
   _setValue(val, allowTrim) {
     this._untrimmedValue = val;
 
     let originalUrl = ReaderMode.getOriginalUrlObjectForDisplay(val);
     if (originalUrl) {
       val = originalUrl.displaySpec;
--- a/browser/components/urlbar/tests/browser/browser_dropmarker.js
+++ b/browser/components/urlbar/tests/browser/browser_dropmarker.js
@@ -1,21 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 "use strict";
 
-add_task(async function setup() {
-  if (gURLBar.dropmarker.hidden) {
-    gURLBar.dropmarker.hidden = false;
-    registerCleanupFunction(() => {
-      gURLBar.dropmarker.hidden = true;
-    });
-  }
+SpecialPowers.pushPrefEnv({
+  set: [["browser.urlbar.openViewOnFocus", false]],
 });
 
 add_task(async function basic() {
   await BrowserTestUtils.withNewTab("http://example.com/", async () => {
     let queryContext = await clickDropmarker();
     is(
       queryContext.searchString,
       "",
--- a/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js
+++ b/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js
@@ -455,27 +455,26 @@ const tests = [
         selType: "history",
         selIndex: "0",
       },
     };
   },
 
   async function(win) {
     info("Open the panel with dropmarker, type something, Enter.");
-    let dropmarkerWasHidden = win.gURLBar.dropmarker.hidden;
-    win.gURLBar.dropmarker.hidden = false;
+    Services.prefs.setBoolPref("browser.urlbar.openViewOnFocus", false);
     win.gURLBar.select();
     let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
     await UrlbarTestUtils.promisePopupOpen(win, () => {
       EventUtils.synthesizeMouseAtCenter(win.gURLBar.dropmarker, {}, win);
     });
     await promiseAutocompleteResultPopup("x", win, true);
     EventUtils.synthesizeKey("VK_RETURN", {}, win);
     await promise;
-    win.gURLBar.dropmarker.hidden = dropmarkerWasHidden;
+    Services.prefs.clearUserPref("browser.urlbar.openViewOnFocus");
     return {
       category: "urlbar",
       method: "engagement",
       object: "enter",
       value: "topsites",
       extra: {
         elapsed: val => parseInt(val) > 0,
         numChars: "1",
@@ -837,30 +836,29 @@ const tests = [
         elapsed: val => parseInt(val) > 0,
         numChars: "0",
       },
     };
   },
 
   async function(win) {
     info("Open the panel with dropmarker, type something, blur it.");
-    let dropmarkerWasHidden = win.gURLBar.dropmarker.hidden;
-    win.gURLBar.dropmarker.hidden = false;
+    Services.prefs.setBoolPref("browser.urlbar.openViewOnFocus", false);
     await BrowserTestUtils.withNewTab(
       { gBrowser: win.gBrowser, url: "about:blank" },
       async browser => {
         win.gURLBar.select();
         await UrlbarTestUtils.promisePopupOpen(win, () => {
           EventUtils.synthesizeMouseAtCenter(gURLBar.dropmarker, {}, win);
         });
         EventUtils.synthesizeKey("x", {}, win);
         win.gURLBar.blur();
       }
     );
-    win.gURLBar.dropmarker.hidden = dropmarkerWasHidden;
+    Services.prefs.clearUserPref("browser.urlbar.openViewOnFocus");
     return {
       category: "urlbar",
       method: "abandonment",
       object: "blur",
       value: "topsites",
       extra: {
         elapsed: val => parseInt(val) > 0,
         numChars: "1",