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 | "use strict"; |
michael@0 | 5 | |
michael@0 | 6 | function test() { |
michael@0 | 7 | waitForExplicitFinish(); |
michael@0 | 8 | resetPreferences(); |
michael@0 | 9 | |
michael@0 | 10 | registerCleanupFunction(resetPreferences); |
michael@0 | 11 | Services.prefs.setBoolPref("browser.search.update", false); |
michael@0 | 12 | |
michael@0 | 13 | open_preferences(runTest); |
michael@0 | 14 | } |
michael@0 | 15 | |
michael@0 | 16 | function runTest(win) { |
michael@0 | 17 | let doc = win.document; |
michael@0 | 18 | let enableSearchUpdate = doc.getElementById("enableSearchUpdate"); |
michael@0 | 19 | |
michael@0 | 20 | win.gotoPref("paneAdvanced"); |
michael@0 | 21 | |
michael@0 | 22 | let advancedPrefs = doc.getElementById("advancedPrefs"); |
michael@0 | 23 | let updateTab = doc.getElementById("updateTab"); |
michael@0 | 24 | advancedPrefs.selectedTab = updateTab; |
michael@0 | 25 | |
michael@0 | 26 | is_element_visible(enableSearchUpdate, "Check search update preference is visible"); |
michael@0 | 27 | |
michael@0 | 28 | // Ensure that the update pref dialog reflects the actual pref value. |
michael@0 | 29 | ok(!enableSearchUpdate.checked, "Ensure search updates are disabled"); |
michael@0 | 30 | Services.prefs.setBoolPref("browser.search.update", true); |
michael@0 | 31 | ok(enableSearchUpdate.checked, "Ensure search updates are enabled"); |
michael@0 | 32 | |
michael@0 | 33 | gBrowser.removeCurrentTab(); |
michael@0 | 34 | win.close(); |
michael@0 | 35 | finish(); |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | function resetPreferences() { |
michael@0 | 39 | Services.prefs.clearUserPref("browser.search.update"); |
michael@0 | 40 | } |