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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html

Issue 2561573006: Fixing audit.js: should().beCloseTo() and task.run('taskName') (Closed)
Patch Set: Review 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/unit-tests/audit.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html b/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html
index 6d7e0d1f1d21852b7b08cf4282ff69407a2d735c..7ca99f08e879a14e7894948f675780bb144e381e 100644
--- a/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html
+++ b/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html
@@ -49,33 +49,40 @@
audit.define('numerical', function (task, should) {
task.describe('Numerical assertion unit test.');
- should(2.3).beCloseTo(2, { threshold: 0.3 });
-
+ should(0).beCloseTo(0, { threshold: 0 });
Raymond Toy 2016/12/08 00:06:02 Rather than modifying this test, I think you shoul
hongchan 2016/12/08 17:52:12 Done.
should([1, 1, 1]).beConstantValueOf(1);
- // should([1, 8, 11, 18, 6, 5, 5, 5, 123, 49]).beConstantValueOf(5);
-
should([1, 1, 1]).beEqualToArray([1, 1, 1]);
- // should([1, 8, 11, 18, 6, 5, 5, 5, 123, 49])
- // .beEqualToArray([1, 8, 10, 18, 6, 5, 6, 5, 123, 48]);
-
should([1, 1, 1, 1, 2, 2, 3, 3, 3])
.containValues([1, 2, 3], 'one, two, three');
- // should([1, 1, 1, 1, 2, 2, 3, 3, 3]).containValues([1, 3, 2]);
-
should([0.5, 0.5, 0.55, 0.5, 0.45, 0.5]).notGlitch(0.06);
- // should([0.5, 0.5, 0.55, 0.5, 0.45, 0.5]).notGlitch(0.04);
+
+ task.done();
+ });
+
+
+ // This task is defined, but you can selectively opt it out when the task
+ // runs. If you would like to see how failure cases get printed, include
+ // this task and launch the task runner.
+ audit.define('failures', function (task, should) {
+ task.describe('To demonstrate the failure logging.');
- // should([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.9])
- // .beCloseToArray([0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1], {
- // absoluteThreshold: 0.02,
- // relativeThreshold: 0.1
- // });
+ should(2.3).beCloseTo(2, { threshold: 0.3 });
+ should([1, 8, 11, 18, 6, 5, 5, 5, 123, 49]).beConstantValueOf(5);
+ should([1, 8, 11, 18, 6, 5, 5, 5, 123, 49])
+ .beEqualToArray([1, 8, 10, 18, 6, 5, 6, 5, 123, 48]);
+ should([1, 1, 1, 1, 2, 2, 3, 3, 3]).containValues([1, 3, 2]);
+ should([0.5, 0.5, 0.55, 0.5, 0.45, 0.5]).notGlitch(0.04);
+ should([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.9])
+ .beCloseToArray([0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1], {
+ absoluteThreshold: 0.02,
+ relativeThreshold: 0.1
+ });
task.done();
});
- audit.run();
+ audit.run('numerical', 'basic');
Raymond Toy 2016/12/08 00:06:02 I'm ok with this for this CL, but we really need t
hongchan 2016/12/08 17:52:12 Sure. I will add another test (for the failure cas
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698