mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1755996 - Add pref for removal of search engine infobar. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D139044
This commit is contained in:
parent
5e6b8da43a
commit
9e18125789
@ -37,9 +37,6 @@ function submitHandler(request, response) {
|
||||
}
|
||||
|
||||
add_task(async function setup() {
|
||||
// This ensures the infobar is not shown in this test.
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
sinon.stub(BrowserSearch, "removalOfSearchEngineNotificationBox");
|
||||
// Ensure the initial init is complete.
|
||||
await Services.search.init();
|
||||
|
||||
@ -91,7 +88,6 @@ add_task(async function setup() {
|
||||
await PlacesUtils.history.clear();
|
||||
gCUITestUtils.removeSearchBar();
|
||||
await settingsWritten;
|
||||
sinon.restore();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -4109,6 +4109,7 @@ pref("browser.search.suggest.enabled", true);
|
||||
pref("browser.search.suggest.enabled.private", false);
|
||||
pref("browser.search.separatePrivateDefault", false);
|
||||
pref("browser.search.separatePrivateDefault.ui.enabled", false);
|
||||
pref("browser.search.removeEngineInfobar.enabled", true);
|
||||
|
||||
// GMPInstallManager prefs
|
||||
|
||||
|
@ -28,6 +28,8 @@ user_pref("browser.pagethumbnails.capturing_disabled", true);
|
||||
// Tell the search service we are running in the US. This also has the desired
|
||||
// side-effect of preventing our geoip lookup.
|
||||
user_pref("browser.search.region", "US");
|
||||
// disable infobar for tests
|
||||
user_pref("browser.search.removeEngineInfobar.enabled", false);
|
||||
// Disable webapp updates. Yes, it is supposed to be an integer.
|
||||
user_pref("browser.webapps.checkForUpdates", 0);
|
||||
// We do not wish to display datareporting policy notifications as it might
|
||||
|
@ -600,7 +600,8 @@ SearchService.prototype = {
|
||||
newCurrentEngine !== prevCurrentEngine &&
|
||||
prevMetaData &&
|
||||
settings.metaData &&
|
||||
!this._hasUserMetaDataChanged(prevMetaData)
|
||||
!this._hasUserMetaDataChanged(prevMetaData) &&
|
||||
Services.prefs.getBoolPref("browser.search.removeEngineInfobar.enabled")
|
||||
) {
|
||||
this._showRemovalOfSearchEngineNotificationBox(
|
||||
prevCurrentEngine,
|
||||
@ -837,7 +838,8 @@ SearchService.prototype = {
|
||||
if (
|
||||
prevMetaData &&
|
||||
settings.metaData &&
|
||||
!this._hasUserMetaDataChanged(prevMetaData)
|
||||
!this._hasUserMetaDataChanged(prevMetaData) &&
|
||||
Services.prefs.getBoolPref("browser.search.removeEngineInfobar.enabled")
|
||||
) {
|
||||
this._showRemovalOfSearchEngineNotificationBox(
|
||||
prevCurrentEngine.name,
|
||||
|
@ -4,17 +4,14 @@
|
||||
const kDefaultEngineName = "engine1";
|
||||
|
||||
add_task(async function setup() {
|
||||
// Stub removal of search engine notification box.
|
||||
// This ensures that BrowserSearch.win is not accessed in this test.
|
||||
sinon.stub(
|
||||
await Services.search.wrappedJSObject,
|
||||
"_showRemovalOfSearchEngineNotificationBox"
|
||||
);
|
||||
|
||||
useHttpServer();
|
||||
await AddonTestUtils.promiseStartupManager();
|
||||
await SearchTestUtils.useTestEngines("data1");
|
||||
Assert.ok(!Services.search.isInitialized);
|
||||
Services.prefs.setBoolPref(
|
||||
"browser.search.removeEngineInfobar.enabled",
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
// Check that the default engine matches the defaultenginename pref
|
||||
|
@ -4,6 +4,8 @@ head = head_search.js
|
||||
dupe-manifest =
|
||||
tags=searchmain
|
||||
skip-if = toolkit == 'android'
|
||||
prefs =
|
||||
browser.search.removeEngineInfobar.enabled=true
|
||||
|
||||
support-files =
|
||||
data/engine.xml
|
||||
|
Loading…
Reference in New Issue
Block a user