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

Side by Side Diff: LayoutTests/webaudio/gain.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 Tests that GainNode is properly scaling the gain. 4 Tests that GainNode is properly scaling the gain.
5 We'll render 11 notes, starting at a gain of 1.0, decreasing in gain by 0.1. 5 We'll render 11 notes, starting at a gain of 1.0, decreasing in gain by 0.1.
6 The 11th note will be of gain 0.0, so it should be silent (at the end in the ren dered output). 6 The 11th note will be of gain 0.0, so it should be silent (at the end in the ren dered output).
7 --> 7 -->
8 8
9 <html> 9 <html>
10 <head> 10 <head>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 gainNode.connect(context.destination); 52 gainNode.connect(context.destination);
53 53
54 source.start(time); 54 source.start(time);
55 } 55 }
56 56
57 function init() { 57 function init() {
58 if (!window.testRunner) 58 if (!window.testRunner)
59 return; 59 return;
60 60
61 // Create offline audio context. 61 // Create offline audio context.
62 context = new webkitOfflineAudioContext(2, sampleRate * lengthInSeconds, sam pleRate); 62 context = new OfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRat e);
63 63
64 // Create a buffer for a short "note". 64 // Create a buffer for a short "note".
65 sinWaveBuffer = createSinWaveBuffer(bufferDurationSeconds, 880.0); 65 sinWaveBuffer = createSinWaveBuffer(bufferDurationSeconds, 880.0);
66 66
67 // Render 11 notes, starting at a gain of 1.0, decreasing in gain by 0.1. 67 // Render 11 notes, starting at a gain of 1.0, decreasing in gain by 0.1.
68 // The last note will be of gain 0.0, so shouldn't be perceptible in the ren dered output. 68 // The last note will be of gain 0.0, so shouldn't be perceptible in the ren dered output.
69 for (var i = 0; i < numberOfNotes; ++i) { 69 for (var i = 0; i < numberOfNotes; ++i) {
70 var time = i * noteSpacing; 70 var time = i * noteSpacing;
71 var gain = 1.0 - i / (numberOfNotes - 1); 71 var gain = 1.0 - i / (numberOfNotes - 1);
72 playNote(time, gain); 72 playNote(time, gain);
73 } 73 }
74 74
75 context.oncomplete = finishAudioTest; 75 context.oncomplete = finishAudioTest;
76 context.startRendering(); 76 context.startRendering();
77 77
78 testRunner.waitUntilDone(); 78 testRunner.waitUntilDone();
79 } 79 }
80 80
81 </script> 81 </script>
82 82
83 </body> 83 </body>
84 </html> 84 </html>
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/dynamicscompressor-simple.html ('k') | LayoutTests/webaudio/gain-basic.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698