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

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

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

Powered by Google App Engine
This is Rietveld 408576698