Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html |
| index 3e72fa37ecee158c8b8a11922403eaf1a7f651a0..78519e6a7937909e1dc999444642776f97b50785 100644 |
| --- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html |
| +++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html |
| @@ -1,39 +1,34 @@ |
| <!DOCTYPE html> |
| <head> |
| - <script src="../../resources/js-test.js"></script> |
| + <script src="../../resources/testharness.js"></script> |
| + <script src="../../resources/testharnessreport.js"></script> |
| <script src="../resources/audit-util.js"></script> |
| - <script src="../resources/audio-testing.js"></script> |
| + <script src="../resources/audit.js"></script> |
| <script src="../resources/audiobuffersource-testing.js"></script> |
| +</head> |
| +<body> |
| <script> |
| - var context; |
| - var source; |
| + let audit = Audit.createTaskRunner(); |
| - function runTest() |
| - { |
| - if (window.testRunner) { |
| - testRunner.dumpAsText(); |
| - testRunner.waitUntilDone(); |
| - } |
| + let context; |
| + let source; |
| - var sampleRate = 44100.0; |
| - var numberOfFrames = 32; |
| - context = new OfflineAudioContext(1, numberOfFrames, sampleRate); |
| - source = context.createBufferSource(); |
| - source.buffer = createTestBuffer(context, numberOfFrames); |
| - source.connect(context.destination); |
| - source.onended = function() |
| - { |
| - testPassed("source.onended called."); |
| - if (window.testRunner) |
| - testRunner.notifyDone(); |
| - } |
| - source.start(0); |
| - context.startRendering(); |
| - } |
| - </script> |
| + audit.define("AudioBufferSourceNode calls its onended EventListener", |
| + function (task, should) { |
| + let sampleRate = 44100.0; |
| + let numberOfFrames = 32; |
| + context = new OfflineAudioContext(1, numberOfFrames, sampleRate); |
| + source = context.createBufferSource(); |
| + source.buffer = createTestBuffer(context, numberOfFrames); |
| + source.connect(context.destination); |
| + source.onended = function () { |
| + should(true, "source.onended called").beTrue(); |
| + task.done(); |
| + } |
| + source.start(0); |
| + context.startRendering(); |
|
hongchan
2017/01/04 21:42:41
Q: should we change this to the promise pattern?
Raymond Toy
2017/01/04 21:46:16
Sorry, I don't follow. The test is that the onend
hongchan
2017/01/10 19:22:58
Ha, I missed that. Sorry.
|
| + }); |
| -</head> |
| -<body onload="runTest()"> |
| - <div>Tests that AudioBufferSourceNode calls its onended EventListener.</div> |
| - <div id="console"></div> |
| + audit.run(); |
| + </script> |
| </body> |