Bug 1139780 - Only app update xpcshell tests that need debugging should have debug output. r=spohl

This commit is contained in:
Robert Strong 2015-03-05 15:55:48 -08:00
parent 7c3ada950d
commit 8c64803f34
51 changed files with 510 additions and 448 deletions

View File

@ -597,7 +597,7 @@ function getGREBinDir() {
* Components.stack.caller will be used.
*/
function logTestInfo(aText, aCaller) {
let caller = (aCaller ? aCaller : Components.stack.caller);
let caller = aCaller ? aCaller : Components.stack.caller;
let now = new Date;
let hh = now.getHours();
let mm = now.getMinutes();
@ -623,7 +623,6 @@ function logTestInfo(aText, aCaller) {
*/
function debugDump(aText, aCaller) {
if (DEBUG_AUS_TEST) {
let caller = aCaller ? aCaller : Components.stack.caller;
logTestInfo(aText, caller);
logTestInfo(aText, aCaller);
}
}

View File

@ -134,7 +134,7 @@ var gEnvLdLibraryPath;
// Set to true to log additional information for debugging. To log additional
// information for an individual test set DEBUG_AUS_TEST to true in the test's
// run_test function.
var DEBUG_AUS_TEST = true;
var DEBUG_AUS_TEST = false;
// Never set DEBUG_TEST_LOG to true except when running tests locally or on the
// try server since this will force a test that failed a parallel run to fail
// when the same test runs non-parallel so the log from parallel test run can
@ -732,7 +732,7 @@ if (MOZ_APP_NAME == "xulrunner") {
* Helper function for setting up the test environment.
*/
function setupTestCommon() {
logTestInfo("start - general test setup");
debugDump("start - general test setup");
do_test_pending();
@ -775,7 +775,7 @@ function setupTestCommon() {
// on platforms other than Windows. Since the test hasn't ran yet and the
// directory shouldn't exist finished this is non-fatal for the test.
if (applyDir.exists()) {
logTestInfo("attempting to remove directory. Path: " + applyDir.path);
debugDump("attempting to remove directory. Path: " + applyDir.path);
try {
removeDirRecursive(applyDir);
} catch (e) {
@ -795,7 +795,7 @@ function setupTestCommon() {
if (IS_WIN || IS_MACOSX) {
let updatesDir = getMockUpdRootD();
if (updatesDir.exists()) {
logTestInfo("attempting to remove directory. Path: " + updatesDir.path);
debugDump("attempting to remove directory. Path: " + updatesDir.path);
try {
removeDirRecursive(updatesDir);
} catch (e) {
@ -805,7 +805,7 @@ function setupTestCommon() {
}
}
logTestInfo("finish - general test setup");
debugDump("finish - general test setup");
}
/**
@ -813,7 +813,7 @@ function setupTestCommon() {
* as needed and attempts to restore the system to its original state.
*/
function cleanupTestCommon() {
logTestInfo("start - general test cleanup");
debugDump("start - general test cleanup");
// Force the update manager to reload the update data to prevent it from
// writing the old data to the files that have just been removed.
@ -881,7 +881,7 @@ function cleanupTestCommon() {
// Try to remove the directory used to apply updates. Since the test has
// already finished this is non-fatal for the test.
if (updatesDir.exists()) {
logTestInfo("attempting to remove directory. Path: " + updatesDir.path);
debugDump("attempting to remove directory. Path: " + updatesDir.path);
try {
removeDirRecursive(updatesDir);
} catch (e) {
@ -892,8 +892,8 @@ function cleanupTestCommon() {
let updatesRootDir = gUpdatesRootDir.clone();
while (updatesRootDir.path != updatesDir.path) {
if (updatesDir.exists()) {
logTestInfo("attempting to remove directory. Path: " +
updatesDir.path);
debugDump("attempting to remove directory. Path: " +
updatesDir.path);
try {
// Try to remove the directory without the recursive flag set
// since the top level directory has already had its contents
@ -916,7 +916,7 @@ function cleanupTestCommon() {
// Try to remove the directory used to apply updates. Since the test has
// already finished this is non-fatal for the test.
if (applyDir.exists()) {
logTestInfo("attempting to remove directory. Path: " + applyDir.path);
debugDump("attempting to remove directory. Path: " + applyDir.path);
try {
removeDirRecursive(applyDir);
} catch (e) {
@ -927,7 +927,7 @@ function cleanupTestCommon() {
resetEnvironment();
logTestInfo("finish - general test cleanup");
debugDump("finish - general test cleanup");
if (gRealDump) {
dump = gRealDump;
@ -987,8 +987,10 @@ function setDefaultPrefs() {
// 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);
// Enable Update logging
Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, true);
if (DEBUG_AUS_TEST) {
// Enable Update logging
Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, true);
}
}
/**
@ -1212,7 +1214,7 @@ function getSpecialFolderDir(aCSIDL) {
if (!path) {
return null;
}
logTestInfo("SHGetSpecialFolderPath returned path: " + path);
debugDump("SHGetSpecialFolderPath returned path: " + path);
let dir = Cc["@mozilla.org/file/local;1"].
createInstance(Ci.nsILocalFile);
dir.initWithPath(path);
@ -1343,7 +1345,7 @@ function getMockUpdRootDWin() {
let updatesDir = Cc["@mozilla.org/file/local;1"].
createInstance(Ci.nsILocalFile);
updatesDir.initWithPath(localAppDataDir.path + "\\" + relPathUpdates);
logTestInfo("returning UpdRootD Path: " + updatesDir.path);
debugDump("returning UpdRootD Path: " + updatesDir.path);
return updatesDir;
}
@ -1384,7 +1386,7 @@ function getMockUpdRootDMac() {
let updatesDir = Cc["@mozilla.org/file/local;1"].
createInstance(Ci.nsILocalFile);
updatesDir.initWithPath(pathUpdates);
logTestInfo("returning UpdRootD Path: " + updatesDir.path);
debugDump("returning UpdRootD Path: " + updatesDir.path);
return updatesDir;
}
@ -1406,7 +1408,7 @@ function lockDirectory(aDir) {
file.QueryInterface(Ci.nsILocalFileWin);
file.fileAttributesWin |= file.WFA_READONLY;
file.fileAttributesWin &= ~file.WFA_READWRITE;
logTestInfo("testing the successful creation of the lock file");
debugDump("testing the successful creation of the lock file");
do_check_true(file.exists());
do_check_false(file.isWritable());
}
@ -1425,7 +1427,7 @@ function unlockDirectory(aDir) {
file.QueryInterface(Ci.nsILocalFileWin);
file.fileAttributesWin |= file.WFA_READWRITE;
file.fileAttributesWin &= ~file.WFA_READONLY;
logTestInfo("removing and testing the successful removal of the lock file");
debugDump("removing and testing the successful removal of the lock file");
file.remove(false);
do_check_false(file.exists());
}
@ -1500,7 +1502,7 @@ function runUpdate(aExpectedExitValue, aExpectedStatus, aCallback) {
args = args.concat([callbackApp.parent.path, callbackApp.path]);
args = args.concat(gCallbackArgs);
}
logTestInfo("running the updater: " + updateBin.path + " " + args.join(" "));
debugDump("running the updater: " + updateBin.path + " " + args.join(" "));
let env = Cc["@mozilla.org/process/environment;1"].
getService(Ci.nsIEnvironment);
@ -1532,10 +1534,10 @@ function runUpdate(aExpectedExitValue, aExpectedStatus, aCallback) {
logTestInfo("contents of " + updateLog.path + ":\n" +
readFileBytes(updateLog).replace(/\r\n/g, "\n"));
}
logTestInfo("testing updater binary process exitValue against expected " +
"exit value");
debugDump("testing updater binary process exitValue against expected " +
"exit value");
do_check_eq(process.exitValue, aExpectedExitValue);
logTestInfo("testing update status against expected status");
debugDump("testing update status against expected status");
do_check_eq(status, aExpectedStatus);
if (aCallback !== null) {
@ -1551,7 +1553,7 @@ function runUpdate(aExpectedExitValue, aExpectedStatus, aCallback) {
* Helper function for updater tests to stage an update.
*/
function stageUpdate() {
logTestInfo("start - attempting to stage update");
debugDump("start - attempting to stage update");
Services.obs.addObserver(gUpdateStagedObserver, "update-staged", false);
setEnvironment();
@ -1561,7 +1563,7 @@ function stageUpdate() {
processUpdate(gUpdateManager.activeUpdate);
resetEnvironment();
logTestInfo("finish - attempting to stage update");
debugDump("finish - attempting to stage update");
}
/**
@ -1617,13 +1619,13 @@ function shouldRunServiceTest(aFirstTest, aSkipTest) {
let process = Cc["@mozilla.org/process/util;1"].
createInstance(Ci.nsIProcess);
process.init(helperBin);
logTestInfo("checking if the service exists on this machine.");
debugDump("checking if the service exists on this machine.");
process.run(true, args, args.length);
if (process.exitValue == 0xEE) {
do_throw("test registry key exists but this test can only run on systems " +
"with the maintenance service installed.");
} else {
logTestInfo("service exists, return value: " + process.exitValue);
debugDump("service exists, return value: " + process.exitValue);
}
// If this is the first test in the series, then there is no reason the
@ -1697,8 +1699,8 @@ function setupAppFilesAsync() {
* the files.
*/
function setupAppFiles() {
logTestInfo("start - copying or creating symlinks to application files " +
"for the test");
debugDump("start - copying or creating symlinks to application files " +
"for the test");
let destDir = getApplyDirFile(null, true);
if (!destDir.exists()) {
@ -1751,8 +1753,8 @@ function setupAppFiles() {
copyFileToTestAppDir(aAppFile.relPath, aAppFile.inGreDir);
});
logTestInfo("finish - copying or creating symlinks to application files " +
"for the test");
debugDump("finish - copying or creating symlinks to application files " +
"for the test");
}
/**
@ -1784,9 +1786,8 @@ function copyFileToTestAppDir(aFileRelPath, aInGreDir) {
}
if (IS_MACOSX && !srcFile.exists()) {
logTestInfo("unable to copy file since it doesn't exist! Checking if " +
fileRelPath + ".app exists. Path: " +
srcFile.path);
debugDump("unable to copy file since it doesn't exist! Checking if " +
fileRelPath + ".app exists. Path: " + srcFile.path);
// gGREDirOrig and gGREBinDirOrig must always be cloned when changing its
// properties
srcFile = aInGreDir ? gGREDirOrig.clone() : gGREBinDirOrig.clone();
@ -1839,7 +1840,7 @@ function copyFileToTestAppDir(aFileRelPath, aInGreDir) {
process.init(ln);
let args = ["-s", srcFile.path, destFile.path];
process.run(true, args, args.length);
logTestInfo("verifying symlink. Path: " + destFile.path);
debugDump("verifying symlink. Path: " + destFile.path);
do_check_true(destFile.isSymlink());
} catch (e) {
do_throw("Unable to create symlink for file! Path: " + srcFile.path +
@ -1868,15 +1869,15 @@ function attemptServiceInstall(aSkipTest) {
let maintSvcDir = getSpecialFolderDir(CSIDL_PROGRAM_FILESX86);
if (maintSvcDir) {
maintSvcDir.append("Mozilla Maintenance Service");
logTestInfo("using CSIDL_PROGRAM_FILESX86 - maintenance service install " +
"directory path: " + maintSvcDir.path);
debugDump("using CSIDL_PROGRAM_FILESX86 - maintenance service install " +
"directory path: " + maintSvcDir.path);
}
if (!maintSvcDir || !maintSvcDir.exists()) {
maintSvcDir = getSpecialFolderDir(CSIDL_PROGRAM_FILES);
if (maintSvcDir) {
maintSvcDir.append("Mozilla Maintenance Service");
logTestInfo("using CSIDL_PROGRAM_FILES - maintenance service install " +
"directory path: " + maintSvcDir.path);
debugDump("using CSIDL_PROGRAM_FILES - maintenance service install " +
"directory path: " + maintSvcDir.path);
}
}
if (!maintSvcDir || !maintSvcDir.exists()) {
@ -1891,8 +1892,8 @@ function attemptServiceInstall(aSkipTest) {
let buildMaintSvcBin = getGREBinDir();
buildMaintSvcBin.append(FILE_MAINTENANCE_SERVICE_BIN);
if (readFileBytes(oldMaintSvcBin) == readFileBytes(buildMaintSvcBin)) {
logTestInfo("installed maintenance service binary is the same as the " +
"build's maintenance service binary");
debugDump("installed maintenance service binary is the same as the " +
"build's maintenance service binary");
return true;
}
let backupMaintSvcBin = maintSvcDir.clone();
@ -1949,7 +1950,7 @@ function runUpdateUsingService(aInitialStatus, aExpectedStatus, aCheckSvcLog) {
// Check the service logs for a successful update
function checkServiceLogs(aOriginalContents) {
let contents = readServiceLogFile();
logTestInfo("the contents of maintenanceservice.log:\n" + contents + "\n");
debugDump("the contents of maintenanceservice.log:\n" + contents + "\n");
do_check_neq(contents, aOriginalContents);
do_check_neq(contents.indexOf(LOG_SVC_SUCCESSFUL_LAUNCH), -1);
}
@ -1972,7 +1973,7 @@ function runUpdateUsingService(aInitialStatus, aExpectedStatus, aCheckSvcLog) {
}
function waitForServiceStop(aFailTest) {
waitServiceApps();
logTestInfo("waiting for service to stop if necessary...");
debugDump("waiting for service to stop if necessary...");
// Use the helper bin to ensure the service is stopped. If not
// stopped then wait for the service to be stopped (at most 120 seconds)
let helperBin = getTestDirFile(FILE_HELPER_BIN);
@ -1982,7 +1983,7 @@ function runUpdateUsingService(aInitialStatus, aExpectedStatus, aCheckSvcLog) {
let helperBinProcess = Cc["@mozilla.org/process/util;1"].
createInstance(Ci.nsIProcess);
helperBinProcess.init(helperBin);
logTestInfo("stopping service...");
debugDump("stopping service...");
helperBinProcess.run(true, helperBinArgs, helperBinArgs.length);
if (helperBinProcess.exitValue == 0xEE) {
do_throw("The service does not exist on this machine. Return value: " +
@ -1996,13 +1997,12 @@ function runUpdateUsingService(aInitialStatus, aExpectedStatus, aCheckSvcLog) {
helperBinProcess.exitValue + ". May cause failures.");
}
} else {
logTestInfo("service stopped.");
debugDump("service stopped");
}
waitServiceApps();
}
function waitForApplicationStop(aApplication) {
logTestInfo("waiting for " + aApplication + " to stop if " +
"necessary...");
debugDump("waiting for " + aApplication + " to stop if necessary..");
// Use the helper bin to ensure the application is stopped.
// If not, then wait for it to be stopped (at most 120 seconds)
let helperBin = getTestDirFile(FILE_HELPER_BIN);
@ -2087,7 +2087,7 @@ function runUpdateUsingService(aInitialStatus, aExpectedStatus, aCheckSvcLog) {
let process = Cc["@mozilla.org/process/util;1"].
createInstance(Ci.nsIProcess);
process.init(launchBin);
logTestInfo("launching " + launchBin.path + " " + args.join(" "));
debugDump("launching " + launchBin.path + " " + args.join(" "));
// Firefox does not wait for the service command to finish, but
// we still launch the process sync to avoid intermittent failures with
// the log file not being written out yet.
@ -2105,8 +2105,8 @@ function runUpdateUsingService(aInitialStatus, aExpectedStatus, aCheckSvcLog) {
// could be equal to STATE_PENDING_SVC.
if (status == STATE_APPLYING ||
status == STATE_PENDING_SVC) {
logTestInfo("still waiting to see the " + aExpectedStatus +
" status, got " + status + " for now...");
debugDump("still waiting to see the " + aExpectedStatus +
" status, got " + status + " for now...");
return;
}
@ -2125,7 +2125,7 @@ function runUpdateUsingService(aInitialStatus, aExpectedStatus, aCheckSvcLog) {
logTestInfo("contents of " + updateLog.path + ":\n" +
readFileBytes(updateLog).replace(/\r\n/g, "\n"));
}
logTestInfo("testing update status against expected status");
debugDump("testing update status against expected status");
do_check_eq(status, aExpectedStatus);
if (aCheckSvcLog) {
@ -2192,7 +2192,7 @@ function waitForHelperSleep() {
do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the helper " +
"message file to no longer be in use. Path: " + output.path);
}
logTestInfo("failed to remove file. Path: " + output.path);
debugDump("failed to remove file. Path: " + output.path);
do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
return;
}
@ -2490,7 +2490,7 @@ function checkUpdateLogContents(aCompareLogFile, aExcludeDistributionDir) {
// Don't write the contents of the file to the log to reduce log spam
// unless there is a failure.
if (compareLogContents == updateLogContents) {
logTestInfo("log contents are correct");
debugDump("log contents are correct");
do_check_true(true);
} else {
logTestInfo("log contents are not correct");
@ -2509,7 +2509,7 @@ function checkUpdateLogContains(aCheckString) {
updateLog.append(FILE_UPDATE_LOG);
let updateLogContents = readFileBytes(updateLog);
if (updateLogContents.indexOf(aCheckString) != -1) {
logTestInfo("log file does contain: " + aCheckString);
debugDump("log file does contain: " + aCheckString);
do_check_true(true);
} else {
logTestInfo("log file does not contain: " + aCheckString);
@ -2535,10 +2535,10 @@ function checkUpdateLogContains(aCheckString) {
*/
function checkFilesAfterUpdateSuccess(aGetFileFunc, aStageDirExists,
aToBeDeletedDirExists) {
logTestInfo("testing contents of files after a successful update");
debugDump("testing contents of files after a successful update");
gTestFiles.forEach(function CFAUS_TF_FE(aTestFile) {
let testFile = aGetFileFunc(aTestFile.relPathDir + aTestFile.fileName, true);
logTestInfo("testing file: " + testFile.path);
debugDump("testing file: " + testFile.path);
if (aTestFile.compareFile || aTestFile.compareContents) {
do_check_true(testFile.exists());
@ -2551,10 +2551,9 @@ function checkFilesAfterUpdateSuccess(aGetFileFunc, aStageDirExists,
logPerms += "original permissions: " +
aTestFile.originalPerms.toString(8) + ", ";
}
logPerms += "compare permissions : " +
aTestFile.comparePerms.toString(8) + ", ";
logPerms += "updated permissions : " + testFile.permissions.toString(8);
logTestInfo(logPerms);
debugDump("compare permissions : " +
aTestFile.comparePerms.toString(8) + ", " +
"updated permissions : " + testFile.permissions.toString(8));
do_check_eq(testFile.permissions & 0xfff, aTestFile.comparePerms & 0xfff);
}
@ -2565,7 +2564,7 @@ function checkFilesAfterUpdateSuccess(aGetFileFunc, aStageDirExists,
// Don't write the contents of the file to the log to reduce log spam
// unless there is a failure.
if (fileContents1 == fileContents2) {
logTestInfo("file contents are correct");
debugDump("file contents are correct");
do_check_true(true);
} else {
logTestInfo("file contents are not correct");
@ -2576,11 +2575,11 @@ function checkFilesAfterUpdateSuccess(aGetFileFunc, aStageDirExists,
}
});
logTestInfo("testing operations specified in removed-files were performed " +
"after a successful update");
debugDump("testing operations specified in removed-files were performed " +
"after a successful update");
gTestDirs.forEach(function CFAUS_TD_FE(aTestDir) {
let testDir = aGetFileFunc(aTestDir.relPathDir, true);
logTestInfo("testing directory: " + testDir.path);
debugDump("testing directory: " + testDir.path);
if (aTestDir.dirRemoved) {
do_check_false(testDir.exists());
} else {
@ -2589,7 +2588,7 @@ function checkFilesAfterUpdateSuccess(aGetFileFunc, aStageDirExists,
if (aTestDir.files) {
aTestDir.files.forEach(function CFAUS_TD_F_FE(aTestFile) {
let testFile = aGetFileFunc(aTestDir.relPathDir + aTestFile, true);
logTestInfo("testing directory file: " + testFile.path);
debugDump("testing directory file: " + testFile.path);
if (aTestDir.filesRemoved) {
do_check_false(testFile.exists());
} else {
@ -2601,13 +2600,13 @@ function checkFilesAfterUpdateSuccess(aGetFileFunc, aStageDirExists,
if (aTestDir.subDirs) {
aTestDir.subDirs.forEach(function CFAUS_TD_SD_FE(aSubDir) {
let testSubDir = aGetFileFunc(aTestDir.relPathDir + aSubDir, true);
logTestInfo("testing sub-directory: " + testSubDir.path);
debugDump("testing sub-directory: " + testSubDir.path);
do_check_true(testSubDir.exists());
if (aTestDir.subDirFiles) {
aTestDir.subDirFiles.forEach(function CFAUS_TD_SDF_FE(aTestFile) {
let testFile = aGetFileFunc(aTestDir.relPathDir +
aSubDir + aTestFile, true);
logTestInfo("testing sub-directory file: " + testFile.path);
debugDump("testing sub-directory file: " + testFile.path);
do_check_true(testFile.exists());
});
}
@ -2637,10 +2636,10 @@ function checkFilesAfterUpdateSuccess(aGetFileFunc, aStageDirExists,
*/
function checkFilesAfterUpdateFailure(aGetFileFunc, aStageDirExists,
aToBeDeletedDirExists) {
logTestInfo("testing contents of files after a failed update");
debugDump("testing contents of files after a failed update");
gTestFiles.forEach(function CFAUF_TF_FE(aTestFile) {
let testFile = aGetFileFunc(aTestFile.relPathDir + aTestFile.fileName, true);
logTestInfo("testing file: " + testFile.path);
debugDump("testing file: " + testFile.path);
if (aTestFile.compareFile || aTestFile.compareContents) {
do_check_true(testFile.exists());
@ -2653,10 +2652,9 @@ function checkFilesAfterUpdateFailure(aGetFileFunc, aStageDirExists,
logPerms += "original permissions: " +
aTestFile.originalPerms.toString(8) + ", ";
}
logPerms += "compare permissions : " +
aTestFile.comparePerms.toString(8) + ", ";
logPerms += "updated permissions : " + testFile.permissions.toString(8);
logTestInfo(logPerms);
debugDump("compare permissions : " +
aTestFile.comparePerms.toString(8) + ", " +
"updated permissions : " + testFile.permissions.toString(8));
do_check_eq(testFile.permissions & 0xfff, aTestFile.comparePerms & 0xfff);
}
@ -2667,7 +2665,7 @@ function checkFilesAfterUpdateFailure(aGetFileFunc, aStageDirExists,
// Don't write the contents of the file to the log to reduce log spam
// unless there is a failure.
if (fileContents1 == fileContents2) {
logTestInfo("file contents are correct");
debugDump("file contents are correct");
do_check_true(true);
} else {
logTestInfo("file contents are not correct");
@ -2678,17 +2676,17 @@ function checkFilesAfterUpdateFailure(aGetFileFunc, aStageDirExists,
}
});
logTestInfo("testing operations specified in removed-files were not " +
"performed after a failed update");
debugDump("testing operations specified in removed-files were not " +
"performed after a failed update");
gTestDirs.forEach(function CFAUF_TD_FE(aTestDir) {
let testDir = aGetFileFunc(aTestDir.relPathDir, true);
logTestInfo("testing directory: " + testDir.path);
debugDump("testing directory: " + testDir.path);
do_check_true(testDir.exists());
if (aTestDir.files) {
aTestDir.files.forEach(function CFAUS_TD_F_FE(aTestFile) {
let testFile = aGetFileFunc(aTestDir.relPathDir + aTestFile, true);
logTestInfo("testing directory file: " + testFile.path);
debugDump("testing directory file: " + testFile.path);
do_check_true(testFile.exists());
});
}
@ -2696,13 +2694,13 @@ function checkFilesAfterUpdateFailure(aGetFileFunc, aStageDirExists,
if (aTestDir.subDirs) {
aTestDir.subDirs.forEach(function CFAUS_TD_SD_FE(aSubDir) {
let testSubDir = aGetFileFunc(aTestDir.relPathDir + aSubDir, true);
logTestInfo("testing sub-directory: " + testSubDir.path);
debugDump("testing sub-directory: " + testSubDir.path);
do_check_true(testSubDir.exists());
if (aTestDir.subDirFiles) {
aTestDir.subDirFiles.forEach(function CFAUS_TD_SDF_FE(aTestFile) {
let testFile = aGetFileFunc(aTestDir.relPathDir +
aSubDir + aTestFile, true);
logTestInfo("testing sub-directory file: " + testFile.path);
debugDump("testing sub-directory file: " + testFile.path);
do_check_true(testFile.exists());
});
}
@ -2731,47 +2729,47 @@ function checkFilesAfterUpdateFailure(aGetFileFunc, aStageDirExists,
*/
function checkFilesAfterUpdateCommon(aGetFileFunc, aStageDirExists,
aToBeDeletedDirExists) {
logTestInfo("testing extra directories");
debugDump("testing extra directories");
let stageDir = getStageDirFile(null, true);
logTestInfo("testing directory should " +
(aStageDirExists ? "" : "not ") +
"exist: " + stageDir.path);
debugDump("testing directory should " +
(aStageDirExists ? "" : "not ") +
"exist: " + stageDir.path);
do_check_eq(stageDir.exists(), aStageDirExists);
let toBeDeletedDirExists = IS_WIN ? aToBeDeletedDirExists : false;
let toBeDeletedDir = getApplyDirFile(DIR_TOBEDELETED, true);
logTestInfo("testing directory should " +
(toBeDeletedDirExists ? "" : "not ") +
"exist: " + toBeDeletedDir.path);
debugDump("testing directory should " +
(toBeDeletedDirExists ? "" : "not ") +
"exist: " + toBeDeletedDir.path);
do_check_eq(toBeDeletedDir.exists(), toBeDeletedDirExists);
logTestInfo("testing updating directory doesn't exist in the application " +
"directory");
debugDump("testing updating directory doesn't exist in the application " +
"directory");
let updatingDir = getApplyDirFile("updating", true);
do_check_false(updatingDir.exists());
if (stageDir.exists()) {
logTestInfo("testing updating directory doesn't exist in the staging " +
"directory");
debugDump("testing updating directory doesn't exist in the staging " +
"directory");
updatingDir = stageDir.clone();
updatingDir.append("updating");
do_check_false(updatingDir.exists());
}
logTestInfo("testing backup files should not be left behind in the " +
"application directory");
debugDump("testing backup files should not be left behind in the " +
"application directory");
let applyToDir = getApplyDirFile(null, true);
checkFilesInDirRecursive(applyToDir, checkForBackupFiles);
if (stageDir.exists()) {
logTestInfo("testing backup files should not be left behind in the " +
"staging directory");
debugDump("testing backup files should not be left behind in the " +
"staging directory");
let applyToDir = getApplyDirFile(null, true);
checkFilesInDirRecursive(stageDir, checkForBackupFiles);
}
logTestInfo("testing patch files should not be left behind");
debugDump("testing patch files should not be left behind");
let updatesDir = getUpdatesPatchDir();
let entries = updatesDir.QueryInterface(Ci.nsIFile).directoryEntries;
while (entries.hasMoreElements()) {
@ -2804,10 +2802,10 @@ function checkCallbackAppLog() {
}
if (logContents == expectedLogContents) {
logTestInfo("callback log file contents are correct");
debugDump("callback log file contents are correct");
do_check_true(true);
} else {
logTestInfo("callback log file contents are not correct");
debugDump("callback log file contents are not correct");
do_check_eq(logContents, expectedLogContents);
}
@ -2834,7 +2832,7 @@ function checkPostUpdateAppLog() {
gTimeoutRuns++;
let postUpdateLog = getPostUpdateFile(".log");
if (!postUpdateLog.exists()) {
logTestInfo("postUpdateLog does not exist. Path: " + postUpdateLog.path);
debugDump("postUpdateLog does not exist. Path: " + postUpdateLog.path);
if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the post update " +
"process to create the post update log. Path: " +
@ -2859,7 +2857,7 @@ function checkPostUpdateAppLog() {
return;
}
logTestInfo("post update app log file contents are correct");
debugDump("post update app log file contents are correct");
do_check_true(true);
gCheckFunc();
@ -2882,13 +2880,13 @@ function checkCallbackServiceLog() {
// value. If the contents are never the expected value then the test will
// fail by timing out.
if (logContents != expectedLogContents) {
logTestInfo("callback service log not expected value, waiting longer");
debugDump("callback service log not expected value, waiting longer");
do_timeout(TEST_HELPER_TIMEOUT, checkCallbackServiceLog);
return;
}
logTestInfo("testing that the callback application successfully launched " +
"and the expected command line arguments were passed to it");
debugDump("testing that the callback application successfully launched " +
"and the expected command line arguments were passed to it");
do_check_eq(logContents, expectedLogContents);
waitForFilesInUse();
@ -2918,10 +2916,10 @@ function waitForFilesInUse() {
file.copyTo(fileBak.parent, fileBak.leafName);
file.remove(false);
fileBak.moveTo(file.parent, file.leafName);
logTestInfo("file is not in use. Path: " + file.path);
debugDump("file is not in use. Path: " + file.path);
} catch (e) {
logTestInfo("file in use, will try again after " + TEST_CHECK_TIMEOUT +
" ms, Path: " + file.path + ", Exception: " + e);
debugDump("file in use, will try again after " + TEST_CHECK_TIMEOUT +
" ms, Path: " + file.path + ", Exception: " + e);
try {
if (fileBak.exists()) {
fileBak.remove(false);
@ -2937,7 +2935,7 @@ function waitForFilesInUse() {
}
}
logTestInfo("calling doTestFinish");
debugDump("calling doTestFinish");
doTestFinish();
}
@ -3134,9 +3132,9 @@ const updateCheckListener = {
gRequestURL = gXHR._url;
gUpdateCount = aUpdateCount;
gUpdates = aUpdates;
logTestInfo("url = " + gRequestURL + ", " +
"request.status = " + aRequest.status + ", " +
"updateCount = " + aUpdateCount);
debugDump("url = " + gRequestURL + ", " +
"request.status = " + aRequest.status + ", " +
"updateCount = " + aUpdateCount);
// Use a timeout to allow the XHR to complete
do_execute_soon(gCheckFunc);
},
@ -3148,9 +3146,9 @@ const updateCheckListener = {
gRequestURL = gXHR._url;
gStatusCode = aRequest.status;
gStatusText = aUpdate.statusText ? aUpdate.statusText : null;
logTestInfo("url = " + gRequestURL + ", " +
"request.status = " + gStatusCode + ", " +
"update.statusText = " + gStatusText);
debugDump("url = " + gRequestURL + ", " +
"request.status = " + gStatusCode + ", " +
"update.statusText = " + gStatusText);
// Use a timeout to allow the XHR to complete
do_execute_soon(gCheckFunc.bind(null, aRequest, aUpdate));
},
@ -3184,7 +3182,7 @@ const downloadListener = {
*/
function start_httpserver() {
let dir = getTestDirFile();
logTestInfo("http server directory path: " + dir.path);
debugDump("http server directory path: " + dir.path);
if (!dir.isDirectory()) {
do_throw("A file instead of a directory was specified for HttpServer " +
@ -3197,7 +3195,7 @@ function start_httpserver() {
gTestserver.start(-1);
let testserverPort = gTestserver.identity.primaryPort;
gURLData = URL_HOST + ":" + testserverPort + "/";
logTestInfo("http server port = " + testserverPort);
debugDump("http server port = " + testserverPort);
}
/**
@ -3300,8 +3298,8 @@ function getProcessArgs(aExtraArgs) {
scriptContents += appBinPath + " -no-remote -process-updates " +
aExtraArgs.join(" ") + " " + PIPE_TO_NULL;
writeFile(launchScript, scriptContents);
logTestInfo("created " + launchScript.path + " containing:\n" +
scriptContents);
debugDump("created " + launchScript.path + " containing:\n" +
scriptContents);
args = [launchScript.path];
} else {
args = ["/D", "/Q", "/C", appBinPath, "-no-remote", "-process-updates"].
@ -3381,54 +3379,54 @@ function adjustGeneralPaths() {
ds.QueryInterface(Ci.nsIProperties).undefine(XRE_EXECUTABLE_FILE);
ds.registerProvider(dirProvider);
do_register_cleanup(function AGP_cleanup() {
logTestInfo("start - unregistering directory provider");
debugDump("start - unregistering directory provider");
if (gAppTimer) {
logTestInfo("start - cancel app timer");
debugDump("start - cancel app timer");
gAppTimer.cancel();
gAppTimer = null;
logTestInfo("finish - cancel app timer");
debugDump("finish - cancel app timer");
}
if (gProcess && gProcess.isRunning) {
logTestInfo("start - kill process");
debugDump("start - kill process");
try {
gProcess.kill();
} catch (e) {
logTestInfo("kill process failed. Exception: " + e);
debugDump("kill process failed. Exception: " + e);
}
gProcess = null;
logTestInfo("finish - kill process");
debugDump("finish - kill process");
}
if (gHandle) {
try {
logTestInfo("start - closing handle");
debugDump("start - closing handle");
let kernel32 = ctypes.open("kernel32");
let CloseHandle = kernel32.declare("CloseHandle", ctypes.default_abi,
ctypes.bool, /*return*/
ctypes.voidptr_t /*handle*/);
if (!CloseHandle(gHandle)) {
logTestInfo("call to CloseHandle failed");
debugDump("call to CloseHandle failed");
}
kernel32.close();
gHandle = null;
logTestInfo("finish - closing handle");
debugDump("finish - closing handle");
} catch (e) {
logTestInfo("call to CloseHandle failed. Exception: " + e);
debugDump("call to CloseHandle failed. Exception: " + e);
}
}
// Call end_test first before the directory provider is unregistered
if (typeof(end_test) == typeof(Function)) {
logTestInfo("calling end_test");
debugDump("calling end_test");
end_test();
}
ds.unregisterProvider(dirProvider);
cleanupTestCommon();
logTestInfo("finish - unregistering directory provider");
debugDump("finish - unregistering directory provider");
});
}
@ -3437,7 +3435,7 @@ function adjustGeneralPaths() {
* Helper function for launching the application to apply an update.
*/
function launchAppToApplyUpdate() {
logTestInfo("start - launching application to apply update");
debugDump("start - launching application to apply update");
let appBin = getApplyDirFile(DIR_MACOS + FILE_APP_BIN, false);
@ -3447,7 +3445,7 @@ function launchAppToApplyUpdate() {
let launchBin = getLaunchBin();
let args = getProcessArgs();
logTestInfo("launching " + launchBin.path + " " + args.join(" "));
debugDump("launching " + launchBin.path + " " + args.join(" "));
gProcess = Cc["@mozilla.org/process/util;1"].
createInstance(Ci.nsIProcess);
@ -3458,11 +3456,11 @@ function launchAppToApplyUpdate() {
Ci.nsITimer.TYPE_ONE_SHOT);
setEnvironment();
logTestInfo("launching application");
debugDump("launching application");
gProcess.runAsync(args, args.length, gProcessObserver);
resetEnvironment();
logTestInfo("finish - launching application to apply update");
debugDump("finish - launching application to apply update");
}
/**
@ -3470,8 +3468,8 @@ function launchAppToApplyUpdate() {
*/
const gProcessObserver = {
observe: function PO_observe(aSubject, aTopic, aData) {
logTestInfo("topic: " + aTopic + ", process exitValue: " +
gProcess.exitValue);
debugDump("topic: " + aTopic + ", process exitValue: " +
gProcess.exitValue);
if (gAppTimer) {
gAppTimer.cancel();
gAppTimer = null;
@ -3528,8 +3526,8 @@ function setEnvironment() {
getService(Ci.nsIEnvironment);
if (IS_WIN && !env.exists("XRE_NO_WINDOWS_CRASH_DIALOG")) {
gAddedEnvXRENoWindowsCrashDialog = true;
logTestInfo("setting the XRE_NO_WINDOWS_CRASH_DIALOG environment " +
"variable to 1... previously it didn't exist");
debugDump("setting the XRE_NO_WINDOWS_CRASH_DIALOG environment " +
"variable to 1... previously it didn't exist");
env.set("XRE_NO_WINDOWS_CRASH_DIALOG", "1");
}
@ -3549,8 +3547,8 @@ function setEnvironment() {
}
if (shouldSetEnv) {
logTestInfo("setting DYLD_LIBRARY_PATH environment variable value to " +
appGreBinDir.path);
debugDump("setting DYLD_LIBRARY_PATH environment variable value to " +
appGreBinDir.path);
env.set("DYLD_LIBRARY_PATH", appGreBinDir.path);
}
} else {
@ -3564,8 +3562,8 @@ function setEnvironment() {
}
if (shouldSetEnv) {
logTestInfo("setting LD_LIBRARY_PATH environment variable value to " +
appGreBinDir.path);
debugDump("setting LD_LIBRARY_PATH environment variable value to " +
appGreBinDir.path);
env.set("LD_LIBRARY_PATH", appGreBinDir.path);
}
}
@ -3573,28 +3571,28 @@ function setEnvironment() {
if (env.exists("XPCOM_MEM_LEAK_LOG")) {
gEnvXPCOMMemLeakLog = env.get("XPCOM_MEM_LEAK_LOG");
logTestInfo("removing the XPCOM_MEM_LEAK_LOG environment variable... " +
"previous value " + gEnvXPCOMMemLeakLog);
debugDump("removing the XPCOM_MEM_LEAK_LOG environment variable... " +
"previous value " + gEnvXPCOMMemLeakLog);
env.set("XPCOM_MEM_LEAK_LOG", "");
}
if (env.exists("XPCOM_DEBUG_BREAK")) {
gEnvXPCOMDebugBreak = env.get("XPCOM_DEBUG_BREAK");
logTestInfo("setting the XPCOM_DEBUG_BREAK environment variable to " +
"warn... previous value " + gEnvXPCOMDebugBreak);
debugDump("setting the XPCOM_DEBUG_BREAK environment variable to " +
"warn... previous value " + gEnvXPCOMDebugBreak);
} else {
logTestInfo("setting the XPCOM_DEBUG_BREAK environment variable to " +
"warn... previously it didn't exist");
debugDump("setting the XPCOM_DEBUG_BREAK environment variable to " +
"warn... previously it didn't exist");
}
env.set("XPCOM_DEBUG_BREAK", "warn");
if (gStageUpdate) {
logTestInfo("setting the MOZ_UPDATE_STAGING environment variable to 1");
debugDump("setting the MOZ_UPDATE_STAGING environment variable to 1");
env.set("MOZ_UPDATE_STAGING", "1");
}
logTestInfo("setting MOZ_NO_SERVICE_FALLBACK environment variable to 1");
debugDump("setting MOZ_NO_SERVICE_FALLBACK environment variable to 1");
env.set("MOZ_NO_SERVICE_FALLBACK", "1");
}
@ -3614,53 +3612,53 @@ function resetEnvironment() {
getService(Ci.nsIEnvironment);
if (gEnvXPCOMMemLeakLog) {
logTestInfo("setting the XPCOM_MEM_LEAK_LOG environment variable back to " +
gEnvXPCOMMemLeakLog);
debugDump("setting the XPCOM_MEM_LEAK_LOG environment variable back to " +
gEnvXPCOMMemLeakLog);
env.set("XPCOM_MEM_LEAK_LOG", gEnvXPCOMMemLeakLog);
}
if (gEnvXPCOMDebugBreak) {
logTestInfo("setting the XPCOM_DEBUG_BREAK environment variable back to " +
gEnvXPCOMDebugBreak);
debugDump("setting the XPCOM_DEBUG_BREAK environment variable back to " +
gEnvXPCOMDebugBreak);
env.set("XPCOM_DEBUG_BREAK", gEnvXPCOMDebugBreak);
} else {
logTestInfo("clearing the XPCOM_DEBUG_BREAK environment variable");
debugDump("clearing the XPCOM_DEBUG_BREAK environment variable");
env.set("XPCOM_DEBUG_BREAK", "");
}
if (IS_UNIX) {
if (IS_MACOSX) {
if (gEnvDyldLibraryPath) {
logTestInfo("setting DYLD_LIBRARY_PATH environment variable value " +
"back to " + gEnvDyldLibraryPath);
debugDump("setting DYLD_LIBRARY_PATH environment variable value " +
"back to " + gEnvDyldLibraryPath);
env.set("DYLD_LIBRARY_PATH", gEnvDyldLibraryPath);
} else {
logTestInfo("removing DYLD_LIBRARY_PATH environment variable");
debugDump("removing DYLD_LIBRARY_PATH environment variable");
env.set("DYLD_LIBRARY_PATH", "");
}
} else {
if (gEnvLdLibraryPath) {
logTestInfo("setting LD_LIBRARY_PATH environment variable value back " +
"to " + gEnvLdLibraryPath);
debugDump("setting LD_LIBRARY_PATH environment variable value back " +
"to " + gEnvLdLibraryPath);
env.set("LD_LIBRARY_PATH", gEnvLdLibraryPath);
} else {
logTestInfo("removing LD_LIBRARY_PATH environment variable");
debugDump("removing LD_LIBRARY_PATH environment variable");
env.set("LD_LIBRARY_PATH", "");
}
}
}
if (IS_WIN && gAddedEnvXRENoWindowsCrashDialog) {
logTestInfo("removing the XRE_NO_WINDOWS_CRASH_DIALOG environment " +
"variable");
debugDump("removing the XRE_NO_WINDOWS_CRASH_DIALOG environment " +
"variable");
env.set("XRE_NO_WINDOWS_CRASH_DIALOG", "");
}
if (gStageUpdate) {
logTestInfo("removing the MOZ_UPDATE_STAGING environment variable");
debugDump("removing the MOZ_UPDATE_STAGING environment variable");
env.set("MOZ_UPDATE_STAGING", "");
}
logTestInfo("removing MOZ_NO_SERVICE_FALLBACK environment variable");
debugDump("removing MOZ_NO_SERVICE_FALLBACK environment variable");
env.set("MOZ_NO_SERVICE_FALLBACK", "");
}

View File

@ -7,7 +7,7 @@ function run_test() {
setupTestCommon();
// Verify write access to the custom app dir
logTestInfo("testing write access to the application directory");
debugDump("testing write access to the application directory");
let testFile = getCurrentProcessDir();
testFile.append("update_write_access_test");
testFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
@ -19,42 +19,42 @@ function run_test() {
if (IS_WIN) {
// Create a mutex to prevent being able to check for or apply updates.
logTestInfo("attempting to create mutex");
debugDump("attempting to create mutex");
let handle = createMutex(getPerInstallationMutexName());
logTestInfo("testing that the mutex was successfully created");
debugDump("testing that the mutex was successfully created");
do_check_neq(handle, null);
// Check if available updates cannot be checked for when there is a mutex
// for this installation.
logTestInfo("testing nsIApplicationUpdateService:canCheckForUpdates is " +
"false when there is a mutex");
debugDump("testing nsIApplicationUpdateService:canCheckForUpdates is " +
"false when there is a mutex");
do_check_false(gAUS.canCheckForUpdates);
// Check if updates cannot be applied when there is a mutex for this
// installation.
logTestInfo("testing nsIApplicationUpdateService:canApplyUpdates is " +
debugDump("testing nsIApplicationUpdateService:canApplyUpdates is " +
"false when there is a mutex");
do_check_false(gAUS.canApplyUpdates);
logTestInfo("destroying mutex");
debugDump("destroying mutex");
closeHandle(handle)
}
// Check if available updates can be checked for
logTestInfo("testing nsIApplicationUpdateService:canCheckForUpdates is true");
debugDump("testing nsIApplicationUpdateService:canCheckForUpdates is true");
do_check_true(gAUS.canCheckForUpdates);
// Check if updates can be applied
logTestInfo("testing nsIApplicationUpdateService:canApplyUpdates is true");
debugDump("testing nsIApplicationUpdateService:canApplyUpdates is true");
do_check_true(gAUS.canApplyUpdates);
if (IS_WIN) {
// Attempt to create a mutex when application update has already created one
// with the same name.
logTestInfo("attempting to create mutex");
debugDump("attempting to create mutex");
let handle = createMutex(getPerInstallationMutexName());
logTestInfo("testing that the mutex was not successfully created");
debugDump("testing that the mutex was not successfully created");
do_check_eq(handle, null);
}

View File

@ -8,8 +8,8 @@
function run_test() {
setupTestCommon();
logTestInfo("testing removal of an active update for a channel that is not" +
"valid due to switching channels (Bug 486275).");
debugDump("testing removal of an active update for a channel that is not" +
"valid due to switching channels (Bug 486275).");
let patches = getLocalPatchString(null, null, null, null, null, null,
STATE_DOWNLOADING);
@ -36,7 +36,7 @@ function run_test() {
// Verify that the active-update.xml file has had the update from the old
// channel removed.
let file = getUpdatesXMLFile(true);
logTestInfo("verifying contents of " + FILE_UPDATE_ACTIVE);
debugDump("verifying contents of " + FILE_UPDATE_ACTIVE);
do_check_eq(readFile(file), getLocalUpdatesXMLString(""));
doTestFinish();

View File

@ -7,8 +7,8 @@
function run_test() {
setupTestCommon();
logTestInfo("testing cleanup of an update download in progress for an " +
"older version of the application on startup (Bug 485624)");
debugDump("testing cleanup of an update download in progress for an " +
"older version of the application on startup (Bug 485624)");
let patches = getLocalPatchString(null, null, null, null, null, null,
STATE_DOWNLOADING);

View File

@ -6,9 +6,9 @@
function run_test() {
setupTestCommon();
logTestInfo("testing removal of an update download in progress for the " +
"same version of the application with the same application " +
"build id on startup (Bug 536547)");
debugDump("testing removal of an update download in progress for the " +
"same version of the application with the same application " +
"build id on startup (Bug 536547)");
let patches = getLocalPatchString(null, null, null, null, null, null,
STATE_DOWNLOADING);

View File

@ -5,9 +5,9 @@
function run_test() {
setupTestCommon();
logTestInfo("testing update cleanup when reading the status file returns " +
"STATUS_NONE and the update xml has an update with " +
"STATE_DOWNLOADING (Bug 539717).");
debugDump("testing update cleanup when reading the status file returns " +
"STATUS_NONE and the update xml has an update with " +
"STATE_DOWNLOADING (Bug 539717).");
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
let patches = getLocalPatchString(null, null, null, null, null, null,
@ -20,17 +20,17 @@ function run_test() {
let dir = getUpdatesDir();
dir.append("0");
logTestInfo("testing " + dir.path + " should exist");
debugDump("testing " + dir.path + " should exist");
do_check_true(dir.exists());
let statusFile = dir.clone();
statusFile.append(FILE_UPDATE_STATUS);
logTestInfo("testing " + statusFile.path + " should not exist");
debugDump("testing " + statusFile.path + " should not exist");
do_check_false(statusFile.exists());
logTestInfo("testing activeUpdate == null");
debugDump("testing activeUpdate == null");
do_check_eq(gUpdateManager.activeUpdate, null);
logTestInfo("testing updateCount == 0");
debugDump("testing updateCount == 0");
do_check_eq(gUpdateManager.updateCount, 0);
doTestFinish();

View File

@ -5,9 +5,9 @@
function run_test() {
setupTestCommon();
logTestInfo("testing update cleanup when reading the status file returns " +
"STATUS_NONE, the version file is for a newer version, and the " +
"update xml has an update with STATE_PENDING (Bug 601701).");
debugDump("testing update cleanup when reading the status file returns " +
"STATUS_NONE, the version file is for a newer version, and the " +
"update xml has an update with STATE_PENDING (Bug 601701).");
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
let patches = getLocalPatchString(null, null, null, null, null, null,
@ -20,19 +20,19 @@ function run_test() {
// Check that there is no activeUpdate first so the updates directory is
// cleaned up by the UpdateManager before the remaining tests.
logTestInfo("testing activeUpdate == null");
debugDump("testing activeUpdate == null");
do_check_eq(gUpdateManager.activeUpdate, null);
logTestInfo("testing updateCount == 0");
debugDump("testing updateCount == 0");
do_check_eq(gUpdateManager.updateCount, 0);
let dir = getUpdatesDir();
dir.append("0");
logTestInfo("testing " + dir.path + " should exist");
debugDump("testing " + dir.path + " should exist");
do_check_true(dir.exists());
let versionFile = dir.clone();
versionFile.append(FILE_UPDATE_VERSION);
logTestInfo("testing " + versionFile.path + " should not exist");
debugDump("testing " + versionFile.path + " should not exist");
do_check_false(versionFile.exists());
doTestFinish();

View File

@ -6,7 +6,7 @@
function run_test() {
setupTestCommon();
logTestInfo("testing that the update.log is moved after a successful update");
debugDump("testing that the update.log is moved after a successful update");
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
let patches = getLocalPatchString(null, null, null, null, null, null,
@ -23,24 +23,24 @@ function run_test() {
standardInit();
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = dir.clone();
log.append(FILE_LAST_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
logTestInfo("testing " + log.path + " contents");
debugDump("testing " + log.path + " contents");
do_check_eq(readFile(log), "Last Update Log");
log = dir.clone();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
dir.append("0");
logTestInfo("testing " + dir.path + " should exist (bug 512994)");
debugDump("testing " + dir.path + " should exist (bug 512994)");
do_check_true(dir.exists());
doTestFinish();

View File

@ -6,7 +6,7 @@
function run_test() {
setupTestCommon();
logTestInfo("testing update logs are first in first out deleted");
debugDump("testing update logs are first in first out deleted");
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
let patches = getLocalPatchString(null, null, null, null, null, null,
@ -31,27 +31,27 @@ function run_test() {
standardInit();
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = dir.clone();
log.append(FILE_LAST_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
logTestInfo("testing " + log.path + " contents");
debugDump("testing " + log.path + " contents");
do_check_eq(readFile(log), "Last Update Log");
log = dir.clone();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
logTestInfo("testing " + log.path + " contents (bug 470979)");
debugDump("testing " + log.path + " contents (bug 470979)");
do_check_eq(readFile(log), "Backup Update Log");
dir.append("0");
logTestInfo("testing " + dir.path + " should exist (bug 512994)");
debugDump("testing " + dir.path + " should exist (bug 512994)");
do_check_true(dir.exists());
doTestFinish();

View File

@ -9,7 +9,7 @@ var gExpectedStatusResult;
function run_test() {
setupTestCommon();
logTestInfo("testing mar download and mar hash verification");
debugDump("testing mar download and mar hash verification");
Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
// The HTTP server is only used for the mar file downloads since it is slow
@ -50,7 +50,7 @@ function run_test_helper_pt1(aMsg, aExpectedStatusResult, aNextRunFunc) {
gCheckFunc = check_test_helper_pt1_1;
gNextRunFunc = aNextRunFunc;
gExpectedStatusResult = aExpectedStatusResult;
logTestInfo(aMsg, Components.stack.caller);
debugDump(aMsg, Components.stack.caller);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -81,7 +81,7 @@ function run_test_helper_bug828858_pt1(aMsg, aExpectedStatusResult, aNextRunFunc
gCheckFunc = check_test_helper_bug828858_pt1_1;
gNextRunFunc = aNextRunFunc;
gExpectedStatusResult = aExpectedStatusResult;
logTestInfo(aMsg, Components.stack.caller);
debugDump(aMsg, Components.stack.caller);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}

View File

@ -5,11 +5,11 @@
function run_test() {
setupTestCommon();
logTestInfo("testing download a complete on partial failure. Calling " +
"nsIUpdatePrompt::showUpdateError should call getNewPrompter " +
"and alert on the object returned by getNewPrompter when the " +
"update.state == " + STATE_FAILED + " and the update.errorCode " +
"== " + WRITE_ERROR + " (Bug 595059).");
debugDump("testing download a complete on partial failure. Calling " +
"nsIUpdatePrompt::showUpdateError should call getNewPrompter " +
"and alert on the object returned by getNewPrompter when the " +
"update.state == " + STATE_FAILED + " and the update.errorCode " +
"== " + WRITE_ERROR + " (Bug 595059).");
Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);

View File

@ -17,8 +17,8 @@ function run_test() {
overrideXHR(xhr_pt1);
standardInit();
logTestInfo("testing that error codes set from a directory provider propagate" +
"up to AUS.downloadUpdate() correctly (Bug 794211).");
debugDump("testing that error codes set from a directory provider propagate" +
"up to AUS.downloadUpdate() correctly (Bug 794211).");
gDirProvider = new FakeDirProvider();

View File

@ -9,9 +9,9 @@ const NETWORK_ERROR_OFFLINE = 111;
function run_test() {
setupTestCommon();
logTestInfo("testing when an update check fails because the network is " +
"offline that we check again when the network comes online " +
"(Bug 794211).");
debugDump("testing when an update check fails because the network is " +
"offline that we check again when the network comes online " +
"(Bug 794211).");
setUpdateURLOverride();
Services.prefs.setBoolPref(PREF_APP_UPDATE_AUTO, false);

View File

@ -18,8 +18,8 @@ var gExpectedStatusResult;
function run_test() {
setupTestCommon();
logTestInfo("testing mar downloads, mar hash verification, and " +
"mar download interrupted recovery");
debugDump("testing mar downloads, mar hash verification, and " +
"mar download interrupted recovery");
Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
// The HTTP server is only used for the mar file downloads since it is slow
@ -64,7 +64,7 @@ function run_test_helper_pt1(aMsg, aExpectedStatusResult, aNextRunFunc) {
gCheckFunc = check_test_helper_pt1_1;
gNextRunFunc = aNextRunFunc;
gExpectedStatusResult = aExpectedStatusResult;
logTestInfo(aMsg, Components.stack.caller);
debugDump(aMsg, Components.stack.caller);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}

View File

@ -6,8 +6,8 @@
function run_test() {
setupTestCommon();
logTestInfo("testing resuming an update download in progress for the same " +
"version of the application on startup (Bug 485624)");
debugDump("testing resuming an update download in progress for the same " +
"version of the application on startup (Bug 485624)");
let patches = getLocalPatchString(null, null, null, null, null, null,
STATE_DOWNLOADING);

View File

@ -9,7 +9,7 @@ var gExpectedCount;
function run_test() {
setupTestCommon();
logTestInfo("testing remote update xml attributes");
debugDump("testing remote update xml attributes");
setUpdateURLOverride();
setUpdateChannel("test_channel");
@ -26,7 +26,7 @@ function run_test_helper_pt1(aMsg, aExpectedCount, aNextRunFunc) {
gCheckFunc = check_test_helper_pt1;
gNextRunFunc = aNextRunFunc;
gExpectedCount = aExpectedCount;
logTestInfo(aMsg, Components.stack.caller);
debugDump(aMsg, Components.stack.caller);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -59,7 +59,7 @@ function run_test_pt01() {
// one update available and the update's property values
function run_test_pt02() {
logTestInfo("testing one update available and the update's property values");
debugDump("testing one update available and the update's property values");
gUpdates = null;
gUpdateCount = null;
gCheckFunc = check_test_pt02;
@ -159,8 +159,8 @@ function check_test_pt02() {
// one update available and the update's property default values
function run_test_pt03() {
logTestInfo("testing one update available and the update's property values " +
"with the format prior to bug 530872");
debugDump("testing one update available and the update's property values " +
"with the format prior to bug 530872");
gUpdates = null;
gUpdateCount = null;
gCheckFunc = check_test_pt03;

View File

@ -10,8 +10,8 @@
function run_test() {
setupTestCommon();
logTestInfo("testing nsIUpdatePrompt notifications should not be seen when " +
"there is already an application update window open");
debugDump("testing nsIUpdatePrompt notifications should not be seen when " +
"there is already an application update window open");
Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
@ -27,7 +27,7 @@ function run_test() {
standardInit();
logTestInfo("testing showUpdateInstalled should not call openWindow");
debugDump("testing showUpdateInstalled should not call openWindow");
Services.prefs.setBoolPref(PREF_APP_UPDATE_SHOW_INSTALLED_UI, true);
gCheckFunc = check_showUpdateInstalled;
@ -36,7 +36,7 @@ function run_test() {
// didn't throw and otherwise it would report no tests run.
do_check_true(true);
logTestInfo("testing showUpdateAvailable should not call openWindow");
debugDump("testing showUpdateAvailable should not call openWindow");
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
let patches = getLocalPatchString(null, null, null, null, null, null,
STATE_FAILED);

View File

@ -11,8 +11,8 @@
function run_test() {
setupTestCommon();
logTestInfo("testing nsIUpdatePrompt notifications should not be seen " +
"when the " + PREF_APP_UPDATE_SILENT + " preference is true");
debugDump("testing nsIUpdatePrompt notifications should not be seen " +
"when the " + PREF_APP_UPDATE_SILENT + " preference is true");
Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, true);
@ -24,7 +24,7 @@ function run_test() {
standardInit();
logTestInfo("testing showUpdateInstalled should not call openWindow");
debugDump("testing showUpdateInstalled should not call openWindow");
Services.prefs.setBoolPref(PREF_APP_UPDATE_SHOW_INSTALLED_UI, true);
gCheckFunc = check_showUpdateInstalled;
@ -33,7 +33,7 @@ function run_test() {
// didn't throw and otherwise it would report no tests run.
do_check_true(true);
logTestInfo("testing showUpdateAvailable should not call openWindow");
debugDump("testing showUpdateAvailable should not call openWindow");
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
let patches = getLocalPatchString(null, null, null, null, null, null,
STATE_FAILED);
@ -49,7 +49,7 @@ function run_test() {
// didn't throw and otherwise it would report no tests run.
do_check_true(true);
logTestInfo("testing showUpdateError should not call getNewPrompter");
debugDump("testing showUpdateError should not call getNewPrompter");
gCheckFunc = check_showUpdateError;
update.errorCode = WRITE_ERROR;
gUP.showUpdateError(update);

View File

@ -5,10 +5,10 @@
function run_test() {
setupTestCommon();
logTestInfo("testing nsIUpdatePrompt notifications should not be displayed " +
"when showUpdateAvailable is called for an unsupported system " +
"update when the unsupported notification has already been " +
"shown (bug 843497)");
debugDump("testing nsIUpdatePrompt notifications should not be displayed " +
"when showUpdateAvailable is called for an unsupported system " +
"update when the unsupported notification has already been " +
"shown (bug 843497)");
setUpdateURLOverride();
// The mock XMLHttpRequest is MUCH faster

View File

@ -15,8 +15,8 @@ var gExpectedStatusText;
function run_test() {
setupTestCommon();
logTestInfo("testing nsIUpdateCheckListener onload and onerror error code " +
"and statusText values");
debugDump("testing nsIUpdateCheckListener onload and onerror error code " +
"and statusText values");
setUpdateURLOverride();
standardInit();
@ -40,7 +40,7 @@ function run_test_helper(aNextRunFunc, aExpectedStatusCode, aMsg) {
gCheckFunc = check_test_helper;
gNextRunFunc = aNextRunFunc;
gExpectedStatusCode = aExpectedStatusCode;
logTestInfo(aMsg, Components.stack.caller);
debugDump(aMsg, Components.stack.caller);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -61,7 +61,7 @@ function run_test_pt1() {
gStatusText = null;
gCheckFunc = check_test_pt1;
gExpectedStatusCode = 399;
logTestInfo("testing default onerror error message");
debugDump("testing default onerror error message");
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}

View File

@ -6,9 +6,9 @@
function run_test() {
setupTestCommon();
logTestInfo("testing addition of a successful update to " + FILE_UPDATES_DB +
" and verification of update properties including the format " +
"prior to bug 530872");
debugDump("testing addition of a successful update to " + FILE_UPDATES_DB +
" and verification of update properties including the format " +
"prior to bug 530872");
setUpdateChannel("test_channel");

View File

@ -45,7 +45,7 @@ function getResult(url) {
function run_test_pt1() {
gCheckFunc = check_test_pt1;
let url = URL_PREFIX + "%PRODUCT%/";
logTestInfo("testing url constructed with %PRODUCT% - " + url);
debugDump("testing url constructed with %PRODUCT% - " + url);
setUpdateURLOverride(url);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -59,7 +59,7 @@ function check_test_pt1() {
function run_test_pt2() {
gCheckFunc = check_test_pt2;
let url = URL_PREFIX + "%VERSION%/";
logTestInfo("testing url constructed with %VERSION% - " + url);
debugDump("testing url constructed with %VERSION% - " + url);
setUpdateURLOverride(url);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -73,7 +73,7 @@ function check_test_pt2() {
function run_test_pt3() {
gCheckFunc = check_test_pt3;
let url = URL_PREFIX + "%BUILD_ID%/";
logTestInfo("testing url constructed with %BUILD_ID% - " + url);
debugDump("testing url constructed with %BUILD_ID% - " + url);
setUpdateURLOverride(url);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -88,7 +88,7 @@ function check_test_pt3() {
function run_test_pt4() {
gCheckFunc = check_test_pt4;
let url = URL_PREFIX + "%BUILD_TARGET%/";
logTestInfo("testing url constructed with %BUILD_TARGET% - " + url);
debugDump("testing url constructed with %BUILD_TARGET% - " + url);
setUpdateURLOverride(url);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -127,13 +127,13 @@ function check_test_pt4() {
function run_test_pt5() {
gCheckFunc = check_test_pt5;
let url = URL_PREFIX + "%LOCALE%/";
logTestInfo("testing url constructed with %LOCALE% - " + url);
debugDump("testing url constructed with %LOCALE% - " + url);
setUpdateURLOverride(url);
try {
gUpdateChecker.checkForUpdates(updateCheckListener, true);
} catch (e) {
logTestInfo("The following error is most likely due to a missing " +
"update.locale file");
debugDump("The following error is most likely due to a missing " +
"update.locale file");
do_throw(e);
}
}
@ -147,7 +147,7 @@ function check_test_pt5() {
function run_test_pt6() {
gCheckFunc = check_test_pt6;
let url = URL_PREFIX + "%CHANNEL%/";
logTestInfo("testing url constructed with %CHANNEL% - " + url);
debugDump("testing url constructed with %CHANNEL% - " + url);
setUpdateURLOverride(url);
setUpdateChannel("test_channel");
gUpdateChecker.checkForUpdates(updateCheckListener, true);
@ -162,7 +162,7 @@ function check_test_pt6() {
function run_test_pt7() {
gCheckFunc = check_test_pt7;
let url = URL_PREFIX + "%CHANNEL%/";
logTestInfo("testing url constructed with %CHANNEL% - " + url);
debugDump("testing url constructed with %CHANNEL% - " + url);
setUpdateURLOverride(url);
gDefaultPrefBranch.setCharPref(PREF_APP_PARTNER_BRANCH + "test_partner1", "test_partner1");
gDefaultPrefBranch.setCharPref(PREF_APP_PARTNER_BRANCH + "test_partner2", "test_partner2");
@ -178,7 +178,7 @@ function check_test_pt7() {
function run_test_pt8() {
gCheckFunc = check_test_pt8;
let url = URL_PREFIX + "%PLATFORM_VERSION%/";
logTestInfo("testing url constructed with %PLATFORM_VERSION% - " + url);
debugDump("testing url constructed with %PLATFORM_VERSION% - " + url);
setUpdateURLOverride(url);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -192,7 +192,7 @@ function check_test_pt8() {
function run_test_pt9() {
gCheckFunc = check_test_pt9;
let url = URL_PREFIX + "%OS_VERSION%/";
logTestInfo("testing url constructed with %OS_VERSION% - " + url);
debugDump("testing url constructed with %OS_VERSION% - " + url);
setUpdateURLOverride(url);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -340,7 +340,7 @@ function check_test_pt9() {
function run_test_pt10() {
gCheckFunc = check_test_pt10;
let url = URL_PREFIX + "%DISTRIBUTION%/";
logTestInfo("testing url constructed with %DISTRIBUTION% - " + url);
debugDump("testing url constructed with %DISTRIBUTION% - " + url);
setUpdateURLOverride(url);
gDefaultPrefBranch.setCharPref(PREF_DISTRIBUTION_ID, "test_distro");
gUpdateChecker.checkForUpdates(updateCheckListener, true);
@ -355,7 +355,7 @@ function check_test_pt10() {
function run_test_pt11() {
gCheckFunc = check_test_pt11;
let url = URL_PREFIX + "%DISTRIBUTION_VERSION%/";
logTestInfo("testing url constructed with %DISTRIBUTION_VERSION% - " + url);
debugDump("testing url constructed with %DISTRIBUTION_VERSION% - " + url);
setUpdateURLOverride(url);
gDefaultPrefBranch.setCharPref(PREF_DISTRIBUTION_VERSION, "test_distro_version");
gUpdateChecker.checkForUpdates(updateCheckListener, true);
@ -370,8 +370,8 @@ function check_test_pt11() {
function run_test_pt12() {
gCheckFunc = check_test_pt12;
let url = URL_PREFIX;
logTestInfo("testing url with force param that doesn't already have a " +
"param - " + url);
debugDump("testing url with force param that doesn't already have a " +
"param - " + url);
setUpdateURLOverride(url);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -385,8 +385,7 @@ function check_test_pt12() {
function run_test_pt13() {
gCheckFunc = check_test_pt13;
let url = URL_PREFIX + "?extra=param";
logTestInfo("testing url with force param that already has a param - " + url);
logTestInfo("testing url constructed that has a parameter - " + url);
debugDump("testing url with force param that already has a param - " + url);
setUpdateURLOverride(url);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}
@ -400,7 +399,7 @@ function run_test_pt14() {
Services.prefs.setCharPref("app.update.custom", "custom");
gCheckFunc = check_test_pt14;
let url = URL_PREFIX + "?custom=%CUSTOM%";
logTestInfo("testing url constructed with %CUSTOM% - " + url);
debugDump("testing url constructed with %CUSTOM% - " + url);
setUpdateURLOverride(url);
gUpdateChecker.checkForUpdates(updateCheckListener, true);
}

View File

@ -57,7 +57,7 @@ function setupAppFilesFinished() {
}
function customLaunchAppToApplyUpdate() {
logTestInfo("start - locking installation directory");
debugDump("start - locking installation directory");
const LPCWSTR = ctypes.char16_t.ptr;
const DWORD = ctypes.uint32_t;
const LPVOID = ctypes.voidptr_t;
@ -76,7 +76,7 @@ function customLaunchAppToApplyUpdate() {
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, LPVOID(0));
do_check_neq(gHandle.toString(), INVALID_HANDLE_VALUE.toString());
kernel32.close();
logTestInfo("finish - locking installation directory");
debugDump("finish - locking installation directory");
}
/**
@ -139,43 +139,43 @@ function checkUpdateApplied() {
log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
} else {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
}
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
let updatesDir = getStageDirFile(DIR_UPDATES + "/0", true);
logTestInfo("testing " + updatesDir.path + " shouldn't exist");
debugDump("testing " + updatesDir.path + " shouldn't exist");
do_check_false(updatesDir.exists());
log = getStageDirFile(DIR_UPDATES + "/0/" + FILE_UPDATE_LOG, true);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getStageDirFile(DIR_UPDATES + "/" + FILE_LAST_LOG, true);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
} else {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
}
log = getStageDirFile(DIR_UPDATES + "/" + FILE_BACKUP_LOG, true);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
// Switch the application to the staged application that was updated by
@ -249,8 +249,8 @@ function finishCheckUpdateFinished() {
}
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -267,22 +267,22 @@ function finishCheckUpdateFinished() {
do_check_eq(update.state, STATE_SUCCEEDED);
let updatesDir = getUpdatesPatchDir();
logTestInfo("testing " + updatesDir.path + " should exist");
debugDump("testing " + updatesDir.path + " should exist");
do_check_true(updatesDir.exists());
let log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
waitForFilesInUse();

View File

@ -114,43 +114,43 @@ function checkUpdateApplied() {
log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
} else {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
}
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
let updatesDir = getStageDirFile(DIR_UPDATES + "/0", true);
logTestInfo("testing " + updatesDir.path + " shouldn't exist");
debugDump("testing " + updatesDir.path + " shouldn't exist");
do_check_false(updatesDir.exists());
log = getStageDirFile(DIR_UPDATES + "/0/" + FILE_UPDATE_LOG, true);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getStageDirFile(DIR_UPDATES + "/" + FILE_LAST_LOG, true);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
} else {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
}
log = getStageDirFile(DIR_UPDATES + "/" + FILE_BACKUP_LOG, true);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
// Switch the application to the staged application that was updated by
@ -223,8 +223,8 @@ function finishCheckUpdateApplied() {
}
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -243,26 +243,26 @@ function finishCheckUpdateApplied() {
do_check_eq(update.state, STATE_SUCCEEDED);
let updatesDir = getUpdatesPatchDir();
logTestInfo("testing " + updatesDir.path + " should exist");
debugDump("testing " + updatesDir.path + " should exist");
do_check_true(updatesDir.exists());
let log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
} else {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
}

View File

@ -112,8 +112,8 @@ function finishCheckUpdateFinished() {
}
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -130,22 +130,22 @@ function finishCheckUpdateFinished() {
do_check_eq(update.state, STATE_SUCCEEDED);
let updatesPatchDir = getUpdatesPatchDir();
logTestInfo("testing " + updatesPatchDir.path + " should exist");
debugDump("testing " + updatesPatchDir.path + " should exist");
do_check_true(updatesPatchDir.exists());
log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
waitForFilesInUse();

View File

@ -96,8 +96,8 @@ function checkUpdateApplied() {
*/
function finishCheckUpdateApplied() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -121,7 +121,7 @@ function runHelperProcess(args) {
let process = Cc["@mozilla.org/process/util;1"].
createInstance(Ci.nsIProcess);
process.init(helperBin);
logTestInfo("Running " + helperBin.path + " " + args.join(" "));
debugDump("Running " + helperBin.path + " " + args.join(" "));
process.run(true, args, args.length);
do_check_eq(process.exitValue, 0);
}

View File

@ -43,8 +43,8 @@ function checkUpdateApplied() {
function checkUpdate() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);

View File

@ -40,8 +40,8 @@ function checkUpdateApplied() {
}
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);

View File

@ -5,6 +5,9 @@
/* File in use complete MAR file patch apply success test */
function run_test() {
// Set to true due to bug 1123503
DEBUG_AUS_TEST = true;
setupTestCommon();
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;

View File

@ -94,8 +94,8 @@ function checkUpdateApplied() {
*/
function finishCheckUpdateApplied() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -103,11 +103,11 @@ function finishCheckUpdateApplied() {
}
if (IS_MACOSX) {
logTestInfo("testing that the distribution directory is removed from the " +
"old location when there is a distribution directory in the " +
"new location");
debugDump("testing that the distribution directory is removed from the " +
"old location when there is a distribution directory in the " +
"new location");
let distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
logTestInfo("testing " + distributionDir.path + " shouldn't exist");
debugDump("testing " + distributionDir.path + " shouldn't exist");
do_check_false(distributionDir.exists());
checkUpdateLogContains("removing old distribution directory");
@ -126,7 +126,7 @@ function runHelperProcess(args) {
let process = Cc["@mozilla.org/process/util;1"].
createInstance(Ci.nsIProcess);
process.init(helperBin);
logTestInfo("Running " + helperBin.path + " " + args.join(" "));
debugDump("Running " + helperBin.path + " " + args.join(" "));
process.run(true, args, args.length);
do_check_eq(process.exitValue, 0);
}

View File

@ -74,8 +74,8 @@ function checkUpdateApplied() {
*/
function finishCheckUpdateApplied() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -84,28 +84,28 @@ function finishCheckUpdateApplied() {
let distributionDir = getApplyDirFile(DIR_RESOURCES + "distribution", true);
if (IS_MACOSX) {
logTestInfo("testing that the distribution directory is moved from the " +
"old location to the new location");
logTestInfo("testing " + distributionDir.path + " should exist");
debugDump("testing that the distribution directory is moved from the " +
"old location to the new location");
debugDump("testing " + distributionDir.path + " should exist");
do_check_true(distributionDir.exists());
let testFile = getApplyDirFile(DIR_RESOURCES + "distribution/testFile", true);
logTestInfo("testing " + testFile.path + " should exist");
debugDump("testing " + testFile.path + " should exist");
do_check_true(testFile.exists());
testFile = getApplyDirFile(DIR_RESOURCES + "distribution/test/testFile", true);
logTestInfo("testing " + testFile.path + " should exist");
debugDump("testing " + testFile.path + " should exist");
do_check_true(testFile.exists());
distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
logTestInfo("testing " + distributionDir.path + " shouldn't exist");
debugDump("testing " + distributionDir.path + " shouldn't exist");
do_check_false(distributionDir.exists());
checkUpdateLogContains("Moving old distribution directory to new location");
} else {
logTestInfo("testing that files aren't added with an add-if instruction " +
"when the file's destination directory doesn't exist");
logTestInfo("testing " + distributionDir.path + " shouldn't exist");
debugDump("testing that files aren't added with an add-if instruction " +
"when the file's destination directory doesn't exist");
debugDump("testing " + distributionDir.path + " shouldn't exist");
do_check_false(distributionDir.exists());
}

View File

@ -54,8 +54,8 @@ function checkUpdateApplied() {
*/
function finishCheckUpdateApplied() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -64,28 +64,28 @@ function finishCheckUpdateApplied() {
let distributionDir = getApplyDirFile(DIR_RESOURCES + "distribution", true);
if (IS_MACOSX) {
logTestInfo("testing that the distribution directory is moved from the " +
"old location to the new location");
logTestInfo("testing " + distributionDir.path + " should exist");
debugDump("testing that the distribution directory is moved from the " +
"old location to the new location");
debugDump("testing " + distributionDir.path + " should exist");
do_check_true(distributionDir.exists());
let testFile = getApplyDirFile(DIR_RESOURCES + "distribution/testFile", true);
logTestInfo("testing " + testFile.path + " should exist");
debugDump("testing " + testFile.path + " should exist");
do_check_true(testFile.exists());
testFile = getApplyDirFile(DIR_RESOURCES + "distribution/test/testFile", true);
logTestInfo("testing " + testFile.path + " should exist");
debugDump("testing " + testFile.path + " should exist");
do_check_true(testFile.exists());
distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
logTestInfo("testing " + distributionDir.path + " shouldn't exist");
debugDump("testing " + distributionDir.path + " shouldn't exist");
do_check_false(distributionDir.exists());
checkUpdateLogContains("Moving old distribution directory to new location");
} else {
logTestInfo("testing that files aren't added with an add-if instruction " +
"when the file's destination directory doesn't exist");
logTestInfo("testing " + distributionDir.path + " shouldn't exist");
debugDump("testing that files aren't added with an add-if instruction " +
"when the file's destination directory doesn't exist");
debugDump("testing " + distributionDir.path + " shouldn't exist");
do_check_false(distributionDir.exists());
}

View File

@ -60,8 +60,8 @@ function checkUpdateApplied() {
*/
function finishCheckUpdateApplied() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -69,11 +69,11 @@ function finishCheckUpdateApplied() {
}
if (IS_MACOSX) {
logTestInfo("testing that the distribution directory is removed from the " +
"old location when there is a distribution directory in the " +
"new location");
debugDump("testing that the distribution directory is removed from the " +
"old location when there is a distribution directory in the " +
"new location");
let distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
logTestInfo("testing " + distributionDir.path + " shouldn't exist");
debugDump("testing " + distributionDir.path + " shouldn't exist");
do_check_false(distributionDir.exists());
checkUpdateLogContains("removing old distribution directory");

View File

@ -87,8 +87,8 @@ function checkUpdateApplied() {
function finishTest() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
debugDump("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
do_check_false(running.exists());
}

View File

@ -61,7 +61,7 @@ function setupAppFilesFinished() {
}
function customLaunchAppToApplyUpdate() {
logTestInfo("start - locking installation directory");
debugDump("start - locking installation directory");
const LPCWSTR = ctypes.char16_t.ptr;
const DWORD = ctypes.uint32_t;
const LPVOID = ctypes.voidptr_t;
@ -80,7 +80,7 @@ function customLaunchAppToApplyUpdate() {
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, LPVOID(0));
do_check_neq(gHandle.toString(), INVALID_HANDLE_VALUE.toString());
kernel32.close();
logTestInfo("finish - locking installation directory");
debugDump("finish - locking installation directory");
}
/**
@ -135,8 +135,8 @@ function checkUpdateApplied() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
debugDump("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
do_check_false(running.exists());
}
@ -144,43 +144,43 @@ function checkUpdateApplied() {
log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
} else {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
}
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
let updatesDir = getStageDirFile(DIR_UPDATES + "/0", true);
logTestInfo("testing " + updatesDir.path + " shouldn't exist");
debugDump("testing " + updatesDir.path + " shouldn't exist");
do_check_false(updatesDir.exists());
log = getStageDirFile(DIR_UPDATES + "/0/" + FILE_UPDATE_LOG, true);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getStageDirFile(DIR_UPDATES + "/" + FILE_LAST_LOG, true);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
} else {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
}
log = getStageDirFile(DIR_UPDATES + "/" + FILE_BACKUP_LOG, true);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
// Switch the application to the staged application that was updated by
@ -254,8 +254,8 @@ function finishCheckUpdateFinished() {
}
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -264,8 +264,8 @@ function finishCheckUpdateFinished() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file exists. " +
"Path: " + running.path);
debugDump("checking that the post update process running file exists. " +
"Path: " + running.path);
do_check_true(running.exists());
}
@ -279,22 +279,22 @@ function finishCheckUpdateFinished() {
do_check_eq(update.state, STATE_SUCCEEDED);
let updatesDir = getUpdatesPatchDir();
logTestInfo("testing " + updatesDir.path + " should exist");
debugDump("testing " + updatesDir.path + " should exist");
do_check_true(updatesDir.exists());
let log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
waitForFilesInUse();

View File

@ -110,8 +110,8 @@ function checkUpdateApplied() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
debugDump("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
do_check_false(running.exists());
}
@ -119,43 +119,43 @@ function checkUpdateApplied() {
log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
} else {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
}
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
let updatesDir = getStageDirFile(DIR_UPDATES + "/0", true);
logTestInfo("testing " + updatesDir.path + " shouldn't exist");
debugDump("testing " + updatesDir.path + " shouldn't exist");
do_check_false(updatesDir.exists());
log = getStageDirFile(DIR_UPDATES + "/0/" + FILE_UPDATE_LOG, true);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getStageDirFile(DIR_UPDATES + "/" + FILE_LAST_LOG, true);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
} else {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
}
log = getStageDirFile(DIR_UPDATES + "/" + FILE_BACKUP_LOG, true);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
// Switch the application to the staged application that was updated by
@ -228,8 +228,8 @@ function finishCheckUpdateApplied() {
}
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -238,8 +238,8 @@ function finishCheckUpdateApplied() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file exists. " +
"Path: " + running.path);
debugDump("checking that the post update process running file exists. " +
"Path: " + running.path);
do_check_true(running.exists());
}
@ -255,26 +255,26 @@ function finishCheckUpdateApplied() {
do_check_eq(update.state, STATE_SUCCEEDED);
let updatesDir = getUpdatesPatchDir();
logTestInfo("testing " + updatesDir.path + " should exist");
debugDump("testing " + updatesDir.path + " should exist");
do_check_true(updatesDir.exists());
let log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
if (IS_WIN || IS_MACOSX) {
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
} else {
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
}

View File

@ -116,8 +116,8 @@ function finishCheckUpdateFinished() {
}
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -134,22 +134,22 @@ function finishCheckUpdateFinished() {
do_check_eq(update.state, STATE_SUCCEEDED);
let updatesPatchDir = getUpdatesPatchDir();
logTestInfo("testing " + updatesPatchDir.path + " should exist");
debugDump("testing " + updatesPatchDir.path + " should exist");
do_check_true(updatesPatchDir.exists());
log = getUpdatesPatchDir();
log.append(FILE_UPDATE_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
log = getUpdatesDir();
log.append(FILE_LAST_LOG);
logTestInfo("testing " + log.path + " should exist");
debugDump("testing " + log.path + " should exist");
do_check_true(log.exists());
log = getUpdatesDir();
log.append(FILE_BACKUP_LOG);
logTestInfo("testing " + log.path + " shouldn't exist");
debugDump("testing " + log.path + " shouldn't exist");
do_check_false(log.exists());
waitForFilesInUse();

View File

@ -51,8 +51,8 @@ function checkUpdateFinished() {
function checkUpdate() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);

View File

@ -5,6 +5,9 @@
/* Replace app binary complete MAR file staged patch apply success test */
function run_test() {
// Set to true due to bug 1037599
DEBUG_AUS_TEST = true;
if (!shouldRunServiceTest()) {
return;
}

View File

@ -42,8 +42,8 @@ function setupAppFilesFinished() {
*/
function checkUpdateFinished() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -52,8 +52,8 @@ function checkUpdateFinished() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
debugDump("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
do_check_false(running.exists());
}

View File

@ -6,6 +6,9 @@
fallback test */
function run_test() {
// Set to true due to bug 1123503
DEBUG_AUS_TEST = true;
if (!shouldRunServiceTest()) {
return;
}

View File

@ -6,6 +6,9 @@
fallback test */
function run_test() {
// Set to true due to bug 1112284
DEBUG_AUS_TEST = true;
if (!shouldRunServiceTest()) {
return;
}

View File

@ -6,6 +6,9 @@
test */
function run_test() {
// Set to true due to bug 1123503
DEBUG_AUS_TEST = true;
if (!shouldRunServiceTest()) {
return;
}

View File

@ -6,6 +6,9 @@
test */
function run_test() {
// Set to true due to bug 1112284
DEBUG_AUS_TEST = true;
if (!shouldRunServiceTest()) {
return;
}

View File

@ -6,6 +6,9 @@
/* General Partial MAR File Staged Patch Apply Failure Test */
function run_test() {
// Set to true due to bug 1109219
DEBUG_AUS_TEST = true;
if (!shouldRunServiceTest()) {
return;
}
@ -44,8 +47,8 @@ function setupAppFilesFinished() {
function checkUpdateFinished() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
debugDump("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
do_check_false(running.exists());
}

View File

@ -64,8 +64,8 @@ function checkUpdateFinished() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
debugDump("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
do_check_false(running.exists());
}
@ -96,8 +96,8 @@ function checkUpdateApplied() {
*/
function finishCheckUpdateApplied() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -106,8 +106,8 @@ function finishCheckUpdateApplied() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file exists. " +
"Path: " + running.path);
debugDump("checking that the post update process running file exists. " +
"Path: " + running.path);
do_check_true(running.exists());
}
@ -124,7 +124,7 @@ function runHelperProcess(args) {
let process = Cc["@mozilla.org/process/util;1"].
createInstance(Ci.nsIProcess);
process.init(helperBin);
logTestInfo("Running " + helperBin.path + " " + args.join(" "));
debugDump("Running " + helperBin.path + " " + args.join(" "));
process.run(true, args, args.length);
do_check_eq(process.exitValue, 0);
}

View File

@ -6,6 +6,9 @@
/* General Partial MAR File Staged Patch Apply Test */
function run_test() {
// Set to true due to bug 1083653
DEBUG_AUS_TEST = true;
if (!shouldRunServiceTest(false, true)) {
return;
}
@ -44,8 +47,8 @@ function checkUpdateFinished() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
debugDump("checking that the post update process running file doesn't " +
"exist. Path: " + running.path);
do_check_false(running.exists());
}
@ -76,8 +79,8 @@ function checkUpdateApplied() {
*/
function finishCheckUpdateApplied() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
@ -86,8 +89,8 @@ function finishCheckUpdateApplied() {
if (IS_WIN || IS_MACOSX) {
let running = getPostUpdateFile(".running");
logTestInfo("checking that the post update process running file exists. " +
"Path: " + running.path);
debugDump("checking that the post update process running file exists. " +
"Path: " + running.path);
do_check_true(running.exists());
}

View File

@ -53,8 +53,8 @@ function checkUpdateFinished() {
*/
function finishCheckUpdateFinished() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);

View File

@ -59,8 +59,8 @@ function checkUpdateFinished() {
*/
function finishCheckUpdateFinished() {
if (IS_MACOSX) {
logTestInfo("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
debugDump("testing last modified time on the apply to directory has " +
"changed after a successful update (bug 600098)");
let now = Date.now();
let applyToDir = getApplyDirFile();
let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);

View File

@ -103,6 +103,8 @@ const TESTS = [ {
lastUpdateTime : 0
} ];
const DEBUG_TEST = false;
let gUTM;
let gNextFunc;
@ -218,35 +220,35 @@ function finished_test1thru7() {
}
function check_test1thru7() {
do_print("Testing: a category registered timer didn't fire due to an " +
"invalid default interval");
debugDump("Testing: a category registered timer didn't fire due to an " +
"invalid default interval");
do_check_false(TESTS[0].notified);
do_print("Testing: a category registered timer didn't fire due to not " +
"implementing nsITimerCallback");
debugDump("Testing: a category registered timer didn't fire due to not " +
"implementing nsITimerCallback");
do_check_false(TESTS[1].notified);
do_print("Testing: a category registered timer didn't fire due to the next " +
"update time being in the future");
debugDump("Testing: a category registered timer didn't fire due to the " +
"next update time being in the future");
do_check_false(TESTS[2].notified);
do_print("Testing: a category registered timer didn't fire due to not " +
"having a notify method");
debugDump("Testing: a category registered timer didn't fire due to not " +
"having a notify method");
do_check_false(TESTS[3].notified);
do_print("Testing: a category registered timer has fired");
debugDump("Testing: a category registered timer has fired");
do_check_true(TESTS[4].notified);
do_print("Testing: a category registered timer fired that has an interval " +
"preference that overrides a default that wouldn't have fired yet");
debugDump("Testing: a category registered timer fired that has an interval " +
"preference that overrides a default that wouldn't have fired yet");
do_check_true(TESTS[5].notified);
do_print("Testing: a category registered timer has fired due to the next " +
"update time being reset due to a future last update time");
debugDump("Testing: a category registered timer has fired due to the next " +
"update time being reset due to a future last update time");
do_check_true(TESTS[6].notified);
do_print("Testing: two category registered timers last update time has " +
"user values");
debugDump("Testing: two category registered timers last update time has " +
"user values");
do_check_true(gPref.prefHasUserValue(PREF_BRANCH_LAST_UPDATE_TIME +
TESTS[4].timerID));
do_check_true(gPref.prefHasUserValue(PREF_BRANCH_LAST_UPDATE_TIME +
@ -264,8 +266,8 @@ function check_test1thru7() {
gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, entry, false);
count++;
}
do_print("Testing: no " + CATEGORY_UPDATE_TIMER + " categories are still " +
"registered");
debugDump("Testing: no " + CATEGORY_UPDATE_TIMER + " categories are still " +
"registered");
do_check_eq(count, 0);
do_execute_soon(run_test8);
@ -287,7 +289,7 @@ function check_test8(aTestTimerCallback) {
return;
}
do_print("Testing: two registerTimer registered timers have fired");
debugDump("Testing: two registerTimer registered timers have fired");
for (let i = 0; i < 2; i++) {
do_check_true(TESTS[7 + i].notified);
}
@ -298,8 +300,8 @@ function check_test8(aTestTimerCallback) {
do_check_true(Math.abs(TESTS[7].notifyTime - TESTS[8].notifyTime) >=
MAIN_TIMER_INTERVAL * 0.5);
do_print("Testing: two registerTimer registered timers last update time have " +
"been updated");
debugDump("Testing: two registerTimer registered timers last update time " +
"have been updated");
for (let i = 0; i < 2; i++) {
do_check_neq(gPref.getIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[7 + i].timerID), 1);
}
@ -460,3 +462,43 @@ const gTest9Factory = {
throw Cr.NS_ERROR_NO_AGGREGATION;
}
};
/**
* Logs TEST-INFO messages.
*
* @param aText
* The text to log.
* @param aCaller (optional)
* An optional Components.stack.caller. If not specified
* Components.stack.caller will be used.
*/
function logTestInfo(aText, aCaller) {
let caller = aCaller ? aCaller : Components.stack.caller;
let now = new Date;
let hh = now.getHours();
let mm = now.getMinutes();
let ss = now.getSeconds();
let ms = now.getMilliseconds();
let time = (hh < 10 ? "0" + hh : hh) + ":" +
(mm < 10 ? "0" + mm : mm) + ":" +
(ss < 10 ? "0" + ss : ss) + ":" +
(ms < 10 ? "00" + ms : ms < 100 ? "0" + ms : ms);
let msg = time + " | TEST-INFO | " + caller.filename + " | [" + caller.name +
" : " + caller.lineNumber + "] " + aText;
do_print(msg);
}
/**
* Logs TEST-INFO messages when DEBUG_TEST evaluates to true.
*
* @param aText
* The text to log.
* @param aCaller (optional)
* An optional Components.stack.caller. If not specified
* Components.stack.caller will be used.
*/
function debugDump(aText, aCaller) {
if (DEBUG_TEST) {
logTestInfo(aText, aCaller);
}
}