Bug 1604929 - Move search's data/search-extensions to a slightly more descriptive and generic name. r=mikedeboer
authorMark Banner <standard8@mozilla.com>
Thu, 19 Dec 2019 21:57:36 +0000
changeset 507932 67971490febd58dce90828ea27579340d424a6c4
parent 507931 b69c49bc5500f44f41d8fc5147fa5817ce2da30a
child 507933 c1b33298b2579d1138eaa34349c57c9b56ad4d1e
push id36933
push useraciure@mozilla.com
push dateFri, 20 Dec 2019 04:15:17 +0000
treeherdermozilla-central@c8ce8b91465a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1604929, 645970
milestone73.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 1604929 - Move search's data/search-extensions to a slightly more descriptive and generic name. r=mikedeboer Also drops the bug645970 naming as we don't really need to reference that bug number any more. Differential Revision: https://phabricator.services.mozilla.com/D57680
toolkit/components/search/tests/xpcshell/data/engine-override.xml
toolkit/components/search/tests/xpcshell/data/search-extensions/bug645970/manifest.json
toolkit/components/search/tests/xpcshell/data/search-extensions/engines.json
toolkit/components/search/tests/xpcshell/data/search-extensions/hidden/manifest.json
toolkit/components/search/tests/xpcshell/data/search-extensions/list.json
toolkit/components/search/tests/xpcshell/head_opensearch.js
toolkit/components/search/tests/xpcshell/simple-engines/basic/manifest.json
toolkit/components/search/tests/xpcshell/simple-engines/engines.json
toolkit/components/search/tests/xpcshell/simple-engines/hidden/manifest.json
toolkit/components/search/tests/xpcshell/simple-engines/list.json
toolkit/components/search/tests/xpcshell/test_async.js
toolkit/components/search/tests/xpcshell/test_async_addon.js
toolkit/components/search/tests/xpcshell/test_async_distribution.js
toolkit/components/search/tests/xpcshell/test_distribution_unreadable.js
toolkit/components/search/tests/xpcshell/test_hidden.js
toolkit/components/search/tests/xpcshell/test_identifiers.js
toolkit/components/search/tests/xpcshell/test_maybereloadengine_update_distro.js
toolkit/components/search/tests/xpcshell/test_remove_profile_engine.js
toolkit/components/search/tests/xpcshell/test_require_engines_in_cache.js
toolkit/components/search/tests/xpcshell/test_sendSubmissionURL.js
toolkit/components/search/tests/xpcshell/xpcshell-common.ini
toolkit/components/search/tests/xpcshell/xpcshell-legacyconfig.ini
toolkit/components/search/tests/xpcshell/xpcshell.ini
--- a/toolkit/components/search/tests/xpcshell/data/engine-override.xml
+++ b/toolkit/components/search/tests/xpcshell/data/engine-override.xml
@@ -1,8 +1,8 @@
 <SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
-<ShortName>bug645970</ShortName>
+<ShortName>basic</ShortName>
 <Description>override</Description>
 <InputEncoding>UTF-8</InputEncoding>
 <Url type="text/html" method="GET" template="http://searchtest.local">
   <Param name="search" value="{searchTerms}"/>
 </Url>
 </SearchPlugin>
