diff -r 000000000000 -r 6474c204b198 browser/components/preferences/in-content/tests/browser_advanced_update.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/components/preferences/in-content/tests/browser_advanced_update.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,40 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +function test() { + waitForExplicitFinish(); + resetPreferences(); + + registerCleanupFunction(resetPreferences); + Services.prefs.setBoolPref("browser.search.update", false); + + open_preferences(runTest); +} + +function runTest(win) { + let doc = win.document; + let enableSearchUpdate = doc.getElementById("enableSearchUpdate"); + + win.gotoPref("paneAdvanced"); + + let advancedPrefs = doc.getElementById("advancedPrefs"); + let updateTab = doc.getElementById("updateTab"); + advancedPrefs.selectedTab = updateTab; + + is_element_visible(enableSearchUpdate, "Check search update preference is visible"); + + // Ensure that the update pref dialog reflects the actual pref value. + ok(!enableSearchUpdate.checked, "Ensure search updates are disabled"); + Services.prefs.setBoolPref("browser.search.update", true); + ok(enableSearchUpdate.checked, "Ensure search updates are enabled"); + + gBrowser.removeCurrentTab(); + win.close(); + finish(); +} + +function resetPreferences() { + Services.prefs.clearUserPref("browser.search.update"); +}