Bug 1565315 - Fix Yandex missing from en builds when in Russian regions. r=mconnor,daleharvey a=RyanVM a=jcristau
authorMark Banner <standard8@mozilla.com>
Sat, 13 Jul 2019 15:25:13 +0000
changeset 537234 1b4e2273cd298414563d0b97295a342e99022bab
parent 537233 35ad10ab4145599078a10365fe4dde9f6b03eed6
child 537235 d0034f14b7059a06c0a9ea3ae85dad2c2add74e4
push id2104
push userarchaeopteryx@coole-files.de
push dateMon, 15 Jul 2019 19:20:23 +0000
treeherdermozilla-release@d0034f14b705 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconnor, daleharvey, RyanVM, jcristau
bugs1565315
milestone68.0.1
Bug 1565315 - Fix Yandex missing from en builds when in Russian regions. r=mconnor,daleharvey a=RyanVM a=jcristau Depends on D37869 Differential Revision: https://phabricator.services.mozilla.com/D37872
browser/components/search/extensions/list.json
toolkit/components/search/tests/xpcshell/searchconfigs/test_ebay.js
toolkit/components/search/tests/xpcshell/searchconfigs/test_google.js
toolkit/components/search/tests/xpcshell/searchconfigs/test_yandex.js
--- a/browser/components/search/extensions/list.json
+++ b/browser/components/search/extensions/list.json
@@ -51,16 +51,45 @@
     }
   },
   "locales": {
     "en-US": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "amazondotcom", "bing", "ddg", "ebay", "twitter", "wikipedia"
         ]
+      },
+      "KZ": {
+        "visibleDefaultEngines": [
+          "amazondotcom", "bing", "google", "twitter", "wikipedia", "ddg", "yandex-en"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "BY": {
+        "visibleDefaultEngines": [
+          "amazondotcom", "bing", "google", "twitter", "wikipedia", "ddg", "yandex-en"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "RU": {
+        "visibleDefaultEngines": [
+          "amazondotcom", "bing", "google", "twitter", "wikipedia", "ddg", "yandex-en"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "TR": {
+        "visibleDefaultEngines": [
+          "amazondotcom", "bing", "google", "twitter", "wikipedia", "ddg", "yandex-en"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "experimental-hidden": {
+        "visibleDefaultEngines": [
+          "amazon-ca", "amazon-au", "yandex-en", "google", "google-b-1-e", "google-b-e"
+        ]
       }
     },
     "ach": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "bing", "amazondotcom", "ddg", "twitter", "wikipedia"
         ]
       }
@@ -232,30 +261,112 @@
         ]
       }
     },
     "en-CA": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "twitter", "wikipedia"
         ]
+      },
+      "KZ": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "BY": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "RU": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "TR": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "experimental-hidden": {
+        "visibleDefaultEngines": [
+          "amazon-ca", "amazon-au", "yandex-en", "google", "google-b-1-e", "google-b-e"
+        ]
       }
     },
     "en-GB": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "twitter", "wikipedia"
         ]
+      },
+      "KZ": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "BY": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "RU": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "TR": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "experimental-hidden": {
+        "visibleDefaultEngines": [
+          "yandex-en"
+        ]
       }
     },
     "en-ZA": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "bing", "amazondotcom", "ddg", "twitter", "wikipedia"
         ]
+      },
+      "KZ": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "bing", "amazondotcom", "ddg", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "BY": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "bing", "amazondotcom", "ddg", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "RU": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "bing", "amazondotcom", "ddg", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
+      },
+      "TR": {
+        "visibleDefaultEngines": [
+          "yandex-en", "google-b-d", "bing", "amazondotcom", "ddg", "twitter", "wikipedia"
+        ],
+        "searchDefault": "Yandex"
       }
     },
     "eo": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-eo"
         ]
       }
@@ -281,16 +392,21 @@
         ]
       }
     },
     "es-MX": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "bing", "ddg", "mercadolibre-mx", "wikipedia-es"
         ]
+      },
+      "experimental-hidden": {
+        "visibleDefaultEngines": [
+          "amazon-mx"
+        ]
       }
     },
     "et": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "neti-ee", "ddg", "osta-ee", "wikipedia-et", "eki-ee"
         ]
       }
@@ -330,16 +446,21 @@
         ]
       }
     },
     "fy-NL": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "bing", "bolcom-fy-NL", "ddg", "ebay-nl", "marktplaats-fy-NL", "wikipedia-fy-NL"
         ]
