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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/unit-tests/jstest-test.html

Issue 2872703004: Remove old Audit implementation (Closed)
Patch Set: Created 3 years, 7 months 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>A simple unit testing for audio-testing.js and js-test.js</title>
5 <script src="../../resources/js-test.js"></script>
6 <script src="../resources/audit-util.js"></script>
7 <script src="../resources/audio-testing.js"></script>
8 </head>
9 <body>
10 <script>
11 description('A simple unit testing for audio-testing.js and js-test.js');
12 window.jsTestIsAsync = true;
13
14 var audit = Audit.createTaskRunner();
15
16 audit.defineTask('foo', function (taskDone) {
17 Should('Zero', 0).beEqualTo(0);
18 Should('One', 1).notBeEqualTo(0);
19 Should('Expected SNR', 110).beGreaterThanOrEqualTo(100);
20 taskDone();
21 });
22
23 audit.defineTask('bar', function (taskDone) {
24 var maxError = 1e-6;
25 Should("Maximum error value", maxError).beLessThanOrEqualTo(1e-5);
26 Should("max error", maxError).beLessThanOrEqualTo(-1);
27 Should('One point double zero one', 1.001).beCloseTo(1, .1);
28 Should('Two', 2).beCloseTo(1, .1);
29 taskDone();
30 });
31
32 audit.defineTask('boo', function (taskDone) {
33 Should('[2, 2, 2]', [2, 2, 2]).beConstantValueOf(2);
34 Should('[1, 2, 3]', [1, 2, 3]).beEqualToArray([1, 2, 3]);
35 Should('My array', [0.11, 0.19]).beCloseToArray([0.1, 0.2], 0.02);
36 Should('My random array', [1, 1, 3, 3, 2]).containValues([1, 3, 2]);
37 taskDone();
38 });
39
40 audit.defineTask("finish", function (done) {
41 finishJSTest();
42 done();
43 });
44
45 audit.runTasks();
46 </script>
47 </body>
48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698