Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/resources/audit.js

Issue 2568573002: Additional unit test for audit.js: failure cases and logging examples. (Closed)
Patch Set: Adding expected result Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/webaudio/resources/audit.js
diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
index a366a807273f33ec20813b41ec68e489dffed80d..666dfceb104466260b499ed22dc2086acae64a5b 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
@@ -302,8 +302,8 @@ window.Audit = (function () {
passDetail = '${actual} did not throw an exception.';
} catch (error) {
didThrowCorrectly = true;
- failDetail = '${actual} threw ' + error.name + ': '
- + error.message + '.';
+ failDetail = '${actual} *INCORRECTLY* threw ' + error.name + ': "'
Raymond Toy 2016/12/09 22:10:26 Do these really need to be highlighted? The "FAIL
hongchan 2016/12/19 22:14:05 Then do we remove all the *HIGHLIGHT*? I felt PASS
+ + error.message + '".';
}
return this._assert(!didThrowCorrectly, passDetail, failDetail);
@@ -614,7 +614,7 @@ window.Audit = (function () {
passed,
'${actual} contains all the expected values in the correct order: '
+ '${expected}.',
- '${actual} contains an unexpected value of '
+ '${actual} contains an *UNEXPECTED* value of '
+ this._actual[indexActual] + ' at index ' + indexActual + '.');
}
@@ -640,7 +640,7 @@ window.Audit = (function () {
let diff = Math.abs(this._actual[index - 1] - this._actual[index]);
if (diff >= this._expected) {
passed = false;
- failDetail = '${actual} has a glitch at index ' + index + ' of size '
+ failDetail = '${actual} has a *GLITCH* at index ' + index + ' of size '
+ diff + '.';
}
}
@@ -674,7 +674,7 @@ window.Audit = (function () {
return this._assert(
error <= this._options.threshold,
'${actual} is ${expected} within an error of ${threshold}.',
- '${actual} is not ${expected} within an error of ${threshold}: ' +
+ '${actual} is *NOT* ${expected} within an error of ${threshold}: ' +
'${actual} with error of ${threshold}.');
}
@@ -751,7 +751,7 @@ window.Audit = (function () {
} else {
// Failed. Prepare the detailed failure log.
passed = false;
- failDetail = '${actual} does not equal ${expected} with an '
+ failDetail = '${actual} does *NOT* equal ${expected} with an '
+ 'element-wise tolerance of ' + maxAllowedErrorDetail + '.\n';
// Print out actual, expected, absolute error, and relative error.

Powered by Google App Engine
This is Rietveld 408576698