| 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..1982fd30043ab51f2af48f218be7d1ddd5d1b474 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html
|
| @@ -1,7 +1,7 @@
|
| <!DOCTYPE html>
|
| <html>
|
| <head>
|
| - <title>A simple unit testing for audio-test-utils.js and testharness.js</title>
|
| + <title>audit.js: basic tests</title>
|
| <script src="../../resources/testharness.js"></script>
|
| <script src="../../resources/testharnessreport.js"></script>
|
| <script src="../resources/audit.js"></script>
|
| @@ -15,31 +15,23 @@
|
| task.describe('Simple unit tests for basic assertions.');
|
|
|
| should(OfflineAudioContext, 'OfflineAudioContext').exist();
|
| -
|
| should(function () { var foo = 0; }, 'Setting foo to 0').notThrow();
|
| should(function () { var foo = bar; }).throw('ReferenceError');
|
| -
|
| should(3 < 5, '3 < 5').beTrue();
|
| should(false).beFalse();
|
| -
|
| should(1).beEqualTo(1)
|
| should(1).notBeEqualTo(2)
|
| should(typeof AudioContext.prototype).beEqualTo('object');
|
| -
|
| should(2).beGreaterThan(1);
|
| should(2).beGreaterThanOrEqualTo(2);
|
| -
|
| should(1).beLessThan(2);
|
| should(1).beLessThanOrEqualTo(1);
|
|
|
| let oac = new OfflineAudioContext(1, 128, 44100);
|
| -
|
| Promise.all([
|
| should(oac.startRendering(), 'Start OAC rendering').beResolved(),
|
| should(oac.decodeAudioData()).beRejected()
|
| - ]).then(function () {
|
| - task.done();
|
| - });
|
| + ]).then(task.done.bind(task));
|
| });
|
|
|
|
|
| @@ -50,32 +42,29 @@
|
| task.describe('Numerical assertion unit test.');
|
|
|
| should(2.3).beCloseTo(2, { threshold: 0.3 });
|
| -
|
| 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);
|
|
|
| - // 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();
|
| + });
|
| +
|
| +
|
| + // 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('empty', function (task, should) {
|
| + task.describe('This is an empty task.');
|
|
|
| task.done();
|
| });
|
|
|
|
|
| - audit.run();
|
| + // You can enumerate tasks you want to execute in the order, or simply pass
|
| + // no argument to run all the defined tasks.
|
| + audit.run('numerical', 'basic');
|
| </script>
|
| </body>
|
| </html>
|
|
|