|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 function test() { |
|
5 waitForExplicitFinish(); |
|
6 resetPreferences(); |
|
7 |
|
8 registerCleanupFunction(resetPreferences); |
|
9 |
|
10 function observer(win, topic, data) { |
|
11 Services.obs.removeObserver(observer, "advanced-pane-loaded"); |
|
12 runTest(win); |
|
13 } |
|
14 Services.obs.addObserver(observer, "advanced-pane-loaded", false); |
|
15 |
|
16 Services.prefs.setBoolPref("browser.search.update", false); |
|
17 openDialog("chrome://browser/content/preferences/preferences.xul", "Preferences", |
|
18 "chrome,titlebar,toolbar,centerscreen,dialog=no", "paneAdvanced"); |
|
19 } |
|
20 |
|
21 function runTest(win) { |
|
22 let doc = win.document; |
|
23 let enableSearchUpdate = doc.getElementById("enableSearchUpdate"); |
|
24 |
|
25 // Ensure that the update pref dialog reflects the actual pref value. |
|
26 ok(!enableSearchUpdate.checked, "Ensure search updates are disabled"); |
|
27 Services.prefs.setBoolPref("browser.search.update", true); |
|
28 ok(enableSearchUpdate.checked, "Ensure search updates are enabled"); |
|
29 |
|
30 win.close(); |
|
31 finish(); |
|
32 } |
|
33 |
|
34 function resetPreferences() { |
|
35 Services.prefs.clearUserPref("browser.search.update"); |
|
36 } |