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

Side by Side Diff: LayoutTests/webaudio/test-basic.html

Issue 208943004: Update WebAudio layout tests to use unprefixed AudioContext. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add console.log to compatibility.js Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <!-- 3 <!--
4 This is a very basic test to make sure testRunner.setAudioData() works correctly . 4 This is a very basic test to make sure testRunner.setAudioData() works correctly .
5 It generates a 2 seconds long stereo result @44.1KHz 5 It generates a 2 seconds long stereo result @44.1KHz
6 The left channel will be a 880Hz tone, while the right will be 440Hz. 6 The left channel will be a 880Hz tone, while the right will be 440Hz.
7 --> 7 -->
8 8
9 <html> 9 <html>
10 <head> 10 <head>
(...skipping 21 matching lines...) Expand all
32 for (var i = 0; i < n; ++i) { 32 for (var i = 0; i < n; ++i) {
33 channelL[i] = Math.sin(880.0 * 2.0*Math.PI * i / sampleRate); 33 channelL[i] = Math.sin(880.0 * 2.0*Math.PI * i / sampleRate);
34 channelR[i] = Math.sin(440.0 * 2.0*Math.PI * i / sampleRate); 34 channelR[i] = Math.sin(440.0 * 2.0*Math.PI * i / sampleRate);
35 } 35 }
36 } 36 }
37 37
38 function runTest() { 38 function runTest() {
39 if (!window.testRunner) 39 if (!window.testRunner)
40 return; 40 return;
41 41
42 var context = new webkitAudioContext(); 42 var context = new AudioContext();
43 var audioBuffer = context.createBuffer(2, lengthInSeconds * sampleRate, samp leRate); 43 var audioBuffer = context.createBuffer(2, lengthInSeconds * sampleRate, samp leRate);
44 44
45 generateSinWave(audioBuffer); 45 generateSinWave(audioBuffer);
46 46
47 var audioData = createAudioData(audioBuffer); 47 var audioData = createAudioData(audioBuffer);
48 testRunner.setAudioData(audioData); 48 testRunner.setAudioData(audioData);
49 49
50 testRunner.notifyDone(); 50 testRunner.notifyDone();
51 } 51 }
52 52
53 runTest(); 53 runTest();
54 54
55 </script> 55 </script>
56 56
57 57
58 <body> 58 <body>
59 </body> 59 </body>
60 </html> 60 </html>
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/stereo2mono-down-mixing.html ('k') | LayoutTests/webaudio/up-mixing-mono-51.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698