Bug 1923212 - Skip tests that fail with ScotchBonnet enabled. r=mak,settings-reviewers,sessionstore-reviewers,urlbar-reviewers,dao,Gijs

Differential Revision: https://phabricator.services.mozilla.com/D224633
This commit is contained in:
Dale Harvey 2024-10-20 08:35:05 +00:00
parent 7ac8eff937
commit 0974234a5b
68 changed files with 207 additions and 33 deletions

View File

@ -84,6 +84,10 @@ class TipTestProvider extends UrlbarProvider {
// Check that the URL bar manages accessibility focus appropriately.
async function runTests() {
// TODO: Remove in https://bugzilla.mozilla.org/show_bug.cgi?id=1923383
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
registerCleanupFunction(async function () {
await UrlbarTestUtils.promisePopupClose(window);
await PlacesUtils.history.clear();

View File

@ -9,7 +9,10 @@ function focus_in_navbar() {
return parent != null;
}
const SCOTCH_BONNET_PREF = "browser.urlbar.scotchBonnet.enableOverride";
function test() {
Services.prefs.setBoolPref(SCOTCH_BONNET_PREF, false);
// Put the home button in the pre-proton placement to test focus states.
CustomizableUI.addWidgetToArea(
"home-button",
@ -17,6 +20,7 @@ function test() {
CustomizableUI.getPlacementOfWidget("stop-reload-button").position + 1
);
registerCleanupFunction(async function resetToolbar() {
Services.prefs.clearUserPref(SCOTCH_BONNET_PREF);
await CustomizableUI.reset();
});

View File

@ -120,6 +120,8 @@ const BOOKMARKS_COUNT = 100;
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [
// TODO: Reenable in https://bugzilla.mozilla.org/show_bug.cgi?id=1923388
["browser.urlbar.scotchBonnet.enableOverride", false],
["browser.toolbars.keyboard_navigation", true],
["accessibility.tabfocus", 7],
],

View File

@ -22,6 +22,8 @@ prefs = [
"extensions.screenshots.disabled=false",
# Need to keep the revamped sidebar off until Bug 1905212 is done
"sidebar.revamp=false",
# TODO: Renable in Bug 1923381
"browser.urlbar.scotchBonnet.enableOverride=false",
]
support-files = ["head.js"]

View File

@ -2,13 +2,19 @@
* 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 SCOTCH_BONNET_PREF = "browser.urlbar.scotchBonnet.enableOverride";
function test() {
waitForExplicitFinish();
Services.prefs.setBoolPref(SCOTCH_BONNET_PREF, false);
ok(PopupNotifications, "PopupNotifications object exists");
ok(PopupNotifications.panel, "PopupNotifications panel exists");
setup();
registerCleanupFunction(() => {
Services.prefs.clearUserPref(SCOTCH_BONNET_PREF);
});
}
const FALLBACK_ANCHOR = gURLBar.searchButton

View File

@ -17,6 +17,9 @@ registerCleanupFunction(async function resetToolbar() {
});
add_task(async function setupHomeButton() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// Put the home button in the pre-proton placement to test focus states.
CustomizableUI.addWidgetToArea(
"home-button",

View File

@ -82,6 +82,9 @@ var tests = [
];
add_task(async function test() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
ok(gIdentityHandler, "gIdentityHandler should exist");
await BrowserTestUtils.openNewForegroundTab(gBrowser);

View File

@ -14,11 +14,13 @@ ChromeUtils.defineESModuleGetters(this, {
});
let gTree;
const isRestrictKeywordsFeatureOn = UrlbarPrefs.getScotchBonnetPref(
"searchRestrictKeywords.featureGate"
);
const isRestrictKeywordsFeatureOn = () =>
UrlbarPrefs.getScotchBonnetPref("searchRestrictKeywords.featureGate");
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
let prefs = await openPreferencesViaOpenPreferencesAPI("search", {
leaveOpen: true,
});
@ -165,10 +167,10 @@ add_task(async function keywordNotEditable_enterKey() {
let keyword = tokenToKeyword.get(shortcut.restrict).toLowerCase();
Assert.equal(
gTree.view.getCellText(row, col),
isRestrictKeywordsFeatureOn
isRestrictKeywordsFeatureOn()
? `@${keyword}, ${shortcut.restrict}`
: shortcut.restrict,
isRestrictKeywordsFeatureOn
isRestrictKeywordsFeatureOn()
? "Sanity check: Keyword column has correct restriction keyword and char initially"
: "Sanity check: Keyword column has correct restriction char initially"
);
@ -184,10 +186,10 @@ add_task(async function keywordNotEditable_enterKey() {
Assert.equal(
gTree.view.getCellText(row, col),
isRestrictKeywordsFeatureOn
isRestrictKeywordsFeatureOn()
? `@${keyword}, ${shortcut.restrict}`
: shortcut.restrict,
isRestrictKeywordsFeatureOn
isRestrictKeywordsFeatureOn()
? "Keyword column is still restriction keyword and char"
: "Keyword column is still restriction char"
);
@ -207,10 +209,10 @@ add_task(async function keywordNotEditable_click() {
);
Assert.equal(
gTree.view.getCellText(row, col),
isRestrictKeywordsFeatureOn
isRestrictKeywordsFeatureOn()
? `@${keyword}, ${shortcut.restrict}`
: shortcut.restrict,
isRestrictKeywordsFeatureOn
isRestrictKeywordsFeatureOn()
? "Sanity check: Keyword column has correct restriction keyword and char initially"
: "Sanity check: Keyword column has correct restriction char initially"
);
@ -250,10 +252,10 @@ add_task(async function keywordNotEditable_click() {
Assert.equal(
gTree.view.getCellText(row, col),
isRestrictKeywordsFeatureOn
isRestrictKeywordsFeatureOn()
? `@${keyword}, ${shortcut.restrict}`
: shortcut.restrict,
isRestrictKeywordsFeatureOn
isRestrictKeywordsFeatureOn()
? "Keyword column is still restriction keyword and char"
: "Keyword column is still restriction char"
);

View File

@ -8,6 +8,10 @@ const { SearchUtils } = ChromeUtils.importESModule(
"resource://gre/modules/SearchUtils.sys.mjs"
);
add_task(async function test_restore_functionality() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// Ensure no engines are hidden to begin with.
for (let engine of await Services.search.getAppProvidedEngines()) {
if (engine.hidden) {

View File

@ -10,7 +10,10 @@ add_task(async function test_label_and_icon() {
// Make sure that tabs are restored on demand as otherwise the tab will start
// loading immediately and we can't check its icon and label.
await SpecialPowers.pushPrefEnv({
set: [["browser.sessionstore.restore_on_demand", true]],
set: [
["browser.sessionstore.restore_on_demand", true],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
// Create a new tab.

View File

@ -18,6 +18,9 @@ ChromeUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
});
add_task(async function test() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// Open the urlbar view and enter search mode.
await UrlbarTestUtils.promiseAutocompleteResultPopup({
window,

View File

@ -48,6 +48,7 @@ add_setup(async function () {
// Set following prefs so tips are actually shown.
["browser.laterrun.bookkeeping.profileCreationTime", 0],
["browser.laterrun.bookkeeping.updateAppliedTime", 0],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});

View File

@ -8,6 +8,12 @@
const HELP_URL = "about:mozilla";
const TIP_URL = "about:about";
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
});
add_task(async function tipIsSecondResult() {
let results = [
new UrlbarResult(

View File

@ -40,6 +40,9 @@ async function testVal(urlFormatString, clobberedURLString = null) {
}
add_task(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
const PREF_FORMATTING = "browser.urlbar.formatting.enabled";
const PREF_TRIM_HTTPS = "browser.urlbar.trimHttps";

View File

@ -36,6 +36,7 @@ add_task(async function test_strikeout_on_no_https_trimming() {
await SpecialPowers.pushPrefEnv({
set: [
["browser.urlbar.trimHttps", false],
["browser.urlbar.scotchBonnet.enableOverride", false],
["security.insecure_connection_text.enabled", false],
["security.mixed_content.block_active_content", false],
],

View File

@ -9,7 +9,10 @@ const SEARCH_STRING = "chocolate cake";
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.showSearchTerms.featureGate", true]],
set: [
["browser.urlbar.showSearchTerms.featureGate", true],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
let cleanup = await installPersistTestEngines();
registerCleanupFunction(async function () {

View File

@ -45,6 +45,7 @@ function testValues(trimmedProtocol, notTrimmedProtocol) {
add_task(async function () {
const PREF_TRIM_URLS = "browser.urlbar.trimURLs";
const PREF_TRIM_HTTPS = "browser.urlbar.trimHttps";
const PREF_SCOTCHBONNET = "browser.urlbar.scotchBonnet.enableOverride";
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
@ -52,10 +53,12 @@ add_task(async function () {
BrowserTestUtils.removeTab(tab);
Services.prefs.clearUserPref(PREF_TRIM_URLS);
Services.prefs.clearUserPref(PREF_TRIM_HTTPS);
Services.prefs.clearUserPref(PREF_SCOTCHBONNET);
gURLBar.setURI();
});
Services.prefs.setBoolPref(PREF_TRIM_HTTPS, false);
Services.prefs.setBoolPref(PREF_SCOTCHBONNET, false);
// Avoid search service sync init warnings due to URIFixup, when running the
// test alone.

View File

@ -16,7 +16,10 @@
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
// The example.com engine can interfere with this test.
set: [["browser.urlbar.suggest.engines", false]],
set: [
["browser.urlbar.suggest.engines", false],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
await cleanUp();
});

View File

@ -79,6 +79,10 @@ function forceGC() {
}
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
await initAccessibilityService();
});

View File

@ -47,6 +47,9 @@ function assertSelected_one_off(index) {
}
add_task(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
let maxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,

View File

@ -9,6 +9,9 @@
*/
add_task(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
registerCleanupFunction(async function () {
await PlacesUtils.bookmarks.eraseEverything();
});

View File

@ -16,6 +16,7 @@ add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [
["browser.urlbar.clipboard.featureGate", true],
["browser.urlbar.scotchBonnet.enableOverride", false],
["browser.urlbar.suggest.clipboard", true],
],
});

View File

@ -25,6 +25,7 @@ async function test_copy_values(testValues, trimHttps) {
await SpecialPowers.pushPrefEnv({
set: [
["browser.urlbar.scotchBonnet.enableOverride", false],
["browser.urlbar.trimURLs", true],
["browser.urlbar.trimHttps", trimHttps],
// avoid prompting about phishing

View File

@ -9,6 +9,9 @@ const ORIGINAL_CHUNK_RESULTS_DELAY =
UrlbarProvidersManager.CHUNK_RESULTS_DELAY_MS;
add_setup(async function setup() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
let suggestionsEngine = await SearchTestUtils.installOpenSearchEngine({
url: getRootDirectory(gTestPath) + "searchSuggestionEngine.xml",
});

View File

@ -9,6 +9,9 @@
// When the heuristic result is not the first result added, it should still be
// selected.
add_task(async function slowHeuristicSelected() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// First, add a provider that adds a heuristic result on a delay. Both this
// provider and the one below have a high priority so that only they are used
// during the test.

View File

@ -81,6 +81,7 @@ add_setup(async function () {
set: [
// We don't want autofill to influence this test.
["browser.urlbar.autoFill", false],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
registerCleanupFunction(async () => {

View File

@ -18,6 +18,12 @@ ChromeUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
let originalEngine;
let newEngine;
add_setup(async () => {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
});
// The one-off context menu should not be shown.
add_task(async function contextMenu_not_shown() {
// Add a popupshown listener on the context menu that sets this

View File

@ -279,6 +279,12 @@ add_setup(async function () {
);
});
add_setup(async () => {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
});
add_task(async function arrow_engine_url() {
await doArrowTest("mozilla.or", UrlbarUtils.RESULT_TYPE.URL, false);
});

View File

@ -39,7 +39,7 @@ add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [
["browser.search.separatePrivateDefault.ui.enabled", false],
["browser.urlbar.suggest.quickactions", false],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});

View File

@ -25,6 +25,7 @@ add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [
["browser.urlbar.suggest.searches", true],
["browser.urlbar.scotchBonnet.enableOverride", false],
["browser.urlbar.maxHistoricalSearchSuggestions", 2],
],
});

View File

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

View File

@ -36,6 +36,9 @@ var noEngineString;
SearchTestUtils.init(this);
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
let originalOrder = (await Services.search.getEngines()).map(e => e.id);
await SearchTestUtils.updateRemoteSettingsConfig(CONFIG);
appDefaultEngine = await Services.search.getDefault();

View File

@ -35,7 +35,7 @@ add_setup(async function () {
await TestUtils.waitForTick();
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.suggest.quickactions", false]],
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// Add some URLs to populate both history and top sites. Each URL needs to

View File

@ -6,6 +6,9 @@ ChromeUtils.defineESModuleGetters(this, {
});
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
await SearchTestUtils.installSearchExtension({}, { setAsDefault: true });
let engine = Services.search.getEngineByName("Example");

View File

@ -14,6 +14,9 @@ const DEFAULT_HELP_URL =
"awesome-bar-result-menu";
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// Add enough results to fill up the view.
await PlacesUtils.history.clear();
for (let i = 0; i < MAX_RESULTS; i++) {

View File

@ -4,6 +4,10 @@
"use strict";
add_task(async function test() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
let results = [
new UrlbarResult(
UrlbarUtils.RESULT_TYPE.URL,

View File

@ -9,6 +9,9 @@ const ALIAS = "@enginealias";
let aliasEngine;
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// Run this in a new tab, to ensure all the locationchange notifications have
// fired.
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);

View File

@ -674,9 +674,11 @@ add_task(async function test_open_state() {
add_task(async function nimbusScotchBonnetEnableOverride() {
info("Setup initial local pref");
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
let defaultBranch = Services.prefs.getDefaultBranch("browser.urlbar.");
let initialValue = defaultBranch.getBoolPref("scotchBonnet.enableOverride");
defaultBranch.setBoolPref("scotchBonnet.enableOverride", false);
UrlbarPrefs.clear("scotchBonnet.enableOverride");
await TestUtils.waitForCondition(() => {
return BrowserTestUtils.isHidden(
gURLBar.querySelector("#urlbar-searchmode-switcher")
@ -697,7 +699,10 @@ add_task(async function nimbusScotchBonnetEnableOverride() {
Assert.ok(true, "Search mode switcher should be visible");
await cleanUpNimbusEnable();
await SpecialPowers.popPrefEnv();
defaultBranch.setBoolPref("scotchBonnet.enableOverride", initialValue);
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", true]],
});
});
add_task(async function nimbusLogEnabled() {

View File

@ -19,6 +19,9 @@ const TEST_SPACES = [" ", "\u3000", " \u3000", "\u3000 "];
let defaultEngine, aliasEngine;
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
defaultEngine = await SearchTestUtils.installOpenSearchEngine({
url: getRootDirectory(gTestPath) + TEST_ENGINE_BASENAME,
setAsDefault: true,

View File

@ -18,7 +18,7 @@ add_setup(async function () {
await Services.search.moveEngine(defaultEngine, 0);
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.suggest.quickactions", false]],
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
registerCleanupFunction(async () => {

View File

@ -16,6 +16,9 @@ const LINK_PAGE_URL =
// branches in setURI. Search mode should be exited in all cases, and the href
// in the link should be opened.
add_task(async function clickLink() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
for (let test of [
// searchString, href to use in the link
[LINK_PAGE_URL, LINK_PAGE_URL],

View File

@ -10,6 +10,9 @@
// Tests that we exit search mode in the active tab when the search mode engine
// is removed.
add_task(async function activeTab() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
let extension = await SearchTestUtils.installSearchExtension(
{},
{ skipUnload: true }

View File

@ -19,6 +19,7 @@ add_setup(async function () {
["browser.urlbar.autoFill", false],
// Special prefs for remote tabs.
["services.sync.username", "fake"],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});

View File

@ -8,6 +8,9 @@
"use strict";
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
await PlacesUtils.history.clear();
await PlacesUtils.bookmarks.eraseEverything();

View File

@ -23,6 +23,9 @@ let suggestionsEngine;
let defaultEngine;
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
suggestionsEngine = await SearchTestUtils.installOpenSearchEngine({
url: getRootDirectory(gTestPath) + SUGGESTIONS_ENGINE_NAME,
});

View File

@ -11,7 +11,10 @@
add_task(async function test() {
// Avoid remote connections.
await SpecialPowers.pushPrefEnv({
set: [["browser.search.suggest.enabled", false]],
set: [
["browser.search.suggest.enabled", false],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
await BrowserTestUtils.withNewTab("about:robots", async () => {

View File

@ -17,8 +17,7 @@ add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [
["browser.urlbar.suggest.searches", true],
["browser.urlbar.suggest.quickactions", false],
["browser.urlbar.shortcuts.quickactions", false],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
engine = await SearchTestUtils.installOpenSearchEngine({

View File

@ -29,6 +29,7 @@ add_setup(async function () {
"browser.newtabpage.activity-stream.default.sites",
"http://example.com/",
],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
await updateTopSites(sites => sites.length);

View File

@ -9,6 +9,9 @@
const ENGINE_NAME = "Example";
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
await SearchTestUtils.installSearchExtension({
name: ENGINE_NAME,
});

View File

@ -10,6 +10,9 @@
const TEST_ENGINE_NAME = "test engine";
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
await SearchTestUtils.installSearchExtension({
name: TEST_ENGINE_NAME,
keyword: "@test",

View File

@ -10,6 +10,9 @@
const BOOKMARK_URL = "http://www.example.com/browser_searchMode_pickResult.js";
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// Add a bookmark so we can enter bookmarks search mode and pick it.
await PlacesUtils.bookmarks.eraseEverything();
await PlacesUtils.bookmarks.insert({

View File

@ -16,7 +16,7 @@ add_setup(async function () {
});
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.suggest.quickactions", false]],
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
if (UrlbarPrefs.getScotchBonnetPref("searchRestrictKeywords.featureGate")) {
await SpecialPowers.pushPrefEnv({

View File

@ -27,6 +27,11 @@ const URL = "http://example.com/";
const INITIAL_URL = "about:newtab";
// The following tasks make sure non-null search mode is restored.
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
});
add_task(async function initialPageOnRestore() {
await doTest({

View File

@ -13,6 +13,9 @@
// in order to hit different branches in setURI. Search mode should remain
// active or be exited as appropriate.
add_task(async function setURI() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
for (let test of [
// initialURL, searchString, url, expectSearchMode

View File

@ -66,7 +66,7 @@ add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [
["browser.search.separatePrivateDefault.ui.enabled", false],
["browser.urlbar.suggest.quickactions", false],
["browser.urlbar.scotchBonnet.enableOverride", false],
["browser.urlbar.suggest.trending", false],
["browser.urlbar.suggest.recentsearches", false],
],
@ -112,7 +112,6 @@ add_task(async function emptySearch_behavior() {
},
]);
await UrlbarTestUtils.promisePopupClose(window);
await SpecialPowers.popPrefEnv();
});
await PlacesUtils.history.clear();
@ -141,7 +140,6 @@ add_task(async function emptySearch_local() {
]);
await UrlbarTestUtils.exitSearchMode(window, { clickClose: true });
await UrlbarTestUtils.promisePopupClose(window);
await SpecialPowers.popPrefEnv();
});
await PlacesUtils.history.clear();

View File

@ -10,7 +10,7 @@
// Enters search mode using the one-off buttons.
add_task(async function switchTabs() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.suggest.quickactions", false]],
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// Open three tabs. We'll enter search mode in tabs 0 and 2.

View File

@ -4,6 +4,9 @@
"use strict";
add_task(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
await BrowserTestUtils.withNewTab(
{ gBrowser, url: "about:blank" },
async function () {

View File

@ -3,6 +3,9 @@
let gDNSResolved = false;
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
registerCleanupFunction(function () {
Services.prefs.clearUserPref("browser.fixup.domainwhitelist.localhost");
});

View File

@ -13,7 +13,7 @@ ChromeUtils.defineESModuleGetters(this, {
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.suggest.quickactions", false]],
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// We'll later replace this, so ensure it's restored.

View File

@ -10,6 +10,9 @@
const MAX_RESULTS = UrlbarPrefs.get("maxRichResults");
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
for (let i = 0; i < MAX_RESULTS; i++) {
await PlacesTestUtils.addVisits("http://example.com/" + i);
}

View File

@ -15,7 +15,10 @@ const BASE_URL =
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.suggest.searches", false]],
set: [
["browser.urlbar.suggest.searches", false],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
// Ensure initial state.
UrlbarTestUtils.getOneOffSearchButtons(window).invalidateCache();

View File

@ -11,6 +11,9 @@
const TEST_URL = `${TEST_BASE_URL}dummy_page.html`;
add_task(async function test_with_oneoff_button() {
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
info("Loading test page into first tab");
let promiseLoad = BrowserTestUtils.browserLoaded(
gBrowser.selectedBrowser,

View File

@ -14,7 +14,10 @@ add_setup(async function () {
false
);
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.suggest.quickactions", false]],
set: [
["browser.urlbar.suggest.quickactions", false],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
for (let i = 0; i < UrlbarPrefs.get("maxRichResults"); i++) {

View File

@ -25,6 +25,7 @@ add_setup(async function () {
// Disable onboarding results for general tests. They are enabled in tests
// that specifically address onboarding.
["browser.urlbar.tabToSearch.onboard.interactionsLeft", 0],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});

View File

@ -37,7 +37,10 @@ add_setup(async function () {
// Search results aren't shown in quantumbar unless search suggestions are
// enabled.
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.suggest.searches", true]],
set: [
["browser.urlbar.suggest.searches", true],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});
// When typing `@`, we are getting token alias engine results and restrict

View File

@ -128,6 +128,10 @@ add_setup(async function () {
set: [["browser.urlbar.showSearchSuggestionsFirst", false]],
});
await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
});
// Make sure to restore the engine once we're done.
registerCleanupFunction(async function () {
Services.telemetry.canRecordExtended = oldCanRecord;

View File

@ -87,6 +87,7 @@ add_setup(async function () {
// Disable tab-to-search onboarding results for general tests. They are
// enabled in tests that specifically address onboarding.
["browser.urlbar.tabToSearch.onboard.interactionsLeft", 0],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});

View File

@ -400,6 +400,7 @@ async function setup() {
["browser.urlbar.searchEngagementTelemetry.enabled", true],
["browser.urlbar.quickactions.enabled", true],
["browser.urlbar.secondaryActions.featureGate", true],
["browser.urlbar.scotchBonnet.enableOverride", false],
],
});