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