diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:55:19 +0200 |
commit | eb70e6e3d0bff11c25f14b1196025791bf2308fb (patch) | |
tree | 5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/components/places/tests/unifiedcomplete/test_enabled.js | |
parent | 32ead795290b3399d56b4708fc75b77d296f6a1a (diff) | |
download | UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip |
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/places/tests/unifiedcomplete/test_enabled.js')
-rw-r--r-- | toolkit/components/places/tests/unifiedcomplete/test_enabled.js | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_enabled.js b/toolkit/components/places/tests/unifiedcomplete/test_enabled.js deleted file mode 100644 index dee8df8ec..000000000 --- a/toolkit/components/places/tests/unifiedcomplete/test_enabled.js +++ /dev/null @@ -1,68 +0,0 @@ -add_task(function* test_enabled() { - // Test for bug 471903 to make sure searching in autocomplete can be turned on - // and off. Also test bug 463535 for pref changing search. - let uri = NetUtil.newURI("http://url/0"); - yield PlacesTestUtils.addVisits([ { uri: uri, title: "title" } ]); - - do_print("plain search"); - yield check_autocomplete({ - search: "url", - matches: [ { uri: uri, title: "title" } ] - }); - - do_print("search disabled"); - Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", false); - yield check_autocomplete({ - search: "url", - matches: [ ] - }); - - do_print("resume normal search"); - Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", true); - yield check_autocomplete({ - search: "url", - matches: [ { uri: uri, title: "title" } ] - }); - - yield cleanup(); -}); - -add_task(function* test_sync_enabled() { - // Initialize unified complete. - Cc["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"] - .getService(Ci.mozIPlacesAutoComplete); - - let types = [ "history", "bookmark", "openpage", "searches" ]; - - // Test the service keeps browser.urlbar.autocomplete.enabled synchronized - // with browser.urlbar.suggest prefs. - for (let type of types) { - Services.prefs.setBoolPref("browser.urlbar.suggest." + type, true); - } - Assert.equal(Services.prefs.getBoolPref("browser.urlbar.autocomplete.enabled"), true); - - // Disable autocomplete and check all the suggest prefs are set to false. - Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", false); - for (let type of types) { - Assert.equal(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), false); - } - - // Setting even a single suggest pref to true should enable autocomplete. - Services.prefs.setBoolPref("browser.urlbar.suggest.history", true); - for (let type of types.filter(t => t != "history")) { - Assert.equal(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), false); - } - Assert.equal(Services.prefs.getBoolPref("browser.urlbar.autocomplete.enabled"), true); - - // Disable autocoplete again, then re-enable it and check suggest prefs - // have been reset. - Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", false); - Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", true); - for (let type of types.filter(t => t != "history")) { - if (type == "searches") { - Assert.equal(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), false); - } else { - Assert.equal(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), true); - } - } -}); |