Bug 1575555 - Support multiple locales in modern config r=Standard8
authorDale Harvey <dale@arandomurl.com>
Fri, 13 Sep 2019 10:10:54 +0000
changeset 493067 f4197a3c34c26aa9378e16dca99b1842650ef0cd
parent 493066 9017559cb5d4509bb643dd6d0be8f62eed2bb36d
child 493068 2ecf303ec887bcb296bd296f1b63f9b81e719e33
push id95297
push userdharvey@mozilla.com
push dateFri, 13 Sep 2019 12:39:42 +0000
treeherderautoland@f4197a3c34c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1575555
milestone71.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 1575555 - Support multiple locales in modern config r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D45541
browser/components/search/extensions/engines.json
toolkit/components/search/SearchEngineSelector.jsm
toolkit/components/search/SearchService.jsm
toolkit/components/search/docs/SearchEngineConfiguration.rst
toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
toolkit/components/search/tests/xpcshell/test_engine_selector.js
--- a/browser/components/search/extensions/engines.json
+++ b/browser/components/search/extensions/engines.json
@@ -96,134 +96,134 @@
               "es-AR", "fa", "gn", "hy-AM", "ia", "is", "ka", "km",
               "lt", "mk", "ms", "my", "ro", "si", "th", "tl",
               "trs", "uz"
             ]
           }
         },
         "webExtensionId": "amazon@search.mozilla.org",
         "webExtensionVersion": "1.1",
