Bug 1628926 - Remove the browser.urlbar.oneOffSearches pref. r=dao

Differential Revision: https://phabricator.services.mozilla.com/D70921

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Drew Willcoxon 2020-04-16 00:00:55 +00:00
parent 54e45ef6b0
commit a6b80b0e24
13 changed files with 2 additions and 37 deletions

View File

@ -288,8 +288,6 @@ pref("browser.urlbar.maxCharsForSearchSuggestions", 20);
pref("browser.urlbar.formatting.enabled", true);
pref("browser.urlbar.trimURLs", true);
pref("browser.urlbar.oneOffSearches", true);
// If changed to true, copying the entire URL from the location bar will put the
// human readable (percent-decoded) URL on the clipboard.
pref("browser.urlbar.decodeURLsOnCopy", false);

View File

@ -8,7 +8,6 @@ const TEST_ENGINE_NAME = "Foo";
const TEST_ENGINE_BASENAME = "testEngine.xml";
const SEARCHBAR_BASE_ID = "searchbar-engine-one-off-item-";
const URLBAR_BASE_ID = "urlbar-engine-one-off-item-";
const ONEOFF_URLBAR_PREF = "browser.urlbar.oneOffSearches";
let originalEngine;
let originalPrivateEngine;
@ -114,10 +113,6 @@ async function testUrlBarChangeEngine(win, testPrivate, isPrivateWindow) {
info(
`Testing urlbar with testPrivate: ${testPrivate} isPrivateWindow: ${isPrivateWindow}`
);
Services.prefs.setBoolPref(ONEOFF_URLBAR_PREF, true);
registerCleanupFunction(function() {
Services.prefs.clearUserPref(ONEOFF_URLBAR_PREF);
});
// Ensure the engine is reset.
await resetEngines();

View File

@ -89,9 +89,6 @@ const PREF_URLBAR_DEFAULTS = new Map([
// The maximum number of results in the urlbar popup.
["maxRichResults", 10],
// One-off search buttons enabled status.
["oneOffSearches", false],
// Whether addresses and search results typed into the address bar
// should be opened in new tabs by default.
["openintab", false],

View File

@ -1304,7 +1304,7 @@ class UrlbarView {
}
_enableOrDisableOneOffSearches(enable = true) {
if (enable && UrlbarPrefs.get("oneOffSearches")) {
if (enable) {
this.oneOffSearchButtons.telemetryOrigin = "urlbar";
this.oneOffSearchButtons.style.display = "";
this.oneOffSearchButtons.textbox = this.input.inputField;

View File

@ -8,8 +8,6 @@
* around the results list.
*/
const ONEOFF_URLBAR_PREF = "browser.urlbar.oneOffSearches";
function repeat(limit, func) {
for (let i = 0; i < limit; i++) {
func(i);
@ -57,14 +55,12 @@ function assertSelected_one_off(index) {
add_task(async function() {
let maxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
Services.prefs.setBoolPref(ONEOFF_URLBAR_PREF, true);
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"about:mozilla"
);
registerCleanupFunction(async function() {
await PlacesUtils.history.clear();
Services.prefs.clearUserPref(ONEOFF_URLBAR_PREF);
BrowserTestUtils.removeTab(tab);
});

View File

@ -7,8 +7,6 @@
* Tests navigation between results using ctrl-n/p.
*/
const ONEOFF_URLBAR_PREF = "browser.urlbar.oneOffSearches";
function repeat(limit, func) {
for (let i = 0; i < limit; i++) {
func(i);
@ -33,14 +31,12 @@ function assertSelected(index) {
add_task(async function() {
let maxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
Services.prefs.setBoolPref(ONEOFF_URLBAR_PREF, true);
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"about:mozilla"
);
registerCleanupFunction(async function() {
await PlacesUtils.history.clear();
Services.prefs.clearUserPref(ONEOFF_URLBAR_PREF);
BrowserTestUtils.removeTab(tab);
});

View File

@ -7,7 +7,6 @@ XPCOMUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
});
add_task(async function init() {
Services.prefs.setBoolPref("browser.urlbar.oneOffSearches", true);
gMaxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
// Add a search suggestion engine and move it to the front so that it appears

View File

@ -21,7 +21,6 @@ let newEngine;
add_task(async function setup() {
SpecialPowers.pushPrefEnv({
set: [
["browser.urlbar.oneOffSearches", true],
// Avoid hitting the network with search suggestions.
["browser.urlbar.suggest.searches", false],
["browser.tabs.loadInBackground", true],

View File

@ -19,10 +19,7 @@ const serverInfo = {
add_task(async function init() {
await PlacesUtils.history.clear();
await SpecialPowers.pushPrefEnv({
set: [
["browser.urlbar.oneOffSearches", true],
["browser.urlbar.suggest.searches", true],
],
set: [["browser.urlbar.suggest.searches", true]],
});
let engine = await SearchTestUtils.promiseNewSearchEngine(
getRootDirectory(gTestPath) + TEST_ENGINE_BASENAME

View File

@ -11,9 +11,6 @@
let gMaxResults;
add_task(async function init() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.oneOffSearches", true]],
});
gMaxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
registerCleanupFunction(async function() {

View File

@ -16,7 +16,6 @@ add_task(async function setup() {
set: [
["browser.search.separatePrivateDefault.ui.enabled", true],
["browser.search.separatePrivateDefault", true],
["browser.urlbar.oneOffSearches", true],
["browser.urlbar.suggest.searches", true],
],
});

View File

@ -15,7 +15,6 @@ const SUGGEST_URLBAR_PREF = "browser.urlbar.suggest.searches";
// The name of the search engine used to generate suggestions.
const SUGGESTION_ENGINE_NAME =
"browser_UsageTelemetry usageTelemetrySearchSuggestions.xml";
const ONEOFF_URLBAR_PREF = "browser.urlbar.oneOffSearches";
XPCOMUtils.defineLazyModuleGetters(this, {
SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
@ -109,9 +108,6 @@ add_task(async function setup() {
let suggestionsEnabled = Services.prefs.getBoolPref(SUGGEST_URLBAR_PREF);
Services.prefs.setBoolPref(SUGGEST_URLBAR_PREF, true);
// Enable the urlbar one-off buttons.
Services.prefs.setBoolPref(ONEOFF_URLBAR_PREF, true);
// Enable local telemetry recording for the duration of the tests.
let oldCanRecord = Services.telemetry.canRecordExtended;
Services.telemetry.canRecordExtended = true;
@ -140,7 +136,6 @@ add_task(async function setup() {
await Services.search.setDefault(originalEngine);
await Services.search.removeEngine(engine);
Services.prefs.setBoolPref(SUGGEST_URLBAR_PREF, suggestionsEnabled);
Services.prefs.clearUserPref(ONEOFF_URLBAR_PREF);
await PlacesUtils.history.clear();
Services.telemetry.setEventRecordingEnabled("navigation", false);
});

View File

@ -16,7 +16,6 @@ const POPUP_URL_COLOR_BRIGHT = "#74c0ff";
const POPUP_ACTION_COLOR_BRIGHT = "#30e60b";
const SEARCH_TERM = "urlbar-reflows-" + Date.now();
const ONEOFF_URLBAR_PREF = "browser.urlbar.oneOffSearches";
XPCOMUtils.defineLazyModuleGetters(this, {
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.jsm",
@ -70,14 +69,12 @@ add_task(async function test_popup_url() {
await extension.startup();
let maxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
Services.prefs.setBoolPref(ONEOFF_URLBAR_PREF, true);
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"about:mozilla"
);
registerCleanupFunction(async function() {
await PlacesUtils.history.clear();
Services.prefs.clearUserPref(ONEOFF_URLBAR_PREF);
await BrowserTestUtils.removeTab(tab);
});