Bug 1647400 - Fix Search Service test failures on ESR 78. r=mkaply.

'test_json_cache.js' needs to properly take account of legacy vs modern.
'list.json' should be specifying google-b-d rather than just google.

Differential Revision: https://phabricator.services.mozilla.com/D80542
This commit is contained in:
Mark Banner 2020-06-22 20:24:00 +00:00
Родитель 110c2fe364
Коммит 94a495406c
2 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -59,25 +59,25 @@
},
"KZ": {
"visibleDefaultEngines": [
"amazondotcom", "bing", "google", "wikipedia", "ddg", "yandex-en"
"amazondotcom", "bing", "google-b-d", "wikipedia", "ddg", "yandex-en"
],
"searchDefault": "Yandex"
},
"BY": {
"visibleDefaultEngines": [
"amazondotcom", "bing", "google", "wikipedia", "ddg", "yandex-en"
"amazondotcom", "bing", "google-b-d", "wikipedia", "ddg", "yandex-en"
],
"searchDefault": "Yandex"
},
"RU": {
"visibleDefaultEngines": [
"amazondotcom", "bing", "google", "wikipedia", "ddg", "yandex-en"
"amazondotcom", "bing", "google-b-d", "wikipedia", "ddg", "yandex-en"
],
"searchDefault": "Yandex"
},
"TR": {
"visibleDefaultEngines": [
"amazondotcom", "bing", "google", "wikipedia", "ddg", "yandex-en"
"amazondotcom", "bing", "google-b-d", "wikipedia", "ddg", "yandex-en"
],
"searchDefault": "Yandex"
},

Просмотреть файл

@ -35,20 +35,20 @@ add_task(async function setup() {
} else {
// The list of visibleDefaultEngines needs to match or the cache will be ignored.
cacheTemplate.visibleDefaultEngines = getDefaultEngineList(false);
}
// Since the above code is querying directly from list.json,
// we need to override the values in the esr case.
if (AppConstants.MOZ_APP_VERSION_DISPLAY.endsWith("esr")) {
let esrOverrides = {
"google-b-d": "google-b-e",
"google-b-1-d": "google-b-1-e",
};
// Since the above code is querying directly from list.json,
// we need to override the values in the esr case.
if (AppConstants.MOZ_APP_VERSION_DISPLAY.endsWith("esr")) {
let esrOverrides = {
"google-b-d": "google-b-e",
"google-b-1-d": "google-b-1-e",
};
for (let engine in esrOverrides) {
let index = cacheTemplate.visibleDefaultEngines.indexOf(engine);
if (index > -1) {
cacheTemplate.visibleDefaultEngines[index] = esrOverrides[engine];
for (let engine in esrOverrides) {
let index = cacheTemplate.visibleDefaultEngines.indexOf(engine);
if (index > -1) {
cacheTemplate.visibleDefaultEngines[index] = esrOverrides[engine];
}
}
}
}