-        "webExtensionLocale": "au",
+        "webExtensionLocales": ["au"],
         "engineName": "Amazon.com.au"
       }, {
         "included": {
           "regions": ["ca"],
           "locales": {
             "matches": [
               "ach", "af", "ar", "az", "bg", "cak", "en-US", "eo",
               "es-AR", "fa", "gn", "hy-AM", "ia", "is", "ka", "km",
               "lt", "mk", "ms", "my", "ro", "si", "th", "tl",
               "trs", "uz"
             ]
           }
         },
         "webExtensionId": "amazon@search.mozilla.org",
         "webExtensionVersion": "1.1",
-        "webExtensionLocale": "ca",
+        "webExtensionLocales": ["ca"],
         "engineName": "Amazon.ca"
       }, {
         "included": {
           "regions": ["fr"],
           "locales": {
             "matches": [
               "ach", "af", "ar", "az", "bg", "cak", "en-US", "eo",
               "es-AR", "fa", "gn", "hy-AM", "ia", "is", "ka", "km",
               "lt", "mk", "ms", "my", "ro", "si", "th", "tl",
               "trs", "uz"
             ]
           }
         },
         "webExtensionId": "amazon@search.mozilla.org",
         "webExtensionVersion": "1.1",
-        "webExtensionLocale": "france",
+        "webExtensionLocales": ["france"],
         "engineName": "Amazon.fr"
       }, {
         "included": {
           "regions": ["gb"],
           "locales": {
             "matches": [
               "ach", "af", "ar", "az", "bg", "cak", "en-US", "eo",
               "es-AR", "fa", "gn", "hy-AM", "ia", "is", "ka", "km",
               "lt", "mk", "ms", "my", "ro", "si", "th", "tl",
               "trs", "uz"
             ]
           }
         },
         "webExtensionId": "amazon@search.mozilla.org",
         "webExtensionVersion": "1.1",
-        "webExtensionLocale": "en-GB",
+        "webExtensionLocales": ["en-GB"],
         "engineName": "Amazon.co.uk"
       }],
       "aliases": ["amazon"]
     },
     {
       "engineName": "Amazon",
       "orderHint": 500,
       "webExtensionId": "amazon@search.mozilla.org",
       "webExtensionVersion": "1.1",
       "appliesTo": [{
         "included": {
           "locales": { "matches": [
             "as", "bn", "bn-IN", "kn", "gu-IN", "mai", "ml", "mr",
             "or", "pa-IN", "ta", "te", "ur"
           ]}
         },
-        "webExtensionLocale": "in",
+        "webExtensionLocales": ["in"],
         "engineName": "Amazon.in"
       }, {
         "included": {
           "locales": { "matches": ["br", "ff", "fr", "son", "wo"] }
         },
-        "webExtensionLocale": "france",
+        "webExtensionLocales": ["france"],
         "engineName": "Amazon.fr"
       }, {
         "included": {
           "regions": ["ca"],
           "locales": { "matches": ["br", "ff", "fr", "son", "wo"] }
         },
-        "webExtensionLocale": "ca",
+        "webExtensionLocales": ["ca"],
         "engineName": "Amazon.ca"
       }, {
         "included": { "locales": { "matches": ["en-CA"] } },
-        "webExtensionLocale": "ca",
+        "webExtensionLocales": ["ca"],
         "engineName": "Amazon.ca"
       }, {
         "included": { "locales": { "matches": ["ja-JP-mac", "ja"] } },
-        "webExtensionLocale": "jp",
+        "webExtensionLocales": ["jp"],
         "engineName": "Amazon.jp"
       }, {
         "included": { "locales": { "matches": ["it", "lij"] } },
-        "webExtensionLocale": "it",
+        "webExtensionLocales": ["it"],
         "engineName": "Amazon.it"
       }, {
         "included": { "locales": { "matches": ["de", "dsb", "hsb"] } },
-        "webExtensionLocale": "de",
+        "webExtensionLocales": ["de"],
         "engineName": "Amazon.de"
       }, {
         "included": {
           "locales": {
             "matches": [
               "cy", "da", "el", "en-GB", "eu", "ga-IE", "gd", "gl", "hr",
               "nb-NO", "nn-NO", "pt-PT", "sq", "sr"
             ]
           }
         },
-        "webExtensionLocale": "en-GB",
+        "webExtensionLocales": ["en-GB"],
         "engineName": "Amazon.co.uk"
       }, {
         "included": {
           "regions": ["au"],
           "locales": {
             "matches": [
               "cy", "da", "el", "en-GB", "eu", "ga-IE", "gd", "gl", "hr",
               "nb-NO", "nn-NO", "pt-PT", "sq", "sr"
             ]
           }
         },
-        "webExtensionLocale": "au",
+        "webExtensionLocales": ["au"],
         "engineName": "Amazon.au"
       }],
       "aliases": ["amazon"]
     },
     {
       "engineName": "\u4E9A\u9A6C\u900A",
       "orderHint": 500,
       "webExtensionId": "amazondotcn@search.mozilla.org",
@@ -241,106 +241,106 @@
       "appliesTo": [{
         "included": { "locales": { "matches": ["en-US"] } },
         "excluded": { "regions": ["ru", "tr", "by", "kz"] }
       }, {
         "included": {
           "locales": { "matches": ["en-US"] },
           "regions": ["au"]
         },
-        "webExtensionLocale": "au"
+        "webExtensionLocales": ["au"]
       }, {
         "included": {
           "locales": { "matches": ["en-US"] },
           "regions": ["ie"]
         },
-        "webExtensionLocale": "ie"
+        "webExtensionLocales": ["ie"]
       }, {
         "included": {
           "locales": { "matches": ["en-US"] },
           "regions": ["be"]
         },
-        "webExtensionLocale": "be"
+        "webExtensionLocales": ["be"]
       }, {
         "included": { "locales": {
           "matches": ["an", "ast", "ca", "es-ES", "eu", "gl"]
         }},
-        "webExtensionLocale": "es"
+        "webExtensionLocales": ["es"]
       }, {
         "included": { "locales": { "matches": ["br", "fr", "wo"] }},
-        "webExtensionLocale": "fr"
+        "webExtensionLocales": ["fr"]
       }, {
         "included": {
           "locales": { "matches": ["br", "fr", "wo"] },
           "regions": ["be"]
         },
-        "webExtensionLocale": "be"
+        "webExtensionLocales": ["be"]
       }, {
         "included": {
           "locales": { "matches": ["br", "fr", "wo"] },
           "regions": ["ca"]
         },
-        "webExtensionLocale": "ca"
+        "webExtensionLocales": ["ca"]
       }, {
         "included": {
           "locales": { "matches": ["br", "fr", "wo"] },
           "regions": ["ch"]
         },
-        "webExtensionLocale": "ch"
+        "webExtensionLocales": ["ch"]
       }, {
         "included": { "locales": { "matches": ["cy", "en-GB", "gd"] }},
-        "webExtensionLocale": "uk"
+        "webExtensionLocales": ["uk"]
       }, {
         "included": {
           "locales": { "matches": ["cy", "en-GB", "gd"] },
           "regions": ["au"]
         },
-        "webExtensionLocale": "au"
+        "webExtensionLocales": ["au"]
       }, {
         "included": {
           "locales": { "matches": ["cy", "en-GB", "gd"] },
           "regions": ["ie"]
         },
-        "webExtensionLocale": "ie"
+        "webExtensionLocales": ["ie"]
       }, {
         "included": { "locales": { "matches": ["de", "dsb", "hsb"] }},
-        "webExtensionLocale": "de"
+        "webExtensionLocales": ["de"]
       }, {
         "included": {
           "locales": { "matches": ["de", "dsb", "hsb"] },
           "regions": ["at"]
         },
-        "webExtensionLocale": "at"
+        "webExtensionLocales": ["at"]
       }, {
         "included": {
           "locales": { "matches": ["de", "dsb", "hsb"] },
           "regions": ["ch"]
         },
-        "webExtensionLocale": "ch"
+        "webExtensionLocales": ["ch"]
       }, {
         "included": { "locales": { "matches": ["en-CA"] }},
-        "webExtensionLocale": "ca"
+        "webExtensionLocales": ["ca"]
       }, {
         "included": { "locales": { "matches": ["fy-NL", "nl"] }},
-        "webExtensionLocale": "nl"
+        "webExtensionLocales": ["nl"]
       }, {
         "included": {
           "locales": { "matches": ["fy-NL", "nl"] },
           "regions": ["be"]
         },
-        "webExtensionLocale": "be"
+        "webExtensionLocales": ["be"]
       }, {
         "included": { "locales": { "matches": ["ga-IE"] }},
-        "webExtensionLocale": "ie"
+        "webExtensionLocales": ["ie"]
       }, {
         "included": { "locales": { "matches": ["it", "lij"] }},
-        "webExtensionLocale": "it"
+        "webExtensionLocales": ["it"]
       }, {
         "included": { "locales": { "matches": ["rm"] }},
-        "webExtensionLocale": "ch"
+        "webExtensionLocales": ["ch"]
       }],
       "aliases": ["@ebay"]
     },
     {
       "engineName": "DuckDuckGo",
       "orderHint": 500,
       "webExtensionId": "ddg@search.mozilla.org",
       "webExtensionVersion": "1.0",
@@ -357,35 +357,35 @@
         "default": "yes",
         "included": {
           "regions": ["ru", "tr", "by", "kz"],
           "locales": {
             "matches": ["ru", "tr", "be", "kk"],
             "startsWith": ["en"]
           }
         },
-        "webExtensionLocale": "en"
+        "webExtensionLocales": ["en"]
       }, {
         "included": { "locales": { "matches": ["az"] }},
-        "webExtensionLocale": "az"
+        "webExtensionLocales": ["az"]
       }, {
         "included": { "locales": { "matches": ["be"] }},
-        "webExtensionLocale": "by",
+        "webExtensionLocales": ["by"],
         "engineName": "\u044F\u043D\u0434\u0435\u043A\u0441"
       }, {
         "included": { "locales": { "matches": ["kk"] }},
-        "webExtensionLocale": "kk",
+        "webExtensionLocales": ["kk"],
         "engineName": "\u044F\u043D\u0434\u0435\u043A\u0441"
       }, {
         "included": { "locales": { "matches": ["ru"] }},
-        "webExtensionLocale": "ru",
+        "webExtensionLocales": ["ru"],
         "engineName": "\u044F\u043D\u0434\u0435\u043A\u0441"
       }, {
         "included": { "locales": { "matches": ["tr"] }},
-        "webExtensionLocale": "tr"
+        "webExtensionLocales": ["tr"]
       }],
       "aliases": ["@\u044F\u043D\u0434\u0435\u043A\u0441", "@yandex"]
     },
     {
       "engineName": "allaannonser-sv-SE",
       "webExtensionId": "allaannonser-sv-SE@search.mozilla.org",
       "webExtensionVersion": "1.2",
       "appliesTo": [{ "included": { "locales": { "matches": ["sv-SE"]}}}]
@@ -429,20 +429,20 @@
       }}]
     },
     {
       "engineName": "bolcom",
       "webExtensionId": "bolcom@search.mozilla.org",
       "webExtensionVersion": "1.0",
       "appliesTo": [{
         "included": { "locales": { "matches": ["fy-NL"]}},
-        "webExtensionLocale": "fy-NL"
+        "webExtensionLocales": ["fy-NL"]
       }, {
         "included": { "locales": { "matches": ["nl"]}},
-        "webExtensionLocale": "nl"
+        "webExtensionLocales": ["nl"]
       }]
     },
     {
       "engineName": "ceneji",
       "webExtensionId": "ceneji@search.mozilla.org",
       "webExtensionVersion": "1.0",
       "appliesTo": [{ "included": { "locales": { "matches": ["sl"]}}}]
     },
