diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
commit | 0ddd00f1959c78ce37c14fef3c83401408fca3bf (patch) | |
tree | d408e02767c86cf8aac3acbb86722b03c77ede6f /toolkit/components/places/tests/unifiedcomplete/test_enabled.js | |
parent | 20f0905b33cbb18d1caa80c55e2f552c2e18957b (diff) | |
download | UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.gz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.lz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.xz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.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); - } - } -}); |