--- a/toolkit/components/search/tests/xpcshell/head_opensearch.js
+++ b/toolkit/components/search/tests/xpcshell/head_opensearch.js
@@ -51,17 +51,17 @@ function installDistributionEngine() {
   let distDir = dir.clone();
 
   dir.append("searchplugins");
   dir.create(dir.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
 
   dir.append("common");
   dir.create(dir.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
 
-  do_get_file("data/engine-override.xml").copyTo(dir, "bug645970.xml");
+  do_get_file("data/engine-override.xml").copyTo(dir, "basic.xml");
 
   Services.dirsvc.registerProvider({
     getFile(aProp, aPersistent) {
       aPersistent.value = true;
       if (aProp == XRE_APP_DISTRIBUTION_DIR) {
         return distDir.clone();
       }
       return null;
rename from toolkit/components/search/tests/xpcshell/data/search-extensions/bug645970/manifest.json
rename to toolkit/components/search/tests/xpcshell/simple-engines/basic/manifest.json
--- a/toolkit/components/search/tests/xpcshell/data/search-extensions/bug645970/manifest.json
+++ b/toolkit/components/search/tests/xpcshell/simple-engines/basic/manifest.json
@@ -1,22 +1,22 @@
 {
-  "name": "bug645970",
+  "name": "basic",
   "manifest_version": 2,
   "version": "1.0",
-  "description": "bug645970",
+  "description": "basic",
   "applications": {
     "gecko": {
-      "id": "bug645970@search.mozilla.org"
+      "id": "basic@search.mozilla.org"
     }
   },
   "hidden": true,
   "chrome_settings_overrides": {
     "search_provider": {
-      "name": "bug645970",
+      "name": "basic",
       "search_url": "https://ar.wikipedia.org/wiki/%D8%AE%D8%A7%D8%B5:%D8%A8%D8%AD%D8%AB",
       "params": [
         {
           "name": "search",
           "value": "{searchTerms}"
         },
         {
           "name": "sourceId",
rename from toolkit/components/search/tests/xpcshell/data/search-extensions/engines.json
rename to toolkit/components/search/tests/xpcshell/simple-engines/engines.json
--- a/toolkit/components/search/tests/xpcshell/data/search-extensions/engines.json
+++ b/toolkit/components/search/tests/xpcshell/simple-engines/engines.json
@@ -1,14 +1,14 @@
 {
   "data": [
     {
-      "engineName": "bug645970",
+      "engineName": "basic",
       "webExtension": {
-        "id":"bug645970@search.mozilla.org",
+        "id":"basic@search.mozilla.org",
         "version": "1.0"
       },
       "appliesTo": [{
         "included": { "everywhere": true },
         "default": "yes"
       }]
     }
   ]
rename from toolkit/components/search/tests/xpcshell/data/search-extensions/hidden/manifest.json
rename to toolkit/components/search/tests/xpcshell/simple-engines/hidden/manifest.json
rename from toolkit/components/search/tests/xpcshell/data/search-extensions/list.json
rename to toolkit/components/search/tests/xpcshell/simple-engines/list.json
--- a/toolkit/components/search/tests/xpcshell/data/search-extensions/list.json
+++ b/toolkit/components/search/tests/xpcshell/simple-engines/list.json
@@ -1,12 +1,12 @@
 {
   "default": {
       "visibleDefaultEngines": [
-            "bug645970"
+            "basic"
         ]
   },
   "hidden": {
       "visibleDefaultEngines": [
             "hidden"
         ]
   }
 }
--- a/toolkit/components/search/tests/xpcshell/test_async.js
+++ b/toolkit/components/search/tests/xpcshell/test_async.js
@@ -1,27 +1,27 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 add_task(async function setup() {
   await AddonTestUtils.promiseStartupManager();
-  await useTestEngines("data", "search-extensions");
+  await useTestEngines("simple-engines");
 });
 
 add_task(async function test_async() {
   Assert.ok(!Services.search.isInitialized);
 
   let aStatus = await Services.search.init();
   Assert.ok(Components.isSuccessCode(aStatus));
   Assert.ok(Services.search.isInitialized);
 
   // test engines from dir are not loaded.
   let engines = await Services.search.getEngines();
   Assert.equal(engines.length, 1);
 
   // test jar engine is loaded ok.
-  let engine = Services.search.getEngineByName("bug645970");
+  let engine = Services.search.getEngineByName("basic");
   Assert.notEqual(engine, null);
 
   // Check the hidden engine is not loaded.
   engine = Services.search.getEngineByName("hidden");
   Assert.equal(engine, null);
 });
--- a/toolkit/components/search/tests/xpcshell/test_async_addon.js
+++ b/toolkit/components/search/tests/xpcshell/test_async_addon.js
@@ -1,21 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 add_task(async function setup() {
   await AddonTestUtils.promiseStartupManager();
-  await useTestEngines("data", "search-extensions");
+  await useTestEngines("simple-engines");
 });
 
 add_task(async function test_async_addon() {
   installAddonEngine();
 
   Assert.ok(!Services.search.isInitialized);
 
   await Services.search.init();
   Assert.ok(Services.search.isInitialized);
 
   // test the legacy add-on engine is _not_ loaded
   let engines = await Services.search.getEngines();
-  Assert.equal(engines.length, 1);
+  Assert.equal(engines.length, 2);
   Assert.equal(Services.search.getEngineByName("addon"), null);
 });
--- a/toolkit/components/search/tests/xpcshell/test_async_distribution.js
+++ b/toolkit/components/search/tests/xpcshell/test_async_distribution.js
@@ -1,29 +1,29 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 add_task(async function setup() {
   await AddonTestUtils.promiseStartupManager();
-  await useTestEngines("data", "search-extensions");
+  await useTestEngines("simple-engines");
 });
 
 add_task(async function test_async_distribution() {
   installDistributionEngine();
 
   Assert.ok(!Services.search.isInitialized);
 
   return Services.search.init().then(function search_initialized(aStatus) {
     Assert.ok(Components.isSuccessCode(aStatus));
     Assert.ok(Services.search.isInitialized);
 
     // test that the engine from the distribution overrides our jar engine
     return Services.search.getEngines().then(engines => {
       Assert.equal(engines.length, 1);
 
-      let engine = Services.search.getEngineByName("bug645970");
+      let engine = Services.search.getEngineByName("basic");
       Assert.notEqual(engine, null);
 
       // check the engine we have is actually the one from the distribution
       Assert.equal(engine.description, "override");
     });
   });
 });
--- a/toolkit/components/search/tests/xpcshell/test_distribution_unreadable.js
+++ b/toolkit/components/search/tests/xpcshell/test_distribution_unreadable.js
@@ -3,17 +3,17 @@
 
 /**
  * Tests if the search service manages to initialize correctly when the
  * distribution directory can't be accessed due to access denied.
  */
 
 add_task(async function setup() {
   await AddonTestUtils.promiseStartupManager();
-  await useTestEngines("data", "search-extensions");
+  await useTestEngines("simple-engines");
 });
 
 add_task(async function test_distribution_unreadable() {
   const distributionDir = installDistributionEngine();
   const oldPermissions = distributionDir.permissions;
   distributionDir.permissions = 0o000;
 
   registerCleanupFunction(() => {
--- a/toolkit/components/search/tests/xpcshell/test_hidden.js
+++ b/toolkit/components/search/tests/xpcshell/test_hidden.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const kUrlPref = "geoSpecificDefaults.url";
 
 add_task(async function setup() {
-  await useTestEngines("data", "search-extensions");
+  await useTestEngines("simple-engines");
 
   // Geo specific defaults won't be fetched if there's no country code.
   Services.prefs.setCharPref(
     "browser.search.geoip.url",
     'data:application/json,{"country_code": "US"}'
   );
 
   // Make 'hidden' the only visible engine.
@@ -34,17 +34,17 @@ add_task(async function setup() {
 add_task(async function async_init() {
   let commitPromise = promiseAfterCache();
   await Services.search.init();
 
   let engines = await Services.search.getEngines();
   Assert.equal(engines.length, 1);
 
   // The default test jar engine has been hidden.
-  let engine = Services.search.getEngineByName("bug645970");
+  let engine = Services.search.getEngineByName("basic");
   Assert.equal(engine, null);
 
   // The hidden engine is visible.
   engine = Services.search.getEngineByName("hidden");
   Assert.notEqual(engine, null);
 
   // The next test does a sync init, which won't do the geoSpecificDefaults XHR,
   // so it depends on the metadata having been written to disk.
@@ -72,15 +72,15 @@ add_task(async function invalid_engine()
     .setCharPref(kUrlPref, url);
 
   await asyncReInit({ waitForRegionFetch: true });
 
   let engines = await Services.search.getEngines();
   Assert.equal(engines.length, 1);
 
   // The default test jar engine is visible.
-  let engine = Services.search.getEngineByName("bug645970");
+  let engine = Services.search.getEngineByName("basic");
   Assert.notEqual(engine, null);
 
   // The hidden engine is... hidden.
   engine = Services.search.getEngineByName("hidden");
   Assert.equal(engine, null);
 });
--- a/toolkit/components/search/tests/xpcshell/test_identifiers.js
+++ b/toolkit/components/search/tests/xpcshell/test_identifiers.js
@@ -5,35 +5,35 @@
  * Test that a search engine's identifier can be extracted from the filename.
  */
 
 "use strict";
 
 const SEARCH_APP_DIR = 1;
 
 add_task(async function setup() {
-  await useTestEngines("data", "search-extensions");
+  await useTestEngines("simple-engines");
   await AddonTestUtils.promiseStartupManager();
 });
 
 add_test(function test_identifier() {
   Services.search.init().then(async function initComplete(aResult) {
     info("init'd search service");
     Assert.ok(Components.isSuccessCode(aResult));
 
     await installTestEngine();
     let profileEngine = Services.search.getEngineByName(kTestEngineName);
-    let jarEngine = Services.search.getEngineByName("bug645970");
+    let jarEngine = Services.search.getEngineByName("basic");
 
     Assert.ok(profileEngine instanceof Ci.nsISearchEngine);
     Assert.ok(jarEngine instanceof Ci.nsISearchEngine);
 
     // An engine loaded from the profile directory won't have an identifier,
     // because it's not built-in.
     Assert.equal(profileEngine.identifier, null);
 
     // An engine loaded from a JAR will have an identifier corresponding to
     // the filename inside the JAR. (In this case it's the same as the name.)
-    Assert.equal(jarEngine.identifier, "bug645970");
+    Assert.equal(jarEngine.identifier, "basic");
 
     run_next_test();
   });
 });
--- a/toolkit/components/search/tests/xpcshell/test_maybereloadengine_update_distro.js
+++ b/toolkit/components/search/tests/xpcshell/test_maybereloadengine_update_distro.js
@@ -1,23 +1,23 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const SEARCH_SERVICE_TOPIC = "browser-search-service";
 
 add_task(async function setup() {
-  await useTestEngines("data", "search-extensions");
+  await useTestEngines("simple-engines");
   const defaultBranch = Services.prefs.getDefaultBranch(null);
 
   defaultBranch.setCharPref("distribution.id", "partner-test");
   defaultBranch.setCharPref(
     kDefaultenginenamePref,
-    "data:text/plain,browser.search.defaultenginename=bug645970"
+    "data:text/plain,browser.search.defaultenginename=basic"
   );
 
   installDistributionEngine();
 
   await AddonTestUtils.promiseStartupManager();
 });
 
 add_task(async function test_maybereloadengine_update_distro() {
@@ -41,22 +41,22 @@ add_task(async function test_maybereload
     Assert.ok(
       reloadObserved,
       "Engines should be reloaded during test, because region fetch succeeded"
     );
 
     let defaultEngine = await Services.search.getDefault();
     Assert.equal(
       defaultEngine._shortName,
-      "bug645970",
+      "basic",
       "Should have kept the same name"
     );
     Assert.equal(
       defaultEngine._loadPath,
-      "[distribution]/searchplugins/common/bug645970.xml",
+      "[distribution]/searchplugins/common/basic.xml",
       "Should have kept the distribution engine"
     );
     Assert.equal(
       defaultEngine
         ._getURLOfType("text/html")
         .getSubmission("", defaultEngine, "searchbar").uri.spec,
       "http://searchtest.local/?search=",
       "Should have kept the same submission URL"
--- a/toolkit/components/search/tests/xpcshell/test_remove_profile_engine.js
+++ b/toolkit/components/search/tests/xpcshell/test_remove_profile_engine.js
@@ -3,45 +3,43 @@
 
 add_task(async function run_test() {
   // Copy an engine to [profile]/searchplugin/
   let dir = do_get_profile().clone();
   dir.append("searchplugins");
   if (!dir.exists()) {
     dir.create(dir.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
   }
-  do_get_file("data/engine-override.xml").copyTo(dir, "bug645970.xml");
+  do_get_file("data/engine-override.xml").copyTo(dir, "basic.xml");
 
   let file = dir.clone();
-  file.append("bug645970.xml");
+  file.append("basic.xml");
   Assert.ok(file.exists());
 
   await AddonTestUtils.promiseStartupManager();
   await Services.search.init();
 
   // Install the same engine through a supported way.
   useHttpServer();
-  await addTestEngines([
-    { name: "bug645970", xmlFileName: "engine-override.xml" },
-  ]);
+  await addTestEngines([{ name: "basic", xmlFileName: "engine-override.xml" }]);
   await promiseAfterCache();
   let data = await promiseCacheData();
 
   // Put the filePath inside the cache file, to simulate what a pre-58 version
   // of Firefox would have done.
   for (let engine of data.engines) {
-    if (engine._name == "bug645970") {
+    if (engine._name == "basic") {
       engine.filePath = file.path;
     }
   }
 
   await promiseSaveCacheData(data);
 
   await asyncReInit();
 
   // test the engine is loaded ok.
-  let engine = Services.search.getEngineByName("bug645970");
+  let engine = Services.search.getEngineByName("basic");
   Assert.notEqual(engine, null);
 
   // remove the engine and verify the file has been removed too.
   await Services.search.removeEngine(engine);
   Assert.ok(!file.exists());
 });
--- a/toolkit/components/search/tests/xpcshell/test_require_engines_in_cache.js
+++ b/toolkit/components/search/tests/xpcshell/test_require_engines_in_cache.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 add_task(async function setup() {
-  await useTestEngines("data", "search-extensions");
+  await useTestEngines("simple-engines");
   await AddonTestUtils.promiseStartupManager();
 });
 
 add_task(async function ignore_cache_files_without_engines() {
   let commitPromise = promiseAfterCache();
   let engineCount = (await Services.search.getEngines()).length;
   Assert.equal(engineCount, 1);
 
--- a/toolkit/components/search/tests/xpcshell/test_sendSubmissionURL.js
+++ b/toolkit/components/search/tests/xpcshell/test_sendSubmissionURL.js
@@ -75,17 +75,17 @@ add_task(async function test_submission_
   Assert.equal(
     engineInfo.defaultSearchEngineData.submissionURL,
     "https://1.example.com/search?q=",
     "Should have given the submission url for a built-in engine."
   );
 });
 
 add_task(async function test_submission_url_distribution() {
-  const engine = Services.search.getEngineByName("bug645970");
+  const engine = Services.search.getEngineByName("basic");
   await Services.search.setDefault(engine);
 
   const engineInfo = await Services.search.getDefaultEngineInfo();
   Assert.equal(
     engineInfo.defaultSearchEngineData.submissionURL,
     "http://searchtest.local/?search=",
     "Should have given the submission url for a distribution engine."
   );
--- a/toolkit/components/search/tests/xpcshell/xpcshell-common.ini
+++ b/toolkit/components/search/tests/xpcshell/xpcshell-common.ini
@@ -1,14 +1,13 @@
 [test_addEngine_callback.js]
 [test_addEngineWithDetails.js]
 [test_addEngineWithDetailsObject.js]
 [test_addEngineWithExtensionID.js]
 [test_async_addon.js]
-tags = addons
 [test_async_distribution.js]
 [test_async_disthidden.js]
 [test_async.js]
 [test_big_icon.js]
 [test_bug930456_child.js]
 skip-if = true # Is confusing
 [test_bug930456.js]
 [test_chromeresource_icon2.js]
--- a/toolkit/components/search/tests/xpcshell/xpcshell-legacyconfig.ini
+++ b/toolkit/components/search/tests/xpcshell/xpcshell-legacyconfig.ini
@@ -35,25 +35,25 @@ support-files =
   data/ico-size-16x16-png.ico
   data/invalid-engine.xml
   data/install.rdf
   data/engines.json
   data/list.json
   data/search.json
   data/searchSuggestions.sjs
   data/searchTest.jar
-  data/search-extensions/engines.json
-  data/search-extensions/list.json
-  data/search-extensions/hidden/manifest.json
-  data/search-extensions/bug645970/manifest.json
   data/geolookup-extensions/list.json
   data/geolookup-extensions/multilocale/favicon.ico
   data/geolookup-extensions/multilocale/manifest.json
   data/geolookup-extensions/multilocale/_locales/af/messages.json
   data/geolookup-extensions/multilocale/_locales/an/messages.json
+  simple-engines/engines.json
+  simple-engines/list.json
+  simple-engines/hidden/manifest.json
+  simple-engines/basic/manifest.json
 
 [include:xpcshell-common.ini]
 
 # Testing with list.json specifically - Bug 1582942
 
 # Use geoSpecificDefaults - Bug 1542269
 [test_maybereloadengine_update.js]
 skip-if = ccov #Bug 1586580
--- a/toolkit/components/search/tests/xpcshell/xpcshell.ini
+++ b/toolkit/components/search/tests/xpcshell/xpcshell.ini
@@ -35,19 +35,19 @@ support-files =
   data/ico-size-16x16-png.ico
   data/invalid-engine.xml
   data/install.rdf
   data/engines.json
   data/list.json
   data/search.json
   data/searchSuggestions.sjs
   data/searchTest.jar
-  data/search-extensions/engines.json
-  data/search-extensions/list.json
-  data/search-extensions/hidden/manifest.json
-  data/search-extensions/bug645970/manifest.json
   data/geolookup-extensions/list.json
   data/geolookup-extensions/multilocale/favicon.ico
   data/geolookup-extensions/multilocale/manifest.json
   data/geolookup-extensions/multilocale/_locales/af/messages.json
   data/geolookup-extensions/multilocale/_locales/an/messages.json
+  simple-engines/engines.json
+  simple-engines/list.json
+  simple-engines/hidden/manifest.json
+  simple-engines/basic/manifest.json
 
 [include:xpcshell-common.ini]