@@ -569,35 +569,35 @@
       "appliesTo": [{ "included": { "locales": { "matches": ["cs"]}}}]
     },
     {
       "engineName": "marktplaats",
       "webExtensionId": "marktplaats@search.mozilla.org",
       "webExtensionVersion": "1.0",
       "appliesTo": [{
         "included": { "locales": { "matches": ["fy-NL"]}},
-        "webExtensionLocale": "fy-NL"
+        "webExtensionLocales": ["fy-NL"]
       }, {
         "included": { "locales": { "matches": ["nl"]}},
-        "webExtensionLocale": "nl"
+        "webExtensionLocales": ["nl"]
       }]
     },
     {
       "engineName": "mercadolibre",
       "webExtensionId": "mercadolibre@search.mozilla.org",
       "webExtensionVersion": "1.0",
       "appliesTo": [{
         "included": { "locales": { "matches": ["es-AR"]}},
-        "webExtensionLocale": "ar"
+        "webExtensionLocales": ["ar"]
       }, {
         "included": { "locales": { "matches": ["es-CL"]}},
-        "webExtensionLocale": "cl"
+        "webExtensionLocales": ["cl"]
       }, {
         "included": { "locales": { "matches": ["es-MX"]}},
-        "webExtensionLocale": "mx"
+        "webExtensionLocales": ["mx"]
       }]
     },
     {
       "engineName": "mercadolivre",
       "webExtensionId": "mercadolivre@search.mozilla.org",
       "webExtensionVersion": "1.0",
       "appliesTo": [{ "included": { "locales": { "matches": ["pt-BR"]}}}]
     },
