fune/browser/components/preferences/in-content/tests/browser_advanced_update.js
Matthew Noorenberghe f7b4ef731a Bug 763232 - Handle shell service throwing on Linux in the advanced preferences pane. r=jaws
--HG--
extra : rebase_source : 527bc5faed3d1111f2d3d9dea3b4f101c9d0d8ee
2012-07-30 23:54:16 -07:00

40 lines
1.1 KiB
JavaScript

/* 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");
}