Bug 1647400 - Fix Search Service test failures on ESR 78. r=mkaply, a=test-only
authorMark Banner <standard8@mozilla.com>
Mon, 22 Jun 2020 20:24:00 +0000
changeset 600870 26cc20dfe6b5e3ac9d8f73549c195dd32ba1e38a
parent 600869 22bb2eb335ceff3e118db9386970fb229cfbca41
child 600871 3d86a2c337d1b67cfc42a93225d3227278535658
push id2362
push userryanvm@gmail.com
push dateMon, 22 Jun 2020 23:05:09 +0000
treeherdermozilla-release@af00ea74f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkaply, test-only
bugs1647400
milestone78.0
Bug 1647400 - Fix Search Service test failures on ESR 78. r=mkaply, a=test-only '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
@@ -43,30 +43,30 @@ add_task(async function setup() {
 
   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);
 });
 
 /**