@@ -753,17 +753,17 @@
         "included": { "locales": { "matches": [
           "en-US", "ach", "an", "bs", "ca", "crh", "en-CA", "ga-IE",
           "gn", "hr", "ia", "ka", "kk", "km", "lo", "lt", "mai",
           "ms", "my", "ne-NP", "oc", "pt-BR", "sl", "tl", "tr",
           "ur", "uz", "wo"
         ]}}
       }, {
         "included": { "locales": { "matches": ["ja-JP-mac", "ja"]}},
-        "webExtensionLocale": "ja"
+        "webExtensionLocales": ["ja"]
       }]
     },
     {
       "engineName": "tyda-sv-SE",
       "webExtensionId": "tyda-sv-SE@search.mozilla.org",
       "webExtensionVersion": "1.0",
       "appliesTo": [{ "included": { "locales": { "matches": ["sv-SE"]}}}]
     },
@@ -774,20 +774,20 @@
       "appliesTo": [{ "included": { "locales": { "matches": ["hu"]}}}]
     },
     {
       "engineName": "wiktionary",
       "webExtensionId": "wiktionary@search.mozilla.org",
       "webExtensionVersion": "1.0",
       "appliesTo": [{
         "included": { "locales": { "matches": ["te"]}},
-        "webExtensionLocale": "te"
+        "webExtensionLocales": ["te"]
       }, {
         "included": { "locales": { "matches": ["oc"]}},
-        "webExtensionLocale": "oc"
+        "webExtensionLocales": ["oc"]
       }]
     },
     {
       "engineName": "wolnelektury-pl",
       "webExtensionId": "wolnelektury-pl@search.mozilla.org",
       "webExtensionVersion": "1.0",
       "appliesTo": [{ "included": { "locales": { "matches": ["pl"]}}}]
     },
@@ -821,65 +821,71 @@
           "gd", "gl", "gn", "he", "hr", "hsb", "hu", "ia",
           "id", "is", "it", "ka", "kab", "kk", "km", "kn",
           "lij", "lo", "lt", "ltg", "lv", "mk", "ml", "mr",
           "ms", "my", "nl", "oc", "or", "pl", "rm", "ro", "ru",
           "si", "sk", "sl", "sq", "sr", "sv-SE", "ta", "te",
           "th", "tl", "tr", "uk", "ur", "uz", "vi", "wo",
           "zh-CN", "zh-TW"
         ]}},
