diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /browser/components/preferences/in-content/tests/browser_searchsuggestions.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/components/preferences/in-content/tests/browser_searchsuggestions.js')
-rw-r--r-- | browser/components/preferences/in-content/tests/browser_searchsuggestions.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/browser/components/preferences/in-content/tests/browser_searchsuggestions.js b/browser/components/preferences/in-content/tests/browser_searchsuggestions.js new file mode 100644 index 000000000..0185a23b9 --- /dev/null +++ b/browser/components/preferences/in-content/tests/browser_searchsuggestions.js @@ -0,0 +1,43 @@ +var original = Services.prefs.getBoolPref("browser.search.suggest.enabled"); + +registerCleanupFunction(() => { + Services.prefs.setBoolPref("browser.search.suggest.enabled", original); +}); + +// Open with suggestions enabled +add_task(function*() { + Services.prefs.setBoolPref("browser.search.suggest.enabled", true); + + yield openPreferencesViaOpenPreferencesAPI("search", undefined, { leaveOpen: true }); + + let doc = gBrowser.selectedBrowser.contentDocument; + let urlbarBox = doc.getElementById("urlBarSuggestion"); + ok(!urlbarBox.disabled, "Checkbox should be enabled"); + + Services.prefs.setBoolPref("browser.search.suggest.enabled", false); + + ok(urlbarBox.disabled, "Checkbox should be disabled"); + + gBrowser.removeCurrentTab(); +}); + +// Open with suggestions disabled +add_task(function*() { + Services.prefs.setBoolPref("browser.search.suggest.enabled", false); + + yield openPreferencesViaOpenPreferencesAPI("search", undefined, { leaveOpen: true }); + + let doc = gBrowser.selectedBrowser.contentDocument; + let urlbarBox = doc.getElementById("urlBarSuggestion"); + ok(urlbarBox.disabled, "Checkbox should be disabled"); + + Services.prefs.setBoolPref("browser.search.suggest.enabled", true); + + ok(!urlbarBox.disabled, "Checkbox should be enabled"); + + gBrowser.removeCurrentTab(); +}); + +add_task(function*() { + Services.prefs.setBoolPref("browser.search.suggest.enabled", original); +}); |