Bug 1295734 - Remove dump override from app update tests. r=mhowell

This commit is contained in:
Robert Strong 2016-08-16 14:00:43 -07:00
Родитель dbddca3e70
Коммит f2f3794312
1 изменённых файлов: 0 добавлений и 68 удалений

Просмотреть файл

@ -181,16 +181,6 @@ var gEnvLdLibraryPath;
// information for an individual test set DEBUG_AUS_TEST to true in the test's
// run_test function.
var DEBUG_AUS_TEST = true;
// 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
// be displayed in the log.
var DEBUG_TEST_LOG = false;
// Set to false to keep the log file from the failed parallel test run.
var gDeleteLogFile = true;
var gRealDump;
var gTestLogText = "";
var gPassed;
const DATA_URI_SPEC = Services.io.newFileURI(do_get_file("../data", false)).spec;
Services.scriptloader.loadSubScript(DATA_URI_SPEC + "shared.js", this);
@ -840,25 +830,6 @@ function setupTestCommon() {
}
}
if (DEBUG_TEST_LOG) {
let logFile = do_get_file(gTestID + ".log", true);
if (logFile.exists()) {
gPassed = false;
logTestInfo("start - dumping previous test run log");
logTestInfo("\n" + readFile(logFile) + "\n");
logTestInfo("finish - dumping previous test run log");
if (gDeleteLogFile) {
logFile.remove(false);
}
do_throw("The parallel run of this test failed. Failing non-parallel " +
"test so the log from the parallel run can be displayed in " +
"non-parallel log.");
} else {
gRealDump = dump;
dump = dumpOverride;
}
}
if (IS_WIN) {
Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED,
IS_SERVICE_TEST ? true : false);
@ -1011,42 +982,6 @@ function cleanupTestCommon() {
resetEnvironment();
debugDump("finish - general test cleanup");
if (gRealDump) {
dump = gRealDump;
gRealDump = null;
}
if (DEBUG_TEST_LOG && !gPassed) {
let fos = Cc["@mozilla.org/network/file-output-stream;1"].
createInstance(Ci.nsIFileOutputStream);
let logFile = do_get_file(gTestID + ".log", true);
if (!logFile.exists()) {
logFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, PERMS_FILE);
}
fos.init(logFile, MODE_WRONLY | MODE_CREATE | MODE_APPEND, PERMS_FILE, 0);
fos.write(gTestLogText, gTestLogText.length);
fos.close();
}
if (DEBUG_TEST_LOG) {
gTestLogText = null;
} else {
let logFile = do_get_file(gTestID + ".log", true);
if (logFile.exists()) {
logFile.remove(false);
}
}
}
/**
* Helper function to store the log output of calls to dump in a variable so the
* values can be written to a file for a parallel run of a test and printed to
* the log file when the test runs synchronously.
*/
function dumpOverride(aText) {
gTestLogText += aText;
gRealDump(aText);
}
/**
@ -1055,9 +990,6 @@ function dumpOverride(aText) {
* inspected.
*/
function doTestFinish() {
if (gPassed === undefined) {
gPassed = true;
}
if (DEBUG_AUS_TEST) {
// This prevents do_print errors from being printed by the xpcshell test
// harness due to nsUpdateService.js logging to the console when the