-        "webExtensionLocale": "$USER_LOCALE"
+        "webExtensionLocales": ["$USER_LOCALE"]
       }, {
         "included": { "locales": { "matches": [
           "en-CA", "en-GB", "en-US", "en-ZA", "ach", "xh"
           ]}},
-          "webExtensionLocale": "en"
+          "webExtensionLocales": ["en"]
+      }, {
+        "included": { "locales": { "matches": [ "be" ] } },
+        "webExtensionLocales": ["be", "be-tarask"]
       }, {
         "included": { "locales": { "matches": [ "bn", "bn-BD", "bn-IN" ] } },
-        "webExtensionLocale": "bn"
+        "webExtensionLocales": ["bn"]
       }, {
         "included": { "locales": { "matches": [
           "cak", "es-AR", "es-CL", "es-ES", "es-MX", "trs"
         ]}},
-        "webExtensionLocale": "es"
+        "webExtensionLocales": ["es"]
       }, {
         "included": { "locales": { "matches": [ "cs" ] } },
-        "webExtensionLocale": "cz"
+        "webExtensionLocales": ["cz"]
       }, {
         "included": { "locales": { "matches": [ "ff", "fr", "son" ] } },
-        "webExtensionLocale": "fr"
+        "webExtensionLocales": ["fr"]
       }, {
         "included": { "locales": { "matches": [ "gu-IN" ] } },
-        "webExtensionLocale": "gu"
+        "webExtensionLocales": ["gu"]
       }, {
         "included": { "locales": { "matches": [ "hi-IN" ] } },
-        "webExtensionLocale": "hi"
+        "webExtensionLocales": ["hi"]
       }, {
         "included": { "locales": { "matches": [ "hy-AM" ] } },
-        "webExtensionLocale": "hy"
+        "webExtensionLocales": ["hy"]
       }, {
         "included": { "locales": { "matches": [ "ja-JP-macos", "ja" ] } },
-        "webExtensionLocale": "ja"
+        "webExtensionLocales": ["ja"]
       }, {
         "included": { "locales": { "matches": [ "ko" ] } },
-        "webExtensionLocale": "kr"
+        "webExtensionLocales": ["kr"]
       }, {
         "included": { "locales": { "matches": [ "mai" ] } },
-        "webExtensionLocale": "hi"
+        "webExtensionLocales": ["hi"]
+      }, {
+        "included": { "locales": { "matches": [ "ml" ] } },
+        "webExtensionLocales": ["en", "ml"]
       }, {
         "included": { "locales": { "matches": [ "nb-NO" ] } },
-        "webExtensionLocale": "NO"
+        "webExtensionLocales": ["NO"]
       }, {
         "included": { "locales": { "matches": [ "ne-NP" ] } },
-        "webExtensionLocale": "ne"
+        "webExtensionLocales": ["ne"]
       }, {
         "included": { "locales": { "matches": [ "nn-NO" ] } },
-        "webExtensionLocale": "NN"
+        "webExtensionLocales": ["NN"]
       }, {
         "included": { "locales": { "matches": [ "pa-IN" ] } },
-        "webExtensionLocale": "pa"
+        "webExtensionLocales": ["pa"]
       }, {
         "included": { "locales": { "matches": [ "pt-BR", "pt-PT" ] } },
-        "webExtensionLocale": "pt"
+        "webExtensionLocales": ["pt"]
       }]
     }
   ]
 }
