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

Side by Side Diff: LayoutTests/webaudio/resources/audio-codec-test.js

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 var defaultSampleRate = 44100.0; 1 var defaultSampleRate = 44100.0;
2 var lengthInSeconds = 1; 2 var lengthInSeconds = 1;
3 3
4 var context = 0; 4 var context = 0;
5 var bufferLoader = 0; 5 var bufferLoader = 0;
6 6
7 // Run test by loading the file specified by |url|. An optional sample rate can be given to 7 // Run test by loading the file specified by |url|. An optional sample rate can be given to
8 // select a context with a different sample rate. The default value is |default SampleRate|. 8 // select a context with a different sample rate. The default value is |default SampleRate|.
9 function runDecodingTest(url, optionalSampleRate) 9 function runDecodingTest(url, optionalSampleRate)
10 { 10 {
11 if (!window.testRunner) 11 if (!window.testRunner)
12 return; 12 return;
13 13
14 var sampleRate = (typeof optionalSampleRate === "undefined") ? defaultSample Rate : optionalSampleRate; 14 var sampleRate = (typeof optionalSampleRate === "undefined") ? defaultSample Rate : optionalSampleRate;
15 15
16 // Create offline audio context. 16 // Create offline audio context.
17 context = new webkitOfflineAudioContext(1, sampleRate * lengthInSeconds, sam pleRate); 17 context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRat e);
18 18
19 bufferLoader = new BufferLoader( 19 bufferLoader = new BufferLoader(
20 context, 20 context,
21 [ url ], 21 [ url ],
22 finishedLoading 22 finishedLoading
23 ); 23 );
24 24
25 bufferLoader.load(); 25 bufferLoader.load();
26 testRunner.waitUntilDone(); 26 testRunner.waitUntilDone();
27 } 27 }
28 28
29 function finishedLoading(bufferList) 29 function finishedLoading(bufferList)
30 { 30 {
31 testRunner.setAudioData(createAudioData(bufferList[0])); 31 testRunner.setAudioData(createAudioData(bufferList[0]));
32 testRunner.notifyDone(); 32 testRunner.notifyDone();
33 } 33 }
34 34
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/realtimeanalyser-float-data.html ('k') | LayoutTests/webaudio/resources/audioparam-testing.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698