Bug 1647400 - Fix Search Service test failures on ESR 78. r=mkaply.
authorMark Banner <standard8@mozilla.com>
Mon, 22 Jun 2020 20:24:00 +0000
changeset 536648 2e5e69b8c661608783666a16293a064299e0bfb4
parent 536647 cb580c56e5dbfa78f01bcdaadc33ae3b99fc72e2
child 536649 9ebd2eb155da908ebaaf6835979193d9eeee3325
push id119598
push usermbanner@mozilla.com
push dateMon, 22 Jun 2020 21:11:41 +0000
treeherderautoland@2e5e69b8c661 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkaply
bugs1647400
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
browser/components/search/extensions/list.json
toolkit/components/search/tests/xpcshell/test_json_cache.js
--- a/browser/components/search/extensions/list.json
+++ b/browser/components/search/extensions/list.json
@@ -54,35 +54,35 @@
     "en-US": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "amazondotcom", "bing", "ddg", "ebay", "wikipedia"
         ]
       },
       "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"
       },
       "experimental-hidden": {
         "visibleDefaultEngines": [
           "amazon-ca", "amazon-au", "yandex-en", "google", "google-b-1-e", "google-b-e"
         ]
       }
--- a/toolkit/components/search/tests/xpcshell/test_json_cache.js
+++ b/toolkit/components/search/tests/xpcshell/test_json_cache.js
@@ -30,30 +30,30 @@ add_task(async function setup() {
   cacheTemplate.buildID = getAppInfo().platformBuildID;
   cacheTemplate.version = SearchUtils.CACHE_VERSION;
 
   if (gModernConfig) {
     delete cacheTemplate.visibleDefaultEngines;
   } 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];
+        }
       }
     }
   }
 
   await promiseSaveCacheData(cacheTemplate);
 });
 
 /**