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

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

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

Powered by Google App Engine
This is Rietveld 408576698