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

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

Issue 2581463002: Refactor WebAudio test directory (Closed)
Patch Set: Use correct path for wav result files Created 3 years, 12 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 See if we can load an AudioBuffer, create an AudioBufferSourceNode, attach the b uffer to it, then play it. 4 See if we can load an AudioBuffer, create an AudioBufferSourceNode, attach the b uffer to it, then play it.
5 --> 5 -->
6 6
7 <html> 7 <html>
8 <head> 8 <head>
9 <script src="resources/audit-util.js"></script> 9 <script src="../../resources/js-test.js"></script>
10 <script src="resources/audio-testing.js"></script> 10 <script src="../resources/audit-util.js"></script>
11 <script type="text/javascript" src="resources/buffer-loader.js"></script> 11 <script src="../resources/audio-testing.js"></script>
12 <script type="text/javascript" src="../resources/buffer-loader.js"></script>
12 13
13 <script> 14 <script>
14 15
15 window.onload = init; 16 window.onload = init;
16 17
17 var sampleRate = 44100.0; 18 var sampleRate = 44100.0;
18 var lengthInSeconds = 2; 19 var lengthInSeconds = 2;
19 20
20 var context = 0; 21 var context = 0;
21 var bufferLoader = 0; 22 var bufferLoader = 0;
22 23
23 function init() { 24 function init() {
24 if (!window.testRunner) 25 if (!window.testRunner)
25 return; 26 return;
26 27
27 // Create offline audio context. 28 // Create offline audio context.
28 context = new OfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRat e); 29 context = new OfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRat e);
29 30
30 bufferLoader = new BufferLoader( 31 bufferLoader = new BufferLoader(
31 context, 32 context,
32 [ 33 [
33 "resources/hyper-reality/br-jam-loop.wav", 34 "../resources/hyper-reality/br-jam-loop.wav",
34 ], 35 ],
35 finishedLoading 36 finishedLoading
36 ); 37 );
37 38
38 bufferLoader.load(); 39 bufferLoader.load();
39 testRunner.waitUntilDone(); 40 testRunner.waitUntilDone();
40 } 41 }
41 42
42 function finishedLoading(bufferList) { 43 function finishedLoading(bufferList) {
43 var bufferSource = context.createBufferSource(); 44 var bufferSource = context.createBufferSource();
44 bufferSource.buffer = bufferList[0]; 45 bufferSource.buffer = bufferList[0];
45 46
46 bufferSource.connect(context.destination); 47 bufferSource.connect(context.destination);
47 bufferSource.start(0); 48 bufferSource.start(0);
48 49
49 context.oncomplete = finishAudioTest; 50 context.oncomplete = finishAudioTest;
50 context.startRendering(); 51 context.startRendering();
51 } 52 }
52 53
53 </script> 54 </script>
54 </head> 55 </head>
55 <body> 56 <body>
56 </body> 57 </body>
57 </html> 58 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698