Bug 1405670 - Remove tests for search-metadata.json migration. r=adw, a=sledru
authorFlorian Quèze <florian@queze.net>
Fri, 17 Nov 2017 12:06:06 +0100
changeset 444881 827c49cd8d4076a30d07dbf2f99b65839dc6f15a
parent 444880 1922cbee6cf4e5b7756423babdd48bfe5b98c949
child 444882 bf0feade95714f94046a1a2af31a8964734c66cc
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw, sledru
bugs1405670
milestone58.0
Bug 1405670 - Remove tests for search-metadata.json migration. r=adw, a=sledru
toolkit/components/search/tests/xpcshell/data/langpack-metadata.json
toolkit/components/search/tests/xpcshell/data/metadata.json
toolkit/components/search/tests/xpcshell/data/search.sqlite
toolkit/components/search/tests/xpcshell/head_search.js
toolkit/components/search/tests/xpcshell/test_async.js
toolkit/components/search/tests/xpcshell/test_async_addon.js
toolkit/components/search/tests/xpcshell/test_async_addon_no_override.js
toolkit/components/search/tests/xpcshell/test_async_distribution.js
toolkit/components/search/tests/xpcshell/test_async_migration.js
toolkit/components/search/tests/xpcshell/test_async_profile_engine.js
toolkit/components/search/tests/xpcshell/test_chromeresource_icon2.js
toolkit/components/search/tests/xpcshell/test_defaultEngine.js
toolkit/components/search/tests/xpcshell/test_hidden.js
toolkit/components/search/tests/xpcshell/test_identifiers.js
toolkit/components/search/tests/xpcshell/test_invalid_engine_from_dir.js
toolkit/components/search/tests/xpcshell/test_json_cache.js
toolkit/components/search/tests/xpcshell/test_migration_langpack.js
toolkit/components/search/tests/xpcshell/test_multipleIcons.js
toolkit/components/search/tests/xpcshell/test_nocache.js
toolkit/components/search/tests/xpcshell/test_nodb.js
toolkit/components/search/tests/xpcshell/test_nodb_pluschanges.js
toolkit/components/search/tests/xpcshell/test_notifications.js
toolkit/components/search/tests/xpcshell/test_parseSubmissionURL.js
toolkit/components/search/tests/xpcshell/test_purpose.js
toolkit/components/search/tests/xpcshell/test_rel_searchform.js
toolkit/components/search/tests/xpcshell/test_require_engines_in_cache.js
toolkit/components/search/tests/xpcshell/test_resultDomain.js
toolkit/components/search/tests/xpcshell/test_save_sorted_engines.js
toolkit/components/search/tests/xpcshell/test_searchSuggest.js
toolkit/components/search/tests/xpcshell/test_selectedEngine.js
toolkit/components/search/tests/xpcshell/test_sync.js
toolkit/components/search/tests/xpcshell/test_sync_addon.js
toolkit/components/search/tests/xpcshell/test_sync_addon_no_override.js
toolkit/components/search/tests/xpcshell/test_sync_delay_fallback.js
toolkit/components/search/tests/xpcshell/test_sync_distribution.js
toolkit/components/search/tests/xpcshell/test_sync_fallback.js
toolkit/components/search/tests/xpcshell/test_sync_migration.js
toolkit/components/search/tests/xpcshell/test_sync_profile_engine.js
toolkit/components/search/tests/xpcshell/xpcshell.ini
deleted file mode 100644
--- a/toolkit/components/search/tests/xpcshell/data/langpack-metadata.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "[app]/bug645970.xml": {
-    "alias": "lp"
-  }
-}
deleted file mode 100644
--- a/toolkit/components/search/tests/xpcshell/data/metadata.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "[global]": {
-    "searchdefaultexpir": 1471013469846
-  },
-  "[profile]\/engine.xml": {
-    "order": 1,
-    "alias": "foo"
-  },
-  "[app]\/google.xml": {
-    "order": 2
-  },
-  "[app]\/yahoo.xml": {
-    "order": 3
-  },
-  "[app]\/bing.xml": {
-    "order": 4
-  },
-  "[app]\/amazondotcom.xml": {
-    "order": 5
-  },
-  "[app]\/ddg.xml": {
-    "order": 6
-  },
-  "[app]\/twitter.xml": {
-    "order": 7
-  },
-  "[app]\/wikipedia.xml": {
-    "order": 8
-  }
-}
deleted file mode 100644
index 983bb831a8aed422790006c0bd16f430b1b043ff..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/toolkit/components/search/tests/xpcshell/head_search.js
+++ b/toolkit/components/search/tests/xpcshell/head_search.js
@@ -142,33 +142,16 @@ function installDistributionEngine() {
       aPersistent.value = true;
       if (aProp == XRE_APP_DISTRIBUTION_DIR)
         return distDir.clone();
       return null;
     }
   });
 }
 
