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

Side by Side Diff: LayoutTests/webaudio/waveshaper.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 <html> 3 <html>
4 <head> 4 <head>
5 <script src="../resources/js-test.js"></script> 5 <script src="../resources/js-test.js"></script>
6 <script src="resources/compatibility.js"></script>
6 <script type="text/javascript" src="resources/audio-testing.js"></script> 7 <script type="text/javascript" src="resources/audio-testing.js"></script>
7 <script type="text/javascript" src="resources/buffer-loader.js"></script> 8 <script type="text/javascript" src="resources/buffer-loader.js"></script>
8 </head> 9 </head>
9 10
10 <body> 11 <body>
11 12
12 <div id="description"></div> 13 <div id="description"></div>
13 <div id="console"></div> 14 <div id="console"></div>
14 15
15 <script> 16 <script>
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 101
101 function runTest() { 102 function runTest() {
102 if (window.testRunner) { 103 if (window.testRunner) {
103 testRunner.dumpAsText(); 104 testRunner.dumpAsText();
104 testRunner.waitUntilDone(); 105 testRunner.waitUntilDone();
105 } 106 }
106 107
107 window.jsTestIsAsync = true; 108 window.jsTestIsAsync = true;
108 109
109 // Create offline audio context. 110 // Create offline audio context.
110 context = new webkitOfflineAudioContext(1, numberOfRenderFrames, sampleRate) ; 111 context = new OfflineAudioContext(1, numberOfRenderFrames, sampleRate);
111 112
112 // source -> waveshaper -> destination 113 // source -> waveshaper -> destination
113 var source = context.createBufferSource(); 114 var source = context.createBufferSource();
114 var waveshaper = context.createWaveShaper(); 115 var waveshaper = context.createWaveShaper();
115 source.connect(waveshaper); 116 source.connect(waveshaper);
116 waveshaper.connect(context.destination); 117 waveshaper.connect(context.destination);
117 118
118 // Create an input test vector. 119 // Create an input test vector.
119 inputBuffer = generateInputBuffer(); 120 inputBuffer = generateInputBuffer();
120 source.buffer = inputBuffer; 121 source.buffer = inputBuffer;
121 122
122 // We'll apply non-linear distortion according to this shaping curve. 123 // We'll apply non-linear distortion according to this shaping curve.
123 waveShapingCurve = generateWaveShapingCurve(); 124 waveShapingCurve = generateWaveShapingCurve();
124 waveshaper.curve = waveShapingCurve; 125 waveshaper.curve = waveShapingCurve;
125 126
126 source.start(0); 127 source.start(0);
127 128
128 context.oncomplete = checkShapedCurve; 129 context.oncomplete = checkShapedCurve;
129 context.startRendering(); 130 context.startRendering();
130 } 131 }
131 132
132 runTest(); 133 runTest();
133 134
134 </script> 135 </script>
135 136
136 </body> 137 </body>
137 </html> 138 </html>
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/up-mixing-stereo-51.html ('k') | LayoutTests/webaudio/waveshaper-oversample-2x.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698