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

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

Issue 2714853005: Convert remaining AudioBufferSource tests to testharness (Closed)
Patch Set: Created 3 years, 10 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <!-- 3 <!--
4 Test AudioBufferSourceNode supports 5.1 channel. 4 Test AudioBufferSourceNode supports 5.1 channel.
5 --> 5 -->
6 6
7 <html> 7 <html>
8 <head> 8 <head>
9 <script src="../../resources/testharness.js"></script>
10 <script src="../../resources/testharnessreport.js"></script>
9 <script src="../resources/audit-util.js"></script> 11 <script src="../resources/audit-util.js"></script>
10 <script src="../resources/audio-testing.js"></script> 12 <script src="../resources/audit.js"></script>
11 <script type="text/javascript" src="../resources/mix-testing.js"></script> 13 <script src="../resources/mix-testing.js"></script>
12 </head> 14 </head>
13 <body> 15 <body>
14 16
15 <script> 17 <script>
18 let audit = Audit.createTaskRunner();
16 19
17 function runTest() { 20 audit.define('test', (task, should) => {
18 if (!window.testRunner) 21 should(window.testRunner, 'window.testRunner').notBeEqualTo(undefined);
19 return;
20 22
21 testRunner.waitUntilDone(); 23 testRunner.waitUntilDone();
22 24
23 window.jsTestAsync = true; 25 // Create offline audio context
26 let sampleRate = 44100.0;
27 let context =
28 new OfflineAudioContext(6, sampleRate * toneLengthSeconds, sampleRate);
29 let toneBuffer = createToneBuffer(context, 440, toneLengthSeconds, 6);
24 30
25 // Create offline audio context 31 let source = context.createBufferSource();
26 var sampleRate = 44100.0; 32 source.buffer = toneBuffer;
27 var context = new OfflineAudioContext(6, sampleRate * toneLengthSeconds, sam pleRate);
28 var toneBuffer = createToneBuffer(context, 440, toneLengthSeconds, 6);
29 33
30 var source = context.createBufferSource(); 34 source.connect(context.destination);
31 source.buffer = toneBuffer; 35 source.start(0);
32 36
33 source.connect(context.destination); 37 context.oncomplete = (event) => {
hongchan 2017/02/27 18:05:35 promise?
34 source.start(0); 38 finishAudioTest(event);
39 task.done();
40 };
41 context.startRendering();
42 });
35 43
36 context.oncomplete = finishAudioTest; 44 audit.run();
37 context.startRendering();
38 }
39
40 runTest();
41 </script> 45 </script>
42 46
43 </body> 47 </body>
44 </html> 48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698