--- a/toolkit/components/search/SearchEngineSelector.jsm
+++ b/toolkit/components/search/SearchEngineSelector.jsm
@@ -79,18 +79,20 @@ class SearchEngineSelector {
 
       // Loop through all the appliedTo sections that apply to
       // this configuration
       if (applies.length) {
         for (let section of applies) {
           this._copyObject(baseConfig, section);
         }
 
-        if (baseConfig.webExtensionLocale == USER_LOCALE) {
-          baseConfig.webExtensionLocale = locale;
+        if ("webExtensionLocales" in baseConfig) {
+          baseConfig.webExtensionLocales = baseConfig.webExtensionLocales.map(
+            val => (val == USER_LOCALE ? locale : val)
+          );
         }
 
         engines.push(baseConfig);
       }
     }
 
     let defaultEngine;
     let privateEngine;
--- a/toolkit/components/search/SearchService.jsm
+++ b/toolkit/components/search/SearchService.jsm
@@ -1146,22 +1146,20 @@ SearchService.prototype = {
 
     this._loadEnginesMetadataFromCache(cache);
 
     SearchUtils.log("_loadEngines: done using rebuilt cache");
   },
 
   async _loadEnginesFromConfig(engineConfigs) {
     for (let config of engineConfigs) {
-      // TODO: Support multiple locales per engine
-      // https://bugzilla.mozilla.org/show_bug.cgi?id=1575555
       SearchUtils.log("_loadEnginesFromConfig: " + JSON.stringify(config));
       let locales =
-        "webExtensionLocale" in config
-          ? [config.webExtensionLocale]
+        "webExtensionLocales" in config
+          ? config.webExtensionLocales
           : [DEFAULT_TAG];
       await this.ensureBuiltinExtension(config.webExtensionId, locales);
     }
   },
 
   /**
    * Ensures a built in search WebExtension is installed, installing
    * it if necessary.
--- a/toolkit/components/search/docs/SearchEngineConfiguration.rst
+++ b/toolkit/components/search/docs/SearchEngineConfiguration.rst
@@ -107,34 +107,34 @@ located specific regions or with certain
 
 In this case users identified as being in the US region would use the WebExtension
 with identifier ``webext-engine1``, version 1.1. GB region users would get
 ``webext-gb`` version 1.2, and all other users would get ``webext`` version 1.0.
 
 Special Attributes
 ------------------
 
-If a ``webExtensionLocale`` attribute is specified with the value
+If a ``webExtensionLocales`` attribute contains an element with the value
 ``"$USER_LOCALE"`` then the special value will be replaced in the
 configuration object with the users locale. For example:
 
 .. code-block:: js
 
     "engine1": {
       "webExtensionId": "webext",
       "webExtensionVersion": "1.0",
       "appliesTo": [{
         "included": {
           "locales": {
             "matches": ["us", "gb"]
           },
-          "webExtensionLocale": "$USER_LOCALE",
+          "webExtensionLocales": ["$USER_LOCALE"],
         },
 
-Will report either ``us`` or ``gb`` as the ``webExtensionLocale``
+Will report either ``[us]`` or ``[gb]`` as the ``webExtensionLocales``
 depending on the user.
 
 Experiments
 -----------
 
 We can run experiments by giving sections within ``appliesTo`` a
 ``cohort`` value, the Search Service can then optionally pass in a
 matching ``cohort`` value to match those sections.
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
+++ b/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
@@ -183,17 +183,23 @@ class SearchConfigTest {
       let path = `resource://search-extensions/${idPrefix}/`;
       await AddonManager.installBuiltinAddon(path);
       policy = WebExtensionPolicy.getByID(id);
     }
     let params = {
       code: config.searchUrlGetExtraCodes,
     };
 
-    let locale = config.webExtensionLocale || "default";
+    // Currently wikipedia is the only engine that uses multiple
+    // locales and that isn't a tested engine so for now pick
+    // the first (only) locale.
+    let locale =
+      "webExtensionLocales" in config
+        ? config.webExtensionLocales[0]
+        : "default";
     // On startup the extension may have not finished parsing the
     // manifest, wait for that here.
     await policy.readyPromise;
 
     let manifest = policy.extension.manifest;
     if (locale != "default") {
       manifest = await policy.extension.getLocalizedManifest(locale);
     }
--- a/toolkit/components/search/tests/xpcshell/test_engine_selector.js
+++ b/toolkit/components/search/tests/xpcshell/test_engine_selector.js
@@ -9,24 +9,24 @@ XPCOMUtils.defineLazyModuleGetters(this,
 
 const CONFIG_URL =
   "data:application/json," +
   JSON.stringify({
     data: [
       {
         engineName: "aol",
         orderHint: 500,
-        webExtensionLocale: "default",
+        webExtensionLocales: ["default"],
         appliesTo: [
           {
             included: { everywhere: true },
           },
           {
             included: { regions: ["us"] },
-            webExtensionLocale: "$USER_LOCALE",
+            webExtensionLocales: ["$USER_LOCALE"],
           },
         ],
       },
       {
         engineName: "lycos",
         orderHint: 1000,
         default: "yes",
         appliesTo: [
@@ -77,19 +77,19 @@ add_task(async function() {
   );
   Assert.equal(
     privateDefault,
     "altavista",
     "Should set altavista as privateDefault"
   );
   let names = engines.map(obj => obj.engineName);
   Assert.deepEqual(names, ["lycos", "altavista", "aol"], "Correct order");
-  Assert.equal(
-    engines[2].webExtensionLocale,
-    "en-US",
+  Assert.deepEqual(
+    engines[2].webExtensionLocales,
+    ["en-US"],
     "Subsequent matches in applies to can override default"
   );
 
   ({ engines, privateDefault } = engineSelector.fetchEngineConfiguration(
     "kz",
     "zh-CN"
   ));
   Assert.equal(engines.length, 2, "Correct engines are returns");