diff --git a/test/harness/helper.js b/test/harness/helper.js index fb0504a875..a4d5663bf2 100644 --- a/test/harness/helper.js +++ b/test/harness/helper.js @@ -217,12 +217,38 @@ function Presenter() { /* Append a result to the run page's result log. */ function logResult(test) { + var appendStr = ""; altStyle = (altStyle !== ' ') ? ' ' : 'alternate'; - var appendStr = '' + "" + test.id + "" + '' + - test.description + '' + - test.result + ''; + + if (test.result==="fail") { + appendStr += ''; + appendStr += ''; + + appendStr += ''; + appendStr += ""; + appendStr += test.id + ""; + appendStr += ''; + + appendStr += '' + test.description + ''; + + appendStr += ''; + appendStr += '' + ""; + appendStr += 'Fail'; + } + + else if (test.result==="pass") { + if (! isSiteDebugMode()) { return;} + appendStr += ''; + appendStr += ""; + appendStr += test.id + "" + '' + test.description; + appendStr += ''; + appendStr += 'Pass'; + } + else { + throw "Result for '" + test.id + "' must either be 'pass' or 'fail', not '" + test.result + "'!"; + } + + logger.append(appendStr); logger.parent().attr("scrollTop", logger.parent().attr("scrollHeight")); } diff --git a/website/resources/scripts/global/helper.js b/website/resources/scripts/global/helper.js index fb0504a875..a4d5663bf2 100644 --- a/website/resources/scripts/global/helper.js +++ b/website/resources/scripts/global/helper.js @@ -217,12 +217,38 @@ function Presenter() { /* Append a result to the run page's result log. */ function logResult(test) { + var appendStr = ""; altStyle = (altStyle !== ' ') ? ' ' : 'alternate'; - var appendStr = '' + "" + test.id + "" + '' + - test.description + '' + - test.result + ''; + + if (test.result==="fail") { + appendStr += ''; + appendStr += ''; + + appendStr += ''; + appendStr += ""; + appendStr += test.id + ""; + appendStr += ''; + + appendStr += '' + test.description + ''; + + appendStr += ''; + appendStr += '' + ""; + appendStr += 'Fail'; + } + + else if (test.result==="pass") { + if (! isSiteDebugMode()) { return;} + appendStr += ''; + appendStr += ""; + appendStr += test.id + "" + '' + test.description; + appendStr += ''; + appendStr += 'Pass'; + } + else { + throw "Result for '" + test.id + "' must either be 'pass' or 'fail', not '" + test.result + "'!"; + } + + logger.append(appendStr); logger.parent().attr("scrollTop", logger.parent().attr("scrollHeight")); }