mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1525296 - Remove any remaining references to old search suggestions notifications. r=adw,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D50932 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
b28ed3c0db
commit
d973ff4e31
@ -299,11 +299,6 @@ pref("browser.urlbar.suggest.bookmark", true);
|
||||
pref("browser.urlbar.suggest.openpage", true);
|
||||
pref("browser.urlbar.suggest.searches", true);
|
||||
|
||||
// Whether the user made a choice in the old search suggestions opt-in bar.
|
||||
pref("browser.urlbar.userMadeSearchSuggestionsChoice", false);
|
||||
// The suggestion opt-out hint will be hidden after being shown 4 times.
|
||||
pref("browser.urlbar.timesBeforeHidingSuggestionsHint", 4);
|
||||
|
||||
// Limit the number of characters sent to the current search engine to fetch
|
||||
// suggestions.
|
||||
pref("browser.urlbar.maxCharsForSearchSuggestions", 20);
|
||||
|
@ -9,25 +9,14 @@ add_task(async function init() {
|
||||
// Run this in a new tab, to ensure all the locationchange notifications have
|
||||
// fired.
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
|
||||
let which = gURLBar._whichSearchSuggestionsNotification || undefined;
|
||||
registerCleanupFunction(async function() {
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
// Reset the search suggestions notification.
|
||||
if (which === undefined) {
|
||||
delete gURLBar._whichSearchSuggestionsNotification;
|
||||
} else {
|
||||
gURLBar._whichSearchSuggestionsNotification = which;
|
||||
}
|
||||
Services.prefs.clearUserPref("timesBeforeHidingSuggestionsHint");
|
||||
|
||||
gURLBar.handleRevert();
|
||||
});
|
||||
});
|
||||
|
||||
// Calls search() with a normal, non-"@engine" search-string argument.
|
||||
add_task(async function basic() {
|
||||
let resetNotification = enableSearchSuggestionsNotification();
|
||||
|
||||
gURLBar.blur();
|
||||
gURLBar.search("basic");
|
||||
ok(gURLBar.hasAttribute("focused"), "url bar is focused");
|
||||
@ -38,15 +27,11 @@ add_task(async function basic() {
|
||||
await UrlbarTestUtils.promisePopupClose(window, () =>
|
||||
EventUtils.synthesizeKey("KEY_Escape")
|
||||
);
|
||||
|
||||
resetNotification();
|
||||
});
|
||||
|
||||
// Calls search() with an "@engine" search engine alias so that the one-off
|
||||
// search buttons and search-suggestions notification are disabled.
|
||||
// search buttons are disabled.
|
||||
add_task(async function searchEngineAlias() {
|
||||
let resetNotification = enableSearchSuggestionsNotification();
|
||||
|
||||
gURLBar.blur();
|
||||
await UrlbarTestUtils.promisePopupOpen(window, () =>
|
||||
gURLBar.search("@example")
|
||||
@ -60,9 +45,8 @@ add_task(async function searchEngineAlias() {
|
||||
EventUtils.synthesizeKey("KEY_Escape")
|
||||
);
|
||||
|
||||
// Open the popup again (by doing another search) to make sure the
|
||||
// notification and one-off buttons are shown -- i.e., that we didn't
|
||||
// accidentally break them.
|
||||
// Open the popup again (by doing another search) to make sure the one-off
|
||||
// buttons are shown -- i.e., that we didn't accidentally break them.
|
||||
await UrlbarTestUtils.promisePopupOpen(window, () =>
|
||||
gURLBar.search("not an engine alias")
|
||||
);
|
||||
@ -72,14 +56,10 @@ add_task(async function searchEngineAlias() {
|
||||
await UrlbarTestUtils.promisePopupClose(window, () =>
|
||||
EventUtils.synthesizeKey("KEY_Escape")
|
||||
);
|
||||
|
||||
resetNotification();
|
||||
});
|
||||
|
||||
// Calls search() with a restriction character.
|
||||
add_task(async function searchRestriction() {
|
||||
let resetNotification = enableSearchSuggestionsNotification();
|
||||
|
||||
gURLBar.blur();
|
||||
await UrlbarTestUtils.promisePopupOpen(window, () =>
|
||||
gURLBar.search(UrlbarTokenizer.RESTRICT.SEARCH)
|
||||
@ -91,14 +71,10 @@ add_task(async function searchRestriction() {
|
||||
assertOneOffButtonsVisible(false);
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
|
||||
resetNotification();
|
||||
});
|
||||
|
||||
// Calls search() twice with the same value. The popup should reopen.
|
||||
add_task(async function searchTwice() {
|
||||
let resetNotification = enableSearchSuggestionsNotification();
|
||||
|
||||
gURLBar.blur();
|
||||
await UrlbarTestUtils.promisePopupOpen(window, () => gURLBar.search("test"));
|
||||
ok(gURLBar.hasAttribute("focused"), "url bar is focused");
|
||||
@ -111,14 +87,10 @@ add_task(async function searchTwice() {
|
||||
await assertUrlbarValue("test");
|
||||
assertOneOffButtonsVisible(true);
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
|
||||
resetNotification();
|
||||
});
|
||||
|
||||
// Calls search() during an IME composition.
|
||||
add_task(async function searchIME() {
|
||||
let resetNotification = enableSearchSuggestionsNotification();
|
||||
|
||||
// First run a search.
|
||||
gURLBar.blur();
|
||||
await UrlbarTestUtils.promisePopupOpen(window, () => gURLBar.search("test"));
|
||||
@ -143,31 +115,8 @@ add_task(async function searchIME() {
|
||||
assertOneOffButtonsVisible(true);
|
||||
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
|
||||
resetNotification();
|
||||
});
|
||||
|
||||
/**
|
||||
* Makes sure the search-suggestions notification will be shown the next several
|
||||
* times the popup opens.
|
||||
*
|
||||
* @returns {function} A function that you should call when you're done that
|
||||
* resets the state state of the notification.
|
||||
*/
|
||||
function enableSearchSuggestionsNotification() {
|
||||
let which = gURLBar._whichSearchSuggestionsNotification || undefined;
|
||||
gURLBar._whichSearchSuggestionsNotification = "opt-out";
|
||||
Services.prefs.setIntPref("timesBeforeHidingSuggestionsHint", 10);
|
||||
return function reset() {
|
||||
if (which === undefined) {
|
||||
delete gURLBar._whichSearchSuggestionsNotification;
|
||||
} else {
|
||||
gURLBar._whichSearchSuggestionsNotification = which;
|
||||
}
|
||||
Services.prefs.clearUserPref("timesBeforeHidingSuggestionsHint");
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the one-off search buttons are or aren't visible.
|
||||
*
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"browser.tabs.remote.separatePrivilegedContentProcess": true,
|
||||
"browser.urlbar.userMadeSearchSuggestionsChoice": true,
|
||||
"javascript.options.asyncstack": false,
|
||||
"image.mem.surfacecache.min_expiration_ms": 10000,
|
||||
"network.proxy.socks": "localhost",
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"browser.newtabpage.enabled": true,
|
||||
"browser.tabs.remote.separatePrivilegedContentProcess": true,
|
||||
"browser.urlbar.userMadeSearchSuggestionsChoice": true,
|
||||
"javascript.options.asyncstack": false,
|
||||
"image.mem.surfacecache.min_expiration_ms": 10000,
|
||||
"network.proxy.socks": "localhost",
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"browser.newtabpage.enabled": true,
|
||||
"browser.tabs.remote.separatePrivilegedContentProcess": true,
|
||||
"browser.urlbar.userMadeSearchSuggestionsChoice": true,
|
||||
"javascript.options.asyncstack": false,
|
||||
"image.mem.surfacecache.min_expiration_ms": 10000,
|
||||
"network.proxy.http": "localhost",
|
||||
|
@ -594,10 +594,6 @@ class DesktopInstance(GeckoInstance):
|
||||
# connections.
|
||||
"browser.urlbar.suggest.searches": False,
|
||||
|
||||
# Turn off the location bar search suggestions opt-in. It interferes with
|
||||
# tests that don't expect it to be there.
|
||||
"browser.urlbar.userMadeSearchSuggestionsChoice": True,
|
||||
|
||||
# Don't warn when exiting the browser
|
||||
"browser.warnOnQuit": False,
|
||||
|
||||
|
@ -34,9 +34,6 @@ user_pref("browser.safebrowsing.provider.mozilla.updateURL", "http://127.0.0.1/s
|
||||
user_pref("browser.search.geoip.url", "");
|
||||
user_pref("browser.shell.checkDefaultBrowser", false);
|
||||
user_pref("browser.tabs.remote.autostart", true);
|
||||
// Turn off the location bar search suggestions opt-in. It interferes with
|
||||
// tests that don't expect it to be there.
|
||||
user_pref("browser.urlbar.userMadeSearchSuggestionsChoice", true);
|
||||
user_pref("browser.warnOnQuit", false);
|
||||
user_pref("datareporting.healthreport.documentServerURI", "http://127.0.0.1/healthreport/");
|
||||
user_pref("devtools.chrome.enabled", false);
|
||||
|
@ -68,9 +68,6 @@ user_pref("browser.urlbar.speculativeConnect.enabled", false);
|
||||
// connections.
|
||||
user_pref("browser.urlbar.suggest.searches", false);
|
||||
user_pref("browser.urlbar.usepreloadedtopurls.enabled", false);
|
||||
// Turn off the location bar search suggestions opt-in. It interferes with
|
||||
// tests that don't expect it to be there.
|
||||
user_pref("browser.urlbar.userMadeSearchSuggestionsChoice", true);
|
||||
user_pref("browser.warnOnQuit", false);
|
||||
// Enable webapps testing mode, which bypasses native installation.
|
||||
user_pref("browser.webapps.testing", true);
|
||||
|
@ -245,9 +245,6 @@
|
||||
"browser/base/content/test/urlbar/browser_urlbarOneOffs_searchSuggestions.js": 3654,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js": 16459,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js": 4085,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js": 10786,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSuggestions_opt-in.js": 8813,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSuggestions_opt-out.js": 4153,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js": 5768,
|
||||
"browser/base/content/test/urlbar/browser_urlbar_autoFill_backspaced.js": 5194,
|
||||
"browser/base/content/test/urlbar/browser_urlbar_blanking.js": 3831,
|
||||
|
@ -238,9 +238,6 @@
|
||||
"browser/base/content/test/urlbar/browser_urlbarRaceWithTabs.js": 1781,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js": 15180,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js": 2747,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js": 9662,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSuggestions_opt-in.js": 8019,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchSuggestions_opt-out.js": 2967,
|
||||
"browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js": 4201,
|
||||
"browser/base/content/test/urlbar/browser_urlbarUpdateForDomainCompletion.js": 2649,
|
||||
"browser/base/content/test/urlbar/browser_urlbar_autoFill_backspaced.js": 5169,
|
||||
|
@ -244,10 +244,6 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([
|
||||
["browser.startup.page", { what: RECORD_PREF_VALUE }],
|
||||
["toolkit.cosmeticAnimations.enabled", { what: RECORD_PREF_VALUE }],
|
||||
["browser.urlbar.suggest.searches", { what: RECORD_PREF_VALUE }],
|
||||
[
|
||||
"browser.urlbar.userMadeSearchSuggestionsChoice",
|
||||
{ what: RECORD_PREF_VALUE },
|
||||
],
|
||||
["devtools.chrome.enabled", { what: RECORD_PREF_VALUE }],
|
||||
["devtools.debugger.enabled", { what: RECORD_PREF_VALUE }],
|
||||
["devtools.debugger.remote-enabled", { what: RECORD_PREF_VALUE }],
|
||||
|
@ -380,8 +380,6 @@ The following is a partial list of collected preferences.
|
||||
|
||||
- ``browser.urlbar.suggest.searches``: True if search suggestions are enabled in the urlbar. Defaults to false.
|
||||
|
||||
- ``browser.urlbar.userMadeSearchSuggestionsChoice``: True if the user has clicked Yes or No in the urlbar's opt-in notification. Defaults to false.
|
||||
|
||||
- ``browser.zoom.full`` (deprecated): True if zoom is enabled for both text and images, that is if "Zoom Text Only" is not enabled. Defaults to true. This preference was collected in Firefox 50 to 52 (`Bug 979323 <https://bugzilla.mozilla.org/show_bug.cgi?id=979323>`_).
|
||||
|
||||
- ``fission.autostart``: True if fission is enabled at startup. Default to false. For more information please visit `the project wiki page <https://wiki.mozilla.org/Project_Fission>`_.
|
||||
|
Loading…
Reference in New Issue
Block a user