browser/components/preferences/in-content/tests/browser_advanced_update.js

changeset 2
7e26c7da4463
equal deleted inserted replaced
-1:000000000000 0:b8b8577c6e64
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 "use strict";
5
6 function test() {
7 waitForExplicitFinish();
8 resetPreferences();
9
10 registerCleanupFunction(resetPreferences);
11 Services.prefs.setBoolPref("browser.search.update", false);
12
13 open_preferences(runTest);
14 }
15
16 function runTest(win) {
17 let doc = win.document;
18 let enableSearchUpdate = doc.getElementById("enableSearchUpdate");
19
20 win.gotoPref("paneAdvanced");
21
22 let advancedPrefs = doc.getElementById("advancedPrefs");
23 let updateTab = doc.getElementById("updateTab");
24 advancedPrefs.selectedTab = updateTab;
25
26 is_element_visible(enableSearchUpdate, "Check search update preference is visible");
27
28 // Ensure that the update pref dialog reflects the actual pref value.
29 ok(!enableSearchUpdate.checked, "Ensure search updates are disabled");
30 Services.prefs.setBoolPref("browser.search.update", true);
31 ok(enableSearchUpdate.checked, "Ensure search updates are enabled");
32
33 gBrowser.removeCurrentTab();
34 win.close();
35 finish();
36 }
37
38 function resetPreferences() {
39 Services.prefs.clearUserPref("browser.search.update");
40 }

mercurial