From 76a3743c4fcdb353a2d046e5a084fee199a28a13 Mon Sep 17 00:00:00 2001 From: Robert Strong Date: Tue, 10 Feb 2015 19:58:43 -0800 Subject: [PATCH] Bug 1131725 - Don't clear app.update.enabled and app.update.staging.enabled test user prefs in test_9999_cleanup.xul. r=spohl --- .../update/tests/chrome/test_9999_cleanup.xul | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul b/toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul index 8603c8a43a0c..c915b08a94ed 100644 --- a/toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul +++ b/toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul @@ -36,9 +36,17 @@ function runTest() { SimpleTest.waitForExplicitFinish(); + if (DEBUG_AUS_TEST) { + Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, true); + } + closeUpdateWindow(); - resetPrefs(); + // Always leave the app.update.enabled and app.update.staging.enabled + // preferences set to false when cleaning up. + Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, false); + Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false); + resetFiles(); removeUpdateDirsAndFiles(); reloadUpdateManagerData(); @@ -63,7 +71,7 @@ function runTest() { AUS_Ci.nsILocalFile); addonPrepDir.append(ADDON_PREP_DIR); // Not being able to remove the directory used to create the test add-ons - // will not adversely affect subsequent tests so wrap it in a try lock and + // will not adversely affect subsequent tests so wrap it in a try block and // don't test whether its removal was successful. try { removeDirRecursive(addonPrepDir); @@ -74,7 +82,16 @@ function runTest() { "Exception: " + e + "\n"); } - resetAddons(SimpleTest.finish); + resetAddons(finishTest); +} + +function finishTest() { + debugDump("entering"); + + if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_LOG)) { + Services.prefs.clearUserPref(PREF_APP_UPDATE_LOG); + } + SimpleTest.finish(); } ]]>