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

Side by Side Diff: LayoutTests/webaudio/resources/scriptprocessornode-testing.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 // For the current implementation of JavaScriptAudioNode, when it works with Off lineAudioContext (which runs much faster 1 // For the current implementation of JavaScriptAudioNode, when it works with Off lineAudioContext (which runs much faster
2 // than real-time) the event.inputBuffer might be overwrite again before onaudio process ever get chance to be called. 2 // than real-time) the event.inputBuffer might be overwrite again before onaudio process ever get chance to be called.
3 // We carefully arrange the renderLengthInFrames and bufferSize to have exactly the same value to avoid this issue. 3 // We carefully arrange the renderLengthInFrames and bufferSize to have exactly the same value to avoid this issue.
4 var renderLengthInFrames = 512; 4 var renderLengthInFrames = 512;
5 var bufferSize = 512; 5 var bufferSize = 512;
6 6
7 var context; 7 var context;
8 8
9 function createBuffer(context, numberOfChannels, length) { 9 function createBuffer(context, numberOfChannels, length) {
10 var audioBuffer = context.createBuffer(numberOfChannels, length, sampleRate) ; 10 var audioBuffer = context.createBuffer(numberOfChannels, length, sampleRate) ;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return false; 58 return false;
59 } 59 }
60 } 60 }
61 } 61 }
62 return true; 62 return true;
63 } 63 }
64 64
65 function runJSNodeTest() 65 function runJSNodeTest()
66 { 66 {
67 // Create offline audio context. 67 // Create offline audio context.
68 context = new webkitOfflineAudioContext(2, renderLengthInFrames, sampleRate) ; 68 context = new OfflineAudioContext(2, renderLengthInFrames, sampleRate);
69 69
70 var sourceBuffer = createBuffer(context, sourceChannels, renderLengthInFrame s); 70 var sourceBuffer = createBuffer(context, sourceChannels, renderLengthInFrame s);
71 71
72 var bufferSource = context.createBufferSource(); 72 var bufferSource = context.createBufferSource();
73 bufferSource.buffer = sourceBuffer; 73 bufferSource.buffer = sourceBuffer;
74 74
75 var scriptNode = context.createScriptProcessor(bufferSize, inputChannels, ou tputChannels); 75 var scriptNode = context.createScriptProcessor(bufferSize, inputChannels, ou tputChannels);
76 76
77 bufferSource.connect(scriptNode); 77 bufferSource.connect(scriptNode);
78 scriptNode.connect(context.destination); 78 scriptNode.connect(context.destination);
79 scriptNode.onaudioprocess = processAudioData; 79 scriptNode.onaudioprocess = processAudioData;
80 80
81 bufferSource.start(0); 81 bufferSource.start(0);
82 context.oncomplete = finishJSTest; 82 context.oncomplete = finishJSTest;
83 context.startRendering(); 83 context.startRendering();
84 } 84 }
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/resources/oscillator-testing.js ('k') | LayoutTests/webaudio/resources/waveshaper-testing.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698