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

Side by Side Diff: LayoutTests/webaudio/audionode-connect-order.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 src="resources/audio-testing.js"></script> 7 <script src="resources/audio-testing.js"></script>
7 </head> 8 </head>
8 9
9 <body> 10 <body>
10 11
11 <div id="description"></div> 12 <div id="description"></div>
12 <div id="console"></div> 13 <div id="console"></div>
13 14
14 <script> 15 <script>
15 description("This tests that we don't trigger an assertion failure due to AudioN ode connection order."); 16 description("This tests that we don't trigger an assertion failure due to AudioN ode connection order.");
(...skipping 17 matching lines...) Expand all
33 34
34 function runTest() { 35 function runTest() {
35 if (window.testRunner) { 36 if (window.testRunner) {
36 testRunner.dumpAsText(); 37 testRunner.dumpAsText();
37 testRunner.waitUntilDone(); 38 testRunner.waitUntilDone();
38 } 39 }
39 40
40 window.jsTestIsAsync = true; 41 window.jsTestIsAsync = true;
41 42
42 // Create offline audio context. 43 // Create offline audio context.
43 var context = new webkitOfflineAudioContext(1, sampleRate * renderLengthSeco nds, sampleRate); 44 var context = new OfflineAudioContext(1, sampleRate * renderLengthSeconds, s ampleRate);
44 var toneBuffer = createSinWaveBuffer(context, renderLengthSeconds, 880); 45 var toneBuffer = createSinWaveBuffer(context, renderLengthSeconds, 880);
45 46
46 var bufferSource = context.createBufferSource(); 47 var bufferSource = context.createBufferSource();
47 bufferSource.buffer = toneBuffer; 48 bufferSource.buffer = toneBuffer;
48 bufferSource.connect(context.destination); 49 bufferSource.connect(context.destination);
49 50
50 var delay = context.createDelay(); 51 var delay = context.createDelay();
51 delay.delayTime.value = delayTimeSeconds; 52 delay.delayTime.value = delayTimeSeconds;
52 53
53 // We connect delay node to gain node before anything is connected to delay node itself. 54 // We connect delay node to gain node before anything is connected to delay node itself.
54 // We do this because we try to trigger the ASSERT which might be fired due to AudioNode connection order, 55 // We do this because we try to trigger the ASSERT which might be fired due to AudioNode connection order,
55 // especially when gain node and delay node is involved e.g. https://bugs.we bkit.org/show_bug.cgi?id=76685. 56 // especially when gain node and delay node is involved e.g. https://bugs.we bkit.org/show_bug.cgi?id=76685.
56 57
57 var gain = context.createGain(); 58 var gain = context.createGain();
58 gain.connect(context.destination); 59 gain.connect(context.destination);
59 delay.connect(gain); 60 delay.connect(gain);
60 61
61 bufferSource.start(0); 62 bufferSource.start(0);
62 63
63 context.oncomplete = finishJSTest; 64 context.oncomplete = finishJSTest;
64 context.startRendering(); 65 context.startRendering();
65 } 66 }
66 67
67 runTest(); 68 runTest();
68 69
69 </script> 70 </script>
70 71
71 </body> 72 </body>
72 </html> 73 </html>
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/audionode-channel-rules.html ('k') | LayoutTests/webaudio/audioparam-connect-audioratesignal.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698