-/**
- * Clean the profile of any metadata files left from a previous run.
- */
-function removeMetadata() {
-  let file = gProfD.clone();
-  file.append("search-metadata.json");
-  if (file.exists()) {
-    file.remove(false);
-  }
-
-  file = gProfD.clone();
-  file.append("search.sqlite");
-  if (file.exists()) {
-    file.remove(false);
-  }
-}
-
 function promiseCacheData() {
   return new Promise(resolve => (async function() {
     let path = OS.Path.join(OS.Constants.Path.profileDir, CACHE_FILENAME);
     let bytes = await OS.File.read(path, {compression: "lz4"});
     resolve(JSON.parse(new TextDecoder().decode(bytes)));
   })());
 }
 
--- a/toolkit/components/search/tests/xpcshell/test_async.js
+++ b/toolkit/components/search/tests/xpcshell/test_async.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   do_test_pending();
 
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
 
   do_check_false(Services.search.isInitialized);
 
   Services.search.init(function search_initialized(aStatus) {
     do_check_true(Components.isSuccessCode(aStatus));
--- a/toolkit/components/search/tests/xpcshell/test_async_addon.js
+++ b/toolkit/components/search/tests/xpcshell/test_async_addon.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   do_test_pending();
 
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
   installAddonEngine();
 
   do_check_false(Services.search.isInitialized);
 
   Services.search.init(function search_initialized(aStatus) {
--- a/toolkit/components/search/tests/xpcshell/test_async_addon_no_override.js
+++ b/toolkit/components/search/tests/xpcshell/test_async_addon_no_override.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   do_test_pending();
 
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
   installAddonEngine("engine-override");
 
   do_check_false(Services.search.isInitialized);
 
   Services.search.init(function search_initialized(aStatus) {
--- a/toolkit/components/search/tests/xpcshell/test_async_distribution.js
+++ b/toolkit/components/search/tests/xpcshell/test_async_distribution.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   do_test_pending();
 
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
   installDistributionEngine();
 
   do_check_false(Services.search.isInitialized);
 
   Services.search.init(function search_initialized(aStatus) {
deleted file mode 100644
--- a/toolkit/components/search/tests/xpcshell/test_async_migration.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/* Test that legacy metadata from search-metadata.json is correctly
- * transferred to the new metadata storage. */
-
-function run_test() {
-  installTestEngine();
-
-  do_get_file("data/metadata.json").copyTo(gProfD, "search-metadata.json");
-
-  run_next_test();
-}
-
-add_task(async function test_async_metadata_migration() {
-  await asyncInit();
-  await promiseAfterCache();
-
-  // Check that the entries are placed as specified correctly
-  let metadata = await promiseEngineMetadata();
-  do_check_eq(metadata.engine.order, 1);
-  do_check_eq(metadata.engine.alias, "foo");
-
-  metadata = await promiseGlobalMetadata();
-  do_check_false(metadata.searchDefaultExpir);
-});
--- a/toolkit/components/search/tests/xpcshell/test_async_profile_engine.js
+++ b/toolkit/components/search/tests/xpcshell/test_async_profile_engine.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   do_test_pending();
 
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
 
   // Copy an engine in [profile]/searchplugins/ and ensure it's not
   // overriding the same file from a jar.
   // The description in the file we are copying is 'profile'.
   let dir = gProfD.clone();
--- a/toolkit/components/search/tests/xpcshell/test_chromeresource_icon2.js
+++ b/toolkit/components/search/tests/xpcshell/test_chromeresource_icon2.js
@@ -1,17 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /* Test that an installed engine can't use a resource URL for an icon */
 
 "use strict";
 
 function run_test() {
-  removeMetadata();
   useHttpServer();
 
   run_next_test();
 }
 
 add_task(async function test_installedresourceicon() {
   let [engine1, engine2] = await addTestEngines([
     { name: "engine-resourceicon", xmlFileName: "engine-resourceicon.xml" },
--- a/toolkit/components/search/tests/xpcshell/test_defaultEngine.js
+++ b/toolkit/components/search/tests/xpcshell/test_defaultEngine.js
@@ -4,17 +4,16 @@
 /*
  * Test that currentEngine and defaultEngine properties can be set and yield the
  * proper events and behavior (search results)
  */
 
 "use strict";
 
 function run_test() {
-  removeMetadata();
   useHttpServer();
 
   run_next_test();
 }
 
 add_task(async function test_defaultEngine() {
   let search = Services.search;
 
--- a/toolkit/components/search/tests/xpcshell/test_hidden.js
+++ b/toolkit/components/search/tests/xpcshell/test_hidden.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const kUrlPref = "geoSpecificDefaults.url";
 
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
 
   // 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"}');
 
--- a/toolkit/components/search/tests/xpcshell/test_identifiers.js
+++ b/toolkit/components/search/tests/xpcshell/test_identifiers.js
@@ -5,18 +5,16 @@
  * Test that a search engine's identifier can be extracted from the filename.
  */
 
 "use strict";
 
 const SEARCH_APP_DIR = 1;
 
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
 
   run_next_test();
 }
 
 add_test(function test_identifier() {
@@ -34,13 +32,11 @@ add_test(function test_identifier() {
     // An engine loaded from the profile directory won't have an identifier,
     // because it's not built-in.
     do_check_eq(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.)
     do_check_eq(jarEngine.identifier, "bug645970");
 
-    removeMetadata();
-    removeCacheFile();
     run_next_test();
   });
 });
--- a/toolkit/components/search/tests/xpcshell/test_invalid_engine_from_dir.js
+++ b/toolkit/components/search/tests/xpcshell/test_invalid_engine_from_dir.js
@@ -3,19 +3,16 @@
 
 /*
  * Test that invalid engine files with xml extensions will not break
  * initialization. See Bug 940446.
  */
 function run_test() {
   do_test_pending();
 
-  removeMetadata();
-  removeCacheFile();
-
   do_check_false(Services.search.isInitialized);
 
   let engineFile = gProfD.clone();
   engineFile.append("searchplugins");
   engineFile.append("test-search-engine.xml");
   engineFile.parent.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
 
   // Copy the invalid engine to the test profile.
@@ -23,13 +20,11 @@ function run_test() {
   engineTemplateFile.copyTo(engineFile.parent, "test-search-engine.xml");
 
   Services.search.init(function search_initialized(aStatus) {
     // The invalid engine should have been skipped and should not
     // have caused an exception.
     do_check_true(Components.isSuccessCode(aStatus));
     do_check_true(Services.search.isInitialized);
 
-    removeMetadata();
-    removeCacheFile();
     do_test_finished();
   });
 }
--- a/toolkit/components/search/tests/xpcshell/test_json_cache.js
+++ b/toolkit/components/search/tests/xpcshell/test_json_cache.js
@@ -2,42 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /*
  * Test initializing from the search cache.
  */
 
 "use strict";
 
-/**
- * Gets a directory from the directory service.
- * @param aKey
- *        The directory service key indicating the directory to get.
- */
-function getDir(aKey, aIFace) {
-  if (!aKey) {
-    do_throw("getDir requires a directory key!");
-  }
-
-  return Services.dirsvc.get(aKey, aIFace || Ci.nsIFile);
-}
-
-function makeURI(uri) {
-  return Services.io.newURI(uri);
-}
-
 var cacheTemplate, appPluginsPath, profPlugins;
 
 /**
  * Test reading from search.json.mozlz4
  */
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
   let cacheTemplateFile = do_get_file("data/search.json");
   cacheTemplate = readJSONFile(cacheTemplateFile);
   cacheTemplate.buildID = getAppInfo().platformBuildID;
 
   let engineFile = gProfD.clone();
   engineFile.append("searchplugins");
   engineFile.append("test-search-engine.xml");
   engineFile.parent.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
@@ -84,17 +64,16 @@ add_test(function test_cached_engine_pro
 
     do_check_true(engine instanceof Ci.nsISearchEngine);
     isSubObjectOf(EXPECTED_ENGINE.engine, engine);
 
     let engineFromSS = Services.search.getEngineByName(EXPECTED_ENGINE.engine.name);
     do_check_true(!!engineFromSS);
     isSubObjectOf(EXPECTED_ENGINE.engine, engineFromSS);
 
-    removeMetadata();
     removeCacheFile();
     run_next_test();
   });
 });
 
 /**
  * Test that the JSON cache written in the profile is correct.
  */
deleted file mode 100644
--- a/toolkit/components/search/tests/xpcshell/test_migration_langpack.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
-  do_load_manifest("data/chrome.manifest");
-
-  configureToLoadJarEngines();
-
-  // Unless we unset the XPCSHELL_TEST_PROFILE_DIR environment variable,
-  // engine._isDefault will be true for engines from the resource:// scheme,
-  // bypassing the codepath we want to test.
-  let env = Cc["@mozilla.org/process/environment;1"]
-              .getService(Ci.nsIEnvironment);
-  env.set("XPCSHELL_TEST_PROFILE_DIR", "");
-
-  do_get_file("data/langpack-metadata.json").copyTo(gProfD, "search-metadata.json");
-
-  do_check_false(Services.search.isInitialized);
-
-  run_next_test();
-}
-
-add_task(async function async_init() {
-  let commitPromise = promiseAfterCache();
-  await asyncInit();
-
-  let engine = Services.search.getEngineByName("bug645970");
-  do_check_neq(engine, null);
-  do_check_eq(engine.wrappedJSObject._id, "[app]/bug645970.xml");
-
-  await commitPromise;
-  let metadata = await promiseEngineMetadata();
-  do_check_eq(metadata.bug645970.alias, "lp");
-});
--- a/toolkit/components/search/tests/xpcshell/test_multipleIcons.js
+++ b/toolkit/components/search/tests/xpcshell/test_multipleIcons.js
@@ -3,17 +3,16 @@
 
 /*
  * Tests getIcons() and getIconURLBySize() on engine with multiple icons.
  */
 
 "use strict";
 
 function run_test() {
-  removeMetadata();
   useHttpServer();
 
   run_next_test();
 }
 
 add_task(async function test_multipleIcons() {
   let [engine] = await addTestEngines([
     { name: "IconsTest", xmlFileName: "engineImages.xml" },
--- a/toolkit/components/search/tests/xpcshell/test_nocache.js
+++ b/toolkit/components/search/tests/xpcshell/test_nocache.js
@@ -6,17 +6,16 @@
  * - without search.json.mozlz4
  *
  * Ensure that :
  * - nothing explodes;
  * - search.json.mozlz4 is created.
  */
 
 function run_test() {
-  removeCacheFile();
   do_load_manifest("data/chrome.manifest");
   useHttpServer();
 
   run_next_test();
 }
 
 add_task(async function test_nocache() {
   let search = Services.search;
@@ -25,17 +24,17 @@ add_task(async function test_nocache() {
 
   await new Promise((resolve, reject) => search.init(rv => {
     Components.isSuccessCode(rv) ? resolve() : reject();
   }));
 
   // Check that the cache is created at startup
   await afterCachePromise;
 
-  // Check that search.json has been created.
+  // Check that search.json.mozlz4 has been created.
   let cacheFile = gProfD.clone();
   cacheFile.append(CACHE_FILENAME);
   do_check_true(cacheFile.exists());
 
   // Add engine and wait for cache update
   await addTestEngines([
     { name: "Test search engine", xmlFileName: "engine.xml" },
   ]);
@@ -48,11 +47,9 @@ add_task(async function test_nocache() {
   let found = false;
   for (let engine of cache.engines) {
     if (engine._shortName == "test-search-engine") {
       found = true;
       break;
     }
   }
   do_check_true(found);
-
-  removeCacheFile();
 });
deleted file mode 100644
--- a/toolkit/components/search/tests/xpcshell/test_nodb.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * test_nodb: Start search engine
- * - without search-metadata.json
- * - without search.sqlite
- *
- * Ensure that :
- * - nothing explodes;
- * - no search-metadata.json is created.
- */
-
-
-function run_test() {
-  removeMetadata();
-
-  let search = Services.search;
-
-  do_test_pending();
-  search.init(function ss_initialized(rv) {
-    do_check_true(Components.isSuccessCode(rv));
-    do_timeout(500, function() {
-      // Check that search-metadata.json has not been
-      // created. Note that we cannot do much better
-      // than a timeout for checking a non-event.
-      let metadata = gProfD.clone();
-      metadata.append("search-metadata.json");
-      do_check_true(!metadata.exists());
-      removeMetadata();
-
-      do_test_finished();
-    });
-  });
-}
--- a/toolkit/components/search/tests/xpcshell/test_nodb_pluschanges.js
+++ b/toolkit/components/search/tests/xpcshell/test_nodb_pluschanges.js
@@ -1,16 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 
 /*
- * test_nodb: Start search engine
- * - without search-metadata.json
- * - without search.sqlite
+ * test_nodb: Start search service without existing cache file.
  *
  * Ensure that :
  * - nothing explodes;
  * - if we change the order, search.json.mozlz4 is updated;
  * - this search.json.mozlz4 can be parsed;
  * - the order stored in search.json.mozlz4 is consistent.
  *
  * Notes:
--- a/toolkit/components/search/tests/xpcshell/test_notifications.js
+++ b/toolkit/components/search/tests/xpcshell/test_notifications.js
@@ -51,17 +51,16 @@ function search_observer(subject, topic,
       }
       do_check_eq(gTestLog.length, expectedLog.length);
       do_test_finished();
       break;
   }
 }
 
 function run_test() {
-  removeMetadata();
   useHttpServer();
 
   do_register_cleanup(function cleanup() {
     Services.obs.removeObserver(search_observer, "browser-search-engine-modified");
   });
 
   do_test_pending();
 
--- a/toolkit/components/search/tests/xpcshell/test_parseSubmissionURL.js
+++ b/toolkit/components/search/tests/xpcshell/test_parseSubmissionURL.js
@@ -3,17 +3,16 @@
 
 /*
  * Tests getAlternateDomains API.
  */
 
 "use strict";
 
 function run_test() {
-  removeMetadata();
   useHttpServer();
 
   run_next_test();
 }
 
 add_task(async function test_parseSubmissionURL() {
   // Hide the default engines to prevent them from being used in the search.
   for (let engine of Services.search.getEngines()) {
--- a/toolkit/components/search/tests/xpcshell/test_purpose.js
+++ b/toolkit/components/search/tests/xpcshell/test_purpose.js
@@ -4,18 +4,16 @@
 /*
  * Test that a search purpose can be specified and that query parameters for
  * that purpose are included in the search URL.
  */
 
 "use strict";
 
 function run_test() {
-  removeMetadata();
-
   // The test engines used in this test need to be recognized as 'default'
   // engines, or their MozParams used to set the purpose will be ignored.
   let url = "resource://test/data/";
   let resProt = Services.io.getProtocolHandler("resource")
                         .QueryInterface(Ci.nsIResProtocolHandler);
   resProt.setSubstitution("search-plugins",
                           Services.io.newURI(url));
 
--- a/toolkit/components/search/tests/xpcshell/test_rel_searchform.js
+++ b/toolkit/components/search/tests/xpcshell/test_rel_searchform.js
@@ -3,17 +3,16 @@
 
 /*
  * Tests that <Url rel="searchform"/> is properly recognized as a searchForm.
  */
 
 "use strict";
 
 function run_test() {
-  removeMetadata();
   useHttpServer();
 
   run_next_test();
 }
 
 add_task(async function test_rel_searchform() {
   let engineNames = [
     "engine-rel-searchform.xml",
--- 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,15 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
   do_check_false(Services.search.isInitialized);
 
   run_next_test();
 }
 
--- a/toolkit/components/search/tests/xpcshell/test_resultDomain.js
+++ b/toolkit/components/search/tests/xpcshell/test_resultDomain.js
@@ -3,17 +3,16 @@
 
 /*
  * Tests getResultDomain API.
  */
 
 "use strict";
 
 function run_test() {
-  removeMetadata();
   useHttpServer();
 
   run_next_test();
 }
 
 add_task(async function test_resultDomain() {
   let [engine1, engine2, engine3] = await addTestEngines([
     { name: "Test search engine", xmlFileName: "engine.xml" },
--- a/toolkit/components/search/tests/xpcshell/test_save_sorted_engines.js
+++ b/toolkit/components/search/tests/xpcshell/test_save_sorted_engines.js
@@ -1,17 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /*
- * test_save_sorted_engines: Start search engine
- * - without search-metadata.json
- * - without search.sqlite
- *
- * Ensure that search-metadata.json is correct after:
+ * Ensure that metadata are stored correctly on disk after:
  * - moving an engine
  * - removing an engine
  * - adding a new engine
  *
  * Notes:
  * - we install the search engines of test "test_downloadAndAddEngines.js"
  * to ensure that this test is independent from locale, commercial agreements
  * and configuration of Firefox.
--- a/toolkit/components/search/tests/xpcshell/test_searchSuggest.js
+++ b/toolkit/components/search/tests/xpcshell/test_searchSuggest.js
@@ -21,18 +21,16 @@ var formHistoryStartup = Cc["@mozilla.or
 formHistoryStartup.observe(null, "profile-after-change", null);
 
 var httpServer = new HttpServer();
 var getEngine, postEngine, unresolvableEngine;
 
 function run_test() {
   Services.prefs.setBoolPref("browser.search.suggest.enabled", true);
 
-  removeMetadata();
-
   let server = useHttpServer();
   server.registerContentType("sjs", "sjs");
 
   do_register_cleanup(() => (async function cleanup() {
     // Remove added form history entries
     await updateSearchHistory("remove", null);
     Services.prefs.clearUserPref("browser.search.suggest.enabled");
   })());
--- a/toolkit/components/search/tests/xpcshell/test_selectedEngine.js
+++ b/toolkit/components/search/tests/xpcshell/test_selectedEngine.js
@@ -139,28 +139,20 @@ add_task(async function test_fallback_ke
 
   // After a restart, the currentEngine value should still be unchanged.
   await asyncReInit();
   do_check_eq(Services.search.currentEngine.name, defaultName);
 });
 
 
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
   do_check_false(Services.search.isInitialized);
 
   let engineDummyFile = gProfD.clone();
   engineDummyFile.append("searchplugins");
   engineDummyFile.append("test-search-engine.xml");
   let engineDir = engineDummyFile.parent;
   engineDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
 
   do_get_file("data/engine.xml").copyTo(engineDir, "engine.xml");
 
-  do_register_cleanup(function() {
-    removeMetadata();
-    removeCacheFile();
-  });
-
   run_next_test();
 }
--- a/toolkit/components/search/tests/xpcshell/test_sync.js
+++ b/toolkit/components/search/tests/xpcshell/test_sync.js
@@ -1,15 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
 
   do_check_false(Services.search.isInitialized);
 
   // test engines from dir are not loaded.
   let engines = Services.search.getEngines();
--- a/toolkit/components/search/tests/xpcshell/test_sync_addon.js
+++ b/toolkit/components/search/tests/xpcshell/test_sync_addon.js
@@ -1,15 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
   installAddonEngine();
 
   do_check_false(Services.search.isInitialized);
 
   // test the legacy add-on engine is _not_ loaded
--- a/toolkit/components/search/tests/xpcshell/test_sync_addon_no_override.js
+++ b/toolkit/components/search/tests/xpcshell/test_sync_addon_no_override.js
@@ -1,15 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
   installAddonEngine("engine-override");
 
   do_check_false(Services.search.isInitialized);
 
   // test the add-on engine isn't overriding our jar engine
--- a/toolkit/components/search/tests/xpcshell/test_sync_delay_fallback.js
+++ b/toolkit/components/search/tests/xpcshell/test_sync_delay_fallback.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   do_test_pending();
 
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
 
   do_check_false(Services.search.isInitialized);
   let fallback = false;
 
   Services.search.init(function search_initialized(aStatus) {
--- a/toolkit/components/search/tests/xpcshell/test_sync_distribution.js
+++ b/toolkit/components/search/tests/xpcshell/test_sync_distribution.js
@@ -1,15 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
   installDistributionEngine();
 
   do_check_false(Services.search.isInitialized);
 
   // test that the engine from the distribution overrides our jar engine
--- a/toolkit/components/search/tests/xpcshell/test_sync_fallback.js
+++ b/toolkit/components/search/tests/xpcshell/test_sync_fallback.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   do_test_pending();
 
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
 
   do_check_false(Services.search.isInitialized);
 
   Services.search.init(function search_initialized(aStatus) {
     do_check_true(Components.isSuccessCode(aStatus));
deleted file mode 100644
--- a/toolkit/components/search/tests/xpcshell/test_sync_migration.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/* Test that legacy metadata from search-metadata.json is correctly
- * transferred to the new metadata storage. */
-
-function run_test() {
-  installTestEngine();
-
-  do_get_file("data/metadata.json").copyTo(gProfD, "search-metadata.json");
-
-  run_next_test();
-}
-
-add_task(async function test_sync_metadata_migration() {
-  do_check_false(Services.search.isInitialized);
-  Services.search.getEngines();
-  do_check_true(Services.search.isInitialized);
-  await promiseAfterCache();
-
-  // Check that the entries are placed as specified correctly
-  let metadata = await promiseEngineMetadata();
-  do_check_eq(metadata.engine.order, 1);
-  do_check_eq(metadata.engine.alias, "foo");
-
-  metadata = await promiseGlobalMetadata();
-  do_check_false(metadata.searchDefaultExpir);
-});
--- a/toolkit/components/search/tests/xpcshell/test_sync_profile_engine.js
+++ b/toolkit/components/search/tests/xpcshell/test_sync_profile_engine.js
@@ -1,15 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
-  removeMetadata();
-  removeCacheFile();
-
   do_load_manifest("data/chrome.manifest");
 
   configureToLoadJarEngines();
 
   // Copy an engine in [profile]/searchplugins/ and ensure it's not
   // overriding the same file from a jar.
   // The description in the file we are copying is 'profile'.
   let dir = gProfD.clone();
--- a/toolkit/components/search/tests/xpcshell/xpcshell.ini
+++ b/toolkit/components/search/tests/xpcshell/xpcshell.ini
@@ -19,20 +19,17 @@ support-files =
   data/engine-system-purpose.xml
   data/engineImages.xml
   data/engine-chromeicon.xml
   data/engine-resourceicon.xml
   data/ico-size-16x16-png.ico
   data/invalid-engine.xml
   data/install.rdf
   data/list.json
-  data/langpack-metadata.json
-  data/metadata.json
   data/search.json
-  data/search.sqlite
   data/searchSuggestions.sjs
   data/searchTest.jar
 
 [test_nocache.js]
 [test_645970.js]
 [test_big_icon.js]
 [test_bug930456.js]
 [test_bug930456_child.js]
@@ -49,49 +46,45 @@ support-files =
 [test_location_migrate_countrycode_isUS.js]
 [test_location_migrate_no_countrycode_isUS.js]
 [test_location_migrate_no_countrycode_notUS.js]
 [test_location_partner.js]
 [test_location_funnelcake.js]
 [test_location_sync.js]
 [test_location_timeout.js]
 [test_location_timeout_xhr.js]
-[test_nodb.js]
 [test_nodb_pluschanges.js]
 [test_save_sorted_engines.js]
 [test_pref.js]
 [test_purpose.js]
 [test_defaultEngine.js]
 [test_notifications.js]
 [test_parseSubmissionURL.js]
 [test_SearchStaticData.js]
 [test_addEngine_callback.js]
-[test_migration_langpack.js]
 [test_multipleIcons.js]
 [test_resultDomain.js]
 [test_searchSuggest.js]
 [test_async.js]
 [test_async_addon.js]
 tags = addons
 [test_async_addon_no_override.js]
 tags = addons
 [test_async_distribution.js]
 [test_async_disthidden.js]
-[test_async_migration.js]
 [test_async_profile_engine.js]
 [test_sync.js]
 [test_sync_addon.js]
 tags = addons
 [test_sync_addon_no_override.js]
 tags = addons
 [test_sync_distribution.js]
 [test_sync_disthidden.js]
 [test_sync_fallback.js]
 [test_sync_delay_fallback.js]
-[test_sync_migration.js]
 [test_sync_profile_engine.js]
 [test_rel_searchform.js]
 [test_remove_profile_engine.js]
 [test_selectedEngine.js]
 [test_geodefaults.js]
 [test_hidden.js]
 [test_currentEngine_fallback.js]
 [test_require_engines_in_cache.js]