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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html

Issue 2591043005: Convert audiobuffersource-ended to testharness (Closed)
Patch Set: Rebase and remove unneeded expected result file Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <head>
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../resources/audit-util.js"></script> 5 <script src="../resources/audit-util.js"></script>
5 <script src="../resources/audio-testing.js"></script> 6 <script src="../resources/audit.js"></script>
6 <script src="../resources/audiobuffersource-testing.js"></script> 7 <script src="../resources/audiobuffersource-testing.js"></script>
8 </head>
9 <body>
7 <script> 10 <script>
8 var context; 11 let audit = Audit.createTaskRunner();
9 var source;
10 12
11 function runTest() 13 let context;
12 { 14 let source;
13 if (window.testRunner) {
14 testRunner.dumpAsText();
15 testRunner.waitUntilDone();
16 }
17 15
18 var sampleRate = 44100.0; 16 audit.define("AudioBufferSourceNode calls its onended EventListener",
19 var numberOfFrames = 32; 17 function (task, should) {
20 context = new OfflineAudioContext(1, numberOfFrames, sampleRate); 18 let sampleRate = 44100.0;
21 source = context.createBufferSource(); 19 let numberOfFrames = 32;
22 source.buffer = createTestBuffer(context, numberOfFrames); 20 context = new OfflineAudioContext(1, numberOfFrames, sampleRate);
23 source.connect(context.destination); 21 source = context.createBufferSource();
24 source.onended = function() 22 source.buffer = createTestBuffer(context, numberOfFrames);
25 { 23 source.connect(context.destination);
26 testPassed("source.onended called."); 24 source.onended = function () {
27 if (window.testRunner) 25 should(true, "source.onended called").beTrue();
28 testRunner.notifyDone(); 26 task.done();
29 } 27 }
30 source.start(0); 28 source.start(0);
31 context.startRendering(); 29 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.
32 } 30 });
31
32 audit.run();
33 </script> 33 </script>
34
35 </head>
36 <body onload="runTest()">
37 <div>Tests that AudioBufferSourceNode calls its onended EventListener.</div>
38 <div id="console"></div>
39 </body> 34 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698