Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/unit-test-audio-testing.html |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/unit-test-audio-testing.html b/third_party/WebKit/LayoutTests/webaudio/unit-test-audio-testing.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..60c31ddd907449cf88184b9c27516eac69711f9e |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/webaudio/unit-test-audio-testing.html |
| @@ -0,0 +1,45 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| + <title>A simple unit testing for audio-testing.js and testharness.js</title> |
| + |
| + <!-- This is the required dependency for testharness + audio-testing. Note |
| + that the including order matters because audio-testing.js depends on |
| + testharness.js --> |
|
Raymond Toy
2016/08/04 18:07:08
Is this because audio-testing.js checks for testha
hongchan
2016/08/04 18:31:37
Should and Audit both rely on testharness. I think
|
| + <script src="../resources/testharness.js"></script> |
| + <script src="../resources/testharnessreport.js"></script> |
| + <script src="resources/audio-testing.js"></script> |
| + |
| +</head> |
| +<body> |
| + <script> |
| + var audit = Audit.createTaskRunner(); |
| + |
| + audit.defineTask('foo', function (taskDone) { |
| + Should('Zero', 0).beEqualTo(0); |
| + Should('One', 1).notBeEqualTo(0); |
| + Should('Expected SNR', 110).beGreaterThanOrEqualTo(100); |
| + taskDone(); |
| + }); |
| + |
| + audit.defineTask('bar', function (taskDone) { |
| + var maxError = 1e-6; |
| + Should("Maximum error value", maxError).beLessThanOrEqualTo(1e-5); |
| + // Should("max error", maxError).beLessThanOrEqualTo(-1); |
| + Should('One point double zero one', 1.001).beCloseTo(1, .1); |
| + // Should('Two', 2).beCloseTo(1, .1); |
| + taskDone(); |
| + }); |
| + |
| + audit.defineTask('boo', function (taskDone) { |
| + Should('[2, 2, 2]', [2, 2, 2]).beConstantValueOf(2); |
| + Should('[1, 2, 3]', [1, 2, 3]).beEqualToArray([1, 2, 3]); |
| + Should('My array', [0.11, 0.19]).beCloseToArray([0.1, 0.2], 0.02); |
| + Should('My random array', [1, 1, 3, 3, 2]).containValues([1, 3, 2]); |
| + taskDone(); |
| + }); |
| + |
| + audit.runTasks(); |
|
Raymond Toy
2016/08/04 18:07:08
This is a breaking change. We used to have to hav
hongchan
2016/08/04 18:31:37
Not sure why this is a breaking change. It does no
|
| + </script> |
| +</body> |
| +</html> |