Backed out changeset 90e7019e0fa8 (bug 1541416) for searchconfigs/test_amazon.js, test_duckduckgo.js, test_ebay.js CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Tue, 07 May 2019 21:17:52 +0300
changeset 534826 c98b1ae65a07e8af29fba7223c678f6355de58a0
parent 534825 3f601f3cf988a2a63a4b3e54bf9e5deb49b36309
child 534827 8a577f046a209ccc0d955d171882a8deaa74d5c9
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1541416
milestone68.0a1
backs out90e7019e0fa8e062f4b887d2802e203e4bd39300
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
Backed out changeset 90e7019e0fa8 (bug 1541416) for searchconfigs/test_amazon.js, test_duckduckgo.js, test_ebay.js CLOSED TREE
toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
toolkit/components/search/tests/xpcshell/searchconfigs/test_amazon.js
toolkit/components/search/tests/xpcshell/searchconfigs/test_duckduckgo.js
toolkit/components/search/tests/xpcshell/searchconfigs/test_ebay.js
toolkit/components/search/tests/xpcshell/searchconfigs/xpcshell.ini
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
+++ b/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js
@@ -196,75 +196,56 @@ class SearchConfigTest {
       if (inRegions && inLocales) {
         return true;
       }
     }
     return false;
   }
 
   /**
-   * Helper function to determine if an engine matches within a list.
-   * Due to Amazon's current complex setup with three different identifiers,
-   * if the identifier is 'amazon', then we do a startsWith match. Otherwise
-   * we expect the names to equal.
-   *
-   * @param {Array} engines
-   *   The list of engines to check.
-   * @param {string} identifier
-   *   The identifier to look for in the list.
-   * @returns {boolean}
-   *   Returns true if the engine is found within the list.
-   */
-  _enginesMatch(engines, identifier) {
-    if (identifier == "amazon") {
-      return !!engines.find(engine => engine.startsWith(identifier));
-    }
-    return engines.includes(identifier);
-  }
-
-  /**
    * Asserts whether the engines rules defined in the configuration are met.
    *
    * @param {Array} engines
    *   The list of engines to check.
    * @param {string} region
    *   The two-letter region code.
    * @param {string} locale
    *   The two-letter locale code.
    * @param {string} section
    *   The section of the configuration to check.
    */
   _assertEngineRules(engines, region, locale, section) {
     const infoString = `region: "${region}" locale: "${locale}"`;
     const config = this._config[section];
     const hasIncluded = "included" in config;
     const hasExcluded = "excluded" in config;
-    const identifierIncluded = this._enginesMatch(engines, this._config.identifier);
 
     // If there's not included/excluded, then this shouldn't be the default anywhere.
     if (section == "default" && !hasIncluded && !hasExcluded) {
-      Assert.ok(!identifierIncluded,
+      Assert.ok(!engines.includes(this._config.identifier),
         `Should not be ${section} for any locale/region,
          currently set for ${infoString}`);
       return;
     }
 
     // If there's no included section, we assume the engine is default everywhere
     // and we should apply the exclusions instead.
     let included = (hasIncluded &&
       this._localeRegionInSection(config.included, region, locale));
 
     let notExcluded = (hasExcluded &&
      !this._localeRegionInSection(config.excluded, region, locale));
 
     if (included || notExcluded) {
-      Assert.ok(identifierIncluded, `Should be ${section} for ${infoString}`);
+      Assert.ok(engines.includes(this._config.identifier),
+        `Should be ${section} for ${infoString}`);
       return;
     }
-    Assert.ok(!identifierIncluded, `Should not be ${section} for ${infoString}`);
+    Assert.ok(!engines.includes(this._config.identifier),
+      `Should not be ${section} for ${infoString}`);
   }
 
   /**
    * Asserts whether the engine is correctly set as default or not.
    *
    * @param {string} region
    *   The two-letter region code.
    * @param {string} locale
deleted file mode 100644
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/test_amazon.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const test = new SearchConfigTest({
-  identifier: "amazon",
-  default: {
-    // Not included anywhere.
-  },
-  available: {
-    included: [{
-      // We don't currently enforce by region, but do locale instead.
-      // regions: [
-      //   "at", "au", "be", "ca", "ch", "de", "fr", "gb", "ie", "it", "jp", "nl",
-      //   "us",
-      // ],
-      locales: {
-        matches: [
-          "ach", "af", "ar", "as", "az", "bg", "bn", "bn-IN", "br", "cak", "cy",
-          "da", "de", "dsb", "el", "eo", "es-AR", "eu", "fa", "ff", "fr",
-          "ga-IE", "gd", "gl", "gn", "gu-IN", "hr", "hsb", "hy-AM", "ia", "is",
-          "it", "ja-JP-mac", "ja", "ka", "km", "kn", "lij", "lt", "mai", "mk",
-          "ml", "mr", "ms", "my", "nb-NO", "nn-NO", "or", "pa-IN", "pt-PT", "ro",
-          "si", "son", "sq", "sr", "ta", "te", "th", "tl", "trs", "ur", "uz",
-          "wo", "zh-CN",
-        ],
-        startsWith: ["en"],
-      },
-    }],
-  },
-});
-
-add_task(async function setup() {
-  // We only need to do setup on one of the tests.
-  await test.setup();
-});
-
-add_task(async function test_searchConfig_amazon() {
-  await test.run();
-});
deleted file mode 100644
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/test_duckduckgo.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const test = new SearchConfigTest({
-  identifier: "ddg",
-  default: {
-    // Not included anywhere.
-  },
-  available: {
-    excluded: [
-      // Should be available everywhere.
-    ],
-  },
-});
-
-add_task(async function setup() {
-  await test.setup();
-});
-
-add_task(async function test_searchConfig_duckduckgo() {
-  await test.run();
-});
deleted file mode 100644
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/test_ebay.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const test = new SearchConfigTest({
-  identifier: "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"],
-      },
-    }],
-  },
-  // domains: {
-  //   // Note: These should be based on region, but we don't currently enforce that.
-  //   "ebay.com": {
-  //     locales: { matches: ["en-US"] },
-  //   },
-  //   "ebay.co.uk": {
-  //     locales: { matches: ["en-GB"] },
-  //   },
-  //   "ebay.ca": {
-  //     locales: { matches: ["en-CA"] },
-  //   },
-  //   "ebay.ie": {
-  //     locales: { matches: ["ie"] },
-  //   },
-  //   "ebay.fr": {
-  //     locales: { matches: ["fr"] },
-  //   },
-  //   "ebay.it": {
-  //     locales: { matches: ["it"] },
-  //   },
-  //   "ebay.de": {
-  //     locales: { matches: ["de"] },
-  //   },
-  //   "ebay.at": {
-  //     locales: { matches: ["ast"] },
-  //   },
-  //   "ebay.es": {
-  //     locales: { matches: ["an", "es-ES"] },
-  //   },
-  //   "ebay.nl": {
-  //     locales: { matches: ["nl"] },
-  //   },
-  //   "ebay.ch": {
-  //     locales: { matches: ["rm"] },
-  //   },
-  //   "ebay.au": {
-  //     regions: ["au"],
-  //   },
-  // },
-  // noSuggestionsURL: true,
-});
-
-add_task(async function setup() {
-  await test.setup();
-});
-
-add_task(async function test_searchConfig_ebay() {
-  await test.run();
-});
--- a/toolkit/components/search/tests/xpcshell/searchconfigs/xpcshell.ini
+++ b/toolkit/components/search/tests/xpcshell/searchconfigs/xpcshell.ini
@@ -1,32 +1,26 @@
 [DEFAULT]
 firefox-appdir = browser
 head = head_searchconfig.js
 skip-if = toolkit == 'android'
 support-files =
   ../../../../../../browser/locales/all-locales
 tags=searchconfig
 
-[test_amazon.js]
-requesttimeoutfactor = 2
 [test_baidu.js]
 # This is an extensive test and currently takes a long time. Therefore skip on
 # debug/asan and extend the timeout length otherwise.
 skip-if = debug || asan
 requesttimeoutfactor = 2
 [test_bing.js]
 # This is an extensive test and currently takes a long time. Therefore skip on
 # debug/asan and extend the timeout length otherwise.
 skip-if = debug || asan
 requesttimeoutfactor = 2
-[test_duckduckgo.js]
-requesttimeoutfactor = 2
-[test_ebay.js]
-requesttimeoutfactor = 2
 [test_google.js]
 # This is an extensive test and currently takes a long time. Therefore skip on
 # debug/asan and extend the timeout length otherwise.
 skip-if = debug || asan
 requesttimeoutfactor = 2
 [test_yandex.js]
 # This is an extensive test and currently takes a long time. Therefore skip on
 # debug/asan and extend the timeout length otherwise.