зеркало из https://github.com/mozilla/pjs.git
Bug 585838 - Disable update checks in any tests running in the browser. r=dtownsend, a=dtownsend
This commit is contained in:
Родитель
290f6ab78f
Коммит
1076c1094d
|
@ -321,6 +321,7 @@ user_pref("security.default_personal_cert", "Select Automatically"); // Need to
|
|||
user_pref("network.http.prompt-temp-redirect", false);
|
||||
user_pref("media.cache_size", 100);
|
||||
user_pref("security.warn_viewing_mixed", false);
|
||||
user_pref("app.update.enabled", false);
|
||||
|
||||
// Only load extensions from the application and user profile
|
||||
// AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION
|
||||
|
|
|
@ -681,16 +681,17 @@ function verifyTestsRan() {
|
|||
* set back to the original values when each test has finished.
|
||||
*/
|
||||
function setupPrefs() {
|
||||
gAppUpdateChannel = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
|
||||
setUpdateChannel();
|
||||
|
||||
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_URL_OVERRIDE)) {
|
||||
gAppUpdateURL = Services.prefs.setIntPref(PREF_APP_UPDATE_URL_OVERRIDE);
|
||||
}
|
||||
|
||||
gAppUpdateChannel = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
|
||||
setUpdateChannel();
|
||||
|
||||
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_ENABLED)) {
|
||||
gAppUpdateEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED);
|
||||
}
|
||||
Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, true)
|
||||
|
||||
if (Services.prefs.prefHasUserValue(PREF_EXTENSIONS_UPDATE_URL)) {
|
||||
gExtUpdateURL = Services.prefs.getCharPref(PREF_EXTENSIONS_UPDATE_URL);
|
||||
|
@ -707,25 +708,25 @@ function setupPrefs() {
|
|||
* Resets the most common preferences used by tests to their original values.
|
||||
*/
|
||||
function resetPrefs() {
|
||||
if (gAppUpdateURL) {
|
||||
if (gAppUpdateURL !== undefined) {
|
||||
Services.prefs.setCharPref(PREF_APP_UPDATE_URL_OVERRIDE, gAppUpdateURL);
|
||||
}
|
||||
else if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_URL_OVERRIDE)) {
|
||||
Services.prefs.clearUserPref(PREF_APP_UPDATE_URL_OVERRIDE);
|
||||
}
|
||||
|
||||
if (gAppUpdateChannel) {
|
||||
if (gAppUpdateChannel !== undefined) {
|
||||
setUpdateChannel(gAppUpdateChannel);
|
||||
}
|
||||
|
||||
if (gAppUpdateEnabled) {
|
||||
if (gAppUpdateEnabled !== undefined) {
|
||||
Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, gAppUpdateEnabled);
|
||||
}
|
||||
else if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_ENABLED)) {
|
||||
Services.prefs.clearUserPref(PREF_APP_UPDATE_ENABLED);
|
||||
}
|
||||
|
||||
if (gExtUpdateURL) {
|
||||
if (gExtUpdateURL !== undefined) {
|
||||
Services.prefs.setCharPref(PREF_EXTENSIONS_UPDATE_URL, gExtUpdateURL);
|
||||
}
|
||||
else if (Services.prefs.prefHasUserValue(PREF_EXTENSIONS_UPDATE_URL)) {
|
||||
|
|
|
@ -92,6 +92,7 @@ function cleanUp() {
|
|||
* Sets the most commonly used preferences used by tests
|
||||
*/
|
||||
function setDefaultPrefs() {
|
||||
Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, true);
|
||||
// Don't display UI for a successful installation. Some apps may not set this
|
||||
// pref to false like Firefox does.
|
||||
Services.prefs.setBoolPref(PREF_APP_UPDATE_SHOW_INSTALLED_UI, false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче