diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-04-23 13:38:38 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-04-23 13:38:38 -0400 |
commit | 0c84220a4f93a3e4f48d8d183aa0f5d8b15eb7ab (patch) | |
tree | 9bd44f6fe33bc8217cec52d5a3ba0c9b4ae03c40 /toolkit/components/search/tests/xpcshell/test_engineUpdate.js | |
parent | 228e55129b510f259535810ac31f1777b75ba526 (diff) | |
download | UXP-0c84220a4f93a3e4f48d8d183aa0f5d8b15eb7ab.tar UXP-0c84220a4f93a3e4f48d8d183aa0f5d8b15eb7ab.tar.gz UXP-0c84220a4f93a3e4f48d8d183aa0f5d8b15eb7ab.tar.lz UXP-0c84220a4f93a3e4f48d8d183aa0f5d8b15eb7ab.tar.xz UXP-0c84220a4f93a3e4f48d8d183aa0f5d8b15eb7ab.zip |
Remove tests from search service
Diffstat (limited to 'toolkit/components/search/tests/xpcshell/test_engineUpdate.js')
-rw-r--r-- | toolkit/components/search/tests/xpcshell/test_engineUpdate.js | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/toolkit/components/search/tests/xpcshell/test_engineUpdate.js b/toolkit/components/search/tests/xpcshell/test_engineUpdate.js deleted file mode 100644 index adff41ffb..000000000 --- a/toolkit/components/search/tests/xpcshell/test_engineUpdate.js +++ /dev/null @@ -1,50 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -/* Test that user-set metadata isn't lost on engine update */ - -"use strict"; - -function run_test() { - updateAppInfo(); - useHttpServer(); - - run_next_test(); -} - -add_task(function* test_engineUpdate() { - const KEYWORD = "keyword"; - const FILENAME = "engine.xml" - const TOPIC = "browser-search-engine-modified"; - const ONE_DAY_IN_MS = 24 * 60 * 60 * 1000; - - yield asyncInit(); - - let [engine] = yield addTestEngines([ - { name: "Test search engine", xmlFileName: FILENAME }, - ]); - - engine.alias = KEYWORD; - Services.search.moveEngine(engine, 0); - // can't have an accurate updateURL in the file since we can't know the test - // server origin, so manually set it - engine.wrappedJSObject._updateURL = gDataUrl + FILENAME; - - yield new Promise(resolve => { - Services.obs.addObserver(function obs(subject, topic, data) { - if (data == "engine-loaded") { - let loadedEngine = subject.QueryInterface(Ci.nsISearchEngine); - let rawEngine = loadedEngine.wrappedJSObject; - equal(loadedEngine.alias, KEYWORD, "Keyword not cleared by update"); - equal(rawEngine.getAttr("order"), 1, "Order not cleared by update"); - Services.obs.removeObserver(obs, TOPIC, false); - resolve(); - } - }, TOPIC, false); - - // set last update to 8 days ago, since the default interval is 7, then - // trigger an update - engine.wrappedJSObject.setAttr("updateexpir", Date.now() - (ONE_DAY_IN_MS * 8)); - Services.search.QueryInterface(Components.interfaces.nsITimerCallback).notify(null); - }); -}); |