diff options
Diffstat (limited to 'toolkit/components/search/tests/xpcshell/test_validate_engines.js')
-rw-r--r-- | toolkit/components/search/tests/xpcshell/test_validate_engines.js | 56 |
1 files changed, 45 insertions, 11 deletions
diff --git a/toolkit/components/search/tests/xpcshell/test_validate_engines.js b/toolkit/components/search/tests/xpcshell/test_validate_engines.js index 8a25216057..d311253183 100644 --- a/toolkit/components/search/tests/xpcshell/test_validate_engines.js +++ b/toolkit/components/search/tests/xpcshell/test_validate_engines.js @@ -15,18 +15,52 @@ const ss = new SearchService(); add_task(async function test_validate_engines() { let settings = RemoteSettings(SearchUtils.SETTINGS_KEY); let config = await settings.get(); - config = config.map(e => { - return { - appliesTo: [ - { - included: { - everywhere: true, + + if (SearchUtils.newSearchConfigEnabled) { + // We do not load engines with the same name. However, in search-config-v2 + // we have multiple engines named eBay, so we error out. + // We never deploy more than one eBay in each environment so this issue + // won't be a problem. + // Ignore the error and test the configs can be created to engine objects. + consoleAllowList.push("Could not load engine"); + config = config.map(obj => { + if (obj.recordType == "engine") { + return { + recordType: "engine", + identifier: obj.identifier, + base: { + name: obj.base.name, + urls: { + search: { + base: obj.base.urls.search.base || "", + searchTermParamName: "q", + }, + }, + }, + variants: [ + { + environment: { allRegionsAndLocales: true }, + }, + ], + }; + } + + return obj; + }); + } else { + config = config.map(e => { + return { + appliesTo: [ + { + included: { + everywhere: true, + }, }, - }, - ], - webExtension: e.webExtension, - }; - }); + ], + webExtension: e.webExtension, + }; + }); + } sinon.stub(settings, "get").returns(config); await AddonTestUtils.promiseStartupManager(); |