+      },
+      "experimental-hidden": {
+        "visibleDefaultEngines": [
+          "amazon-nl"
+        ]
       }
     },
     "ga-IE": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "amazon-en-GB", "ddg", "ebay-ie", "tearma", "twitter", "wikipedia-ga-IE"
         ]
       }
@@ -603,16 +724,21 @@
         ]
       }
     },
     "nl": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "bing", "bolcom-nl", "ddg", "ebay-nl", "marktplaats-nl", "wikipedia-nl"
         ]
+      },
+      "experimental-hidden": {
+        "visibleDefaultEngines": [
+          "amazon-nl"
+        ]
       }
     },
     "nn-NO": {
       "default": {
         "visibleDefaultEngines": [
           "google-b-d", "bing", "amazon-en-GB", "ddg", "gulesider-NO", "bok-NO", "qxl-NO", "wikipedia-NN"
         ]
       }
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/test_ebay.js
+++ b/toolkit/components/search/tests/xpcshell/searchconfigs/test_ebay.js
@@ -1,27 +1,38 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+let availableRegions = Services.intl.getAvailableLocaleDisplayNames("region");
+
 const test = new SearchConfigTest({
   identifier: "ebay",
   aliases: ["@ebay"],
   default: {
     // Not included anywhere.
   },
   available: {
     included: [{
       // We don't currently enforce by region, but do locale instead.
       // regions: [
       //   "us", "gb", "ca", "ie", "fr", "it", "de", "at", "es", "nl", "ch", "au"
       // ],
       locales: {
-        matches: ["an", "en-US", "ast", "br", "ca", "cy", "de", "dsb", "en-CA", "en-GB", "es-ES", "eu", "fr", "fy-NL", "ga-IE", "gd", "gl", "hsb", "it", "lij", "nl", "rm", "wo"],
+        matches: ["an", "ast", "br", "ca", "cy", "de", "dsb", "en-CA", "en-GB", "es-ES", "eu", "fr", "fy-NL", "ga-IE", "gd", "gl", "hsb", "it", "lij", "nl", "rm", "wo"],
+      },
+    },
+    {
+      // For en-US ebay is currently included everywhere apart from these regions.
+      regions: availableRegions.filter(
+        region => !["by", "kz", "ru", "tr"].includes(region)
+      ),
+      locales: {
+        matches: ["en-US"],
       },
     }],
   },
   searchUrlBase: "https://rover.ebay.com/rover/1/",
   details: [{
     // Note: These should be based on region, but we don't currently enforce that.
     // Note: the order here is important. A region/locale match higher up in the
     // list will override a region/locale match lower down.
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/test_google.js
+++ b/toolkit/components/search/tests/xpcshell/searchconfigs/test_google.js
@@ -10,18 +10,17 @@ const test = new SearchConfigTest({
     // Included everywhere apart from the exclusions below. These are basically
     // just excluding what Yandex and Baidu include.
     excluded: [{
       regions: [
         "ru", "tr", "by", "kz",
       ],
       locales: {
         matches: ["ru", "tr", "be", "kk"],
-        // We don't currently enforce this.
-        // startsWith: ["en"],
+        startsWith: ["en"],
       },
     }, {
       regions: ["cn"],
       locales: {
         matches: ["zh-CN"],
       },
     }],
   },
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/test_yandex.js
+++ b/toolkit/components/search/tests/xpcshell/searchconfigs/test_yandex.js
@@ -8,26 +8,31 @@ const test = new SearchConfigTest({
   aliases: ["@\u044F\u043D\u0434\u0435\u043A\u0441", "@yandex"],
   default: {
     included: [{
       regions: [
         "ru", "tr", "by", "kz",
       ],
       locales: {
         matches: ["ru", "tr", "be", "kk"],
-        // We don't currently enforce this.
-        // startsWith: ["en"],
+        startsWith: ["en"],
       },
     }],
   },
   available: {
     included: [{
       locales: {
         matches: ["az", "ru", "be", "kk", "tr"],
       },
+    },
+    {
+      regions: ["ru", "tr", "by", "kz"],
+      locales: {
+        startsWith: ["en"],
+      },
     }],
   },
   details: [{
     included: [{locales: { matches: ["az"] }}],
     domain: "yandex.az",
     codes: {
       "searchbar": "clid=2186618",
       "keyword": "clid=2186621",