Bug 1565563 - Add en-US to search configurations to test. r=Standard8,mconnor,a=test-only
☠☠ backed out by d68930b50662 ☠ ☠
authorDale Harvey <dale@arandomurl.com>
Sat, 13 Jul 2019 15:25:13 +0000
changeset 537224 806618d7cec5eb277044093e3e434d64538cc6b5
parent 537223 a85b80d77adc350592476ec3ab4a8bca2c66d020
child 537225 d68930b5066210fb509357fbbac2d71a8e4f36ff
push id2101
push userapavel@mozilla.com
push dateMon, 15 Jul 2019 09:26:09 +0000
treeherdermozilla-release@806618d7cec5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, mconnor, test-only
bugs1565563
milestone68.0.1
Bug 1565563 - Add en-US to search configurations to test. r=Standard8,mconnor,a=test-only Differential Revision: https://phabricator.services.mozilla.com/D37869
toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
toolkit/components/search/tests/xpcshell/searchconfigs/test_ebay.js
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
+++ b/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
@@ -162,18 +162,22 @@ class SearchConfigTest {
 
   /**
    * @returns {array} the list of locales for the tests to run with.
    */
   async _getLocales() {
     if (this._testDebug) {
       return ["be", "en-US", "kk", "tr", "ru", "zh-CN"];
     }
-    const data = await OS.File.read(do_get_file("all-locales").path, {encoding: "utf-8"});
-    return data.split("\n").filter(e => e != "");
+    const data = await OS.File.read(do_get_file("all-locales").path, {
+      encoding: "utf-8",
+    });
+    // "en-US" is not in all-locales as it is the default locale
+    // add it manually to ensure it is tested.
+    return [...data.split("\n").filter(e => e != ""), "en-US"];
   }
 
   /**
    * Determines if a locale matches with a locales section in the configuration.
    *
    * @param {object} locales
    * @param {array} [locales.matches]
    *   Array of locale names to match exactly.
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/test_ebay.js
+++ b/toolkit/components/search/tests/xpcshell/searchconfigs/test_ebay.js
@@ -56,17 +56,17 @@ const test = new SearchConfigTest({
       locales: { matches: ["br", "de", "dsb", "fr", "hsb", "wo"]},
     }],
     searchUrlEnd: "5222-53480-19255-0/1",
   }, {
     domain: "ebay.com",
     included: [{
       locales: { matches: ["en-US"] },
     }],
-    excluded: [{regions: ["au"]}],
+    excluded: [{ regions: ["au", "be", "ca", "ch", "gb", "ie", "nl"] }],
     searchUrlEnd: "711-53200-19255-0/1",
   }, {
     domain: "ebay.com.au",
     included: [{
       regions: ["au"],
       locales: { matches: ["cy", "en-GB", "gd"]},
     }],
     searchUrlEnd: "705-53470-19255-0/1",
@@ -115,16 +115,158 @@ const test = new SearchConfigTest({
   }, {
     domain: "ebay.nl",
     included: [{
       locales: { matches: ["fy-NL", "nl"] },
     }],
     excluded: [{regions: ["be"]}],
     searchUrlEnd: "1346-53482-19255-0/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.
+      domain: "befr.ebay.be",
+      included: [
+        {
+          regions: ["be"],
+          locales: { matches: ["br", "fr", "fy-NL", "nl", "wo"] },
+        },
+      ],
+      searchUrlEnd: "1553-53471-19255-0/1",
+    },
+    {
+      domain: "ebay.at",
+      included: [
+        {
+          regions: ["at"],
+          locales: { matches: ["de", "dsb", "hsb"] },
+        },
+      ],
+      searchUrlEnd: "5221-53469-19255-0/1",
+    },
+    {
+      domain: "ebay.ca",
+      included: [
+        {
+          locales: { matches: ["en-CA"] },
+        },
+        {
+          regions: ["ca"],
+          locales: { matches: ["br", "fr", "wo"] },
+        },
+      ],
+      searchUrlEnd: "706-53473-19255-0/1",
+    },
+    {
+      domain: "ebay.ch",
+      included: [
+        {
+          locales: { matches: ["rm"] },
+        },
+        {
+          regions: ["ch"],
+          locales: { matches: ["br", "de", "dsb", "fr", "hsb", "wo"] },
+        },
+      ],
+      searchUrlEnd: "5222-53480-19255-0/1",
+    },
+    {
+      domain: "ebay.com",
+      included: [
+        {
+          locales: { matches: ["en-US"] },
+        },
+      ],
+      excluded: [{ regions: ["au", "be", "ca", "ch", "gb", "ie", "nl"] }],
+      searchUrlEnd: "711-53200-19255-0/1",
+    },
+    {
+      domain: "ebay.com.au",
+      included: [
+        {
+          regions: ["au"],
+          locales: { matches: ["cy", "en-GB", "gd"] },
+        },
+      ],
+      searchUrlEnd: "705-53470-19255-0/1",
+    },
+    {
+      domain: "ebay.ie",
+      included: [
+        {
+          locales: { matches: ["ga-IE", "ie"] },
+        },
+        {
+          regions: ["ie"],
+          locales: { matches: ["cy", "en-GB", "gd"] },
+        },
+      ],
+      searchUrlEnd: "5282-53468-19255-0/1",
+    },
+    {
+      domain: "ebay.co.uk",
+      included: [
+        {
+          locales: { matches: ["cy", "en-GB", "gd"] },
+        },
+      ],
+      excluded: [{ regions: ["au", "ie"] }],
+      searchUrlEnd: "710-53481-19255-0/1",
+    },
+    {
+      domain: "ebay.de",
+      included: [
+        {
+          locales: { matches: ["de", "dsb", "hsb"] },
+        },
+      ],
+      excluded: [{ regions: ["at", "ch"] }],
+      searchUrlEnd: "707-53477-19255-0/1",
+    },
+    {
+      domain: "ebay.es",
+      included: [
+        {
+          locales: { matches: ["an", "ast", "ca", "es-ES", "eu", "gl"] },
+        },
+      ],
+      searchUrlEnd: "1185-53479-19255-0/1",
+    },
+    {
+      domain: "ebay.fr",
+      included: [
+        {
+          locales: { matches: ["br", "fr", "wo"] },
+        },
+      ],
+      excluded: [{ regions: ["be", "ca", "ch"] }],
+      searchUrlEnd: "709-53476-19255-0/1",
+    },
+    {
+      domain: "ebay.it",
+      included: [
+        {
+          locales: { matches: ["it", "lij"] },
+        },
+      ],
+      searchUrlEnd: "724-53478-19255-0/1",
+    },
+    {
+      domain: "ebay.nl",
+      included: [
+        {
+          locales: { matches: ["fy-NL", "nl"] },
+        },
+      ],
+      excluded: [{ regions: ["be"] }],
+      searchUrlEnd: "1346-53482-19255-0/1",
+    },
+  ],
   noSuggestionsURL: true,
 });
 
 add_task(async function setup() {
   await test.setup();
 });
 
 add_task(async function test_searchConfig_ebay() {