Bug 1051635 - Fix the missing error handling in TestRunner (structured logging). r=chmanchester

This commit is contained in:
Ahmed Kachkach 2014-08-12 13:59:00 -04:00
parent 5a50f85702
commit 0cf274b769

View File

@ -261,6 +261,11 @@ function StructuredLogger(name) {
} else { } else {
dump('\n' + str + '\n'); dump('\n' + str + '\n');
} }
// Checking for error messages
if (message.expected || message.level === "ERROR") {
TestRunner.failureHandler();
}
}; };
/* Message validation. Only checking the action for now */ /* Message validation. Only checking the action for now */
@ -425,8 +430,11 @@ TestRunner.error = function(msg) {
TestRunner.structuredLogger.error(msg); TestRunner.structuredLogger.error(msg);
} else { } else {
dump(msg + "\n"); dump(msg + "\n");
TestRunner.failureHandler();
} }
};
TestRunner.failureHandler = function() {
if (TestRunner.runUntilFailure) { if (TestRunner.runUntilFailure) {
TestRunner._haltTests = true; TestRunner._haltTests = true;
} }
@ -469,7 +477,7 @@ TestRunner._makeIframe = function (url, retry) {
return; return;
} }
TestRunner.structuredLogger.error("Unable to restore focus, expect failures and timeouts."); TestRunner.structuredLogger.info("Error: Unable to restore focus, expect failures and timeouts.");
} }
window.scrollTo(0, $('indicator').offsetTop); window.scrollTo(0, $('indicator').offsetTop);
iframe.src = url; iframe.src = url;