diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /toolkit/components/search/tests/xpcshell/test_remove_engine_notification_box.js | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/search/tests/xpcshell/test_remove_engine_notification_box.js')
-rw-r--r-- | toolkit/components/search/tests/xpcshell/test_remove_engine_notification_box.js | 112 |
1 files changed, 108 insertions, 4 deletions
diff --git a/toolkit/components/search/tests/xpcshell/test_remove_engine_notification_box.js b/toolkit/components/search/tests/xpcshell/test_remove_engine_notification_box.js index 0222334255..d5b1366b93 100644 --- a/toolkit/components/search/tests/xpcshell/test_remove_engine_notification_box.js +++ b/toolkit/components/search/tests/xpcshell/test_remove_engine_notification_box.js @@ -57,6 +57,100 @@ const CONFIG_UPDATED = CONFIG.filter(r => r.webExtension.id.startsWith("engine-pref") ); +const CONFIG_V2 = [ + { + recordType: "engine", + identifier: "engine", + base: { + name: "Test search engine", + urls: { + search: { + base: "https://www.google.com/search", + searchTermParamName: "q", + }, + }, + }, + variants: [ + { + environment: { allRegionsAndLocales: true }, + }, + ], + }, + { + recordType: "engine", + identifier: "engine-pref", + base: { + name: "engine-pref", + urls: { + search: { + base: "https://www.google.com/search", + searchTermParamName: "q", + }, + }, + }, + variants: [ + { + environment: { allRegionsAndLocales: true }, + }, + ], + }, + { + recordType: "defaultEngines", + specificDefaults: [ + { + default: "engine", + environment: { excludedRegions: ["FR"] }, + }, + { + default: "engine-pref", + environment: { regions: ["FR"] }, + }, + ], + }, + { + recordType: "engineOrders", + orders: [], + }, +]; + +const CONFIG_V2_UPDATED = [ + { + recordType: "engine", + identifier: "engine-pref", + base: { + name: "engine-pref", + urls: { + search: { + base: "https://www.google.com/search", + searchTermParamName: "q", + }, + }, + }, + variants: [ + { + environment: { allRegionsAndLocales: true }, + }, + ], + }, + { + recordType: "defaultEngines", + specificDefaults: [ + { + default: "engine", + environment: { excludedRegions: ["FR"] }, + }, + { + default: "engine-pref", + environment: { regions: ["FR"] }, + }, + ], + }, + { + recordType: "engineOrders", + orders: [], + }, +]; + let stub; let settingsFilePath; let userSettings; @@ -64,7 +158,11 @@ let userSettings; add_setup(async function () { SearchSettings.SETTINGS_INVALIDATION_DELAY = 100; SearchTestUtils.useMockIdleService(); - await SearchTestUtils.useTestEngines("data", null, CONFIG); + await SearchTestUtils.useTestEngines( + "data", + null, + SearchUtils.newSearchConfigEnabled ? CONFIG_V2 : CONFIG + ); await AddonTestUtils.promiseStartupManager(); stub = sinon.stub( @@ -246,7 +344,9 @@ add_task(async function test_default_engine_changed_and_metadata_unchanged() { }; // Update config by removing the app default engine - await setConfigToLoad(CONFIG_UPDATED); + await setConfigToLoad( + SearchUtils.newSearchConfigEnabled ? CONFIG_V2_UPDATED : CONFIG_UPDATED + ); await reloadEngines(structuredClone(userSettings)); Assert.ok( @@ -293,7 +393,9 @@ add_task(async function test_app_default_engine_changed_on_start_up() { settings.metaData.current = ""; // Update config by removing the app default engine - await setConfigToLoad(CONFIG_UPDATED); + await setConfigToLoad( + SearchUtils.newSearchConfigEnabled ? CONFIG_V2_UPDATED : CONFIG_UPDATED + ); await loadEngines(settings); Assert.ok( @@ -311,7 +413,9 @@ add_task(async function test_app_default_engine_change_start_up_still_exists() { settings.metaData.current = ""; settings.metaData.appDefaultEngine = "Test search engine"; - await setConfigToLoad(CONFIG); + await setConfigToLoad( + SearchUtils.newSearchConfigEnabled ? CONFIG_V2 : CONFIG + ); await loadEngines(settings); Assert.ok( |