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: third_party/WebKit/LayoutTests/webaudio/Delay/delaynode-maxdelay.html

Issue 2727663003: Move task.describe to audit.define arg (Closed)
Patch Set: Fix up expected results Created 3 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <html> 3 <html>
4 <head> 4 <head>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../resources/audit-util.js"></script> 7 <script src="../resources/audit-util.js"></script>
8 <script src="../resources/audit.js"></script> 8 <script src="../resources/audit.js"></script>
9 <script src="../resources/delay-testing.js"></script> 9 <script src="../resources/delay-testing.js"></script>
10 </head> 10 </head>
11 11
12 <body> 12 <body>
13 <script> 13 <script>
14 let audit = Audit.createTaskRunner(); 14 let audit = Audit.createTaskRunner();
15 15
16 audit.define("test", function (task, should) { 16 audit.define(
17 task.describe( 17 {
18 "Basic functionality of DelayNode with a non-default max delay time") 18 label: 'test',
19 19 description:
20 // Create offline audio context. 20 'Basic functionality of DelayNode with a non-default max delay time'
21 var context = new OfflineAudioContext(1, sampleRate * renderLengthSeconds, s ampleRate); 21 },
22 var toneBuffer = createToneBuffer(context, 20, 20 * toneLengthSeconds, sampl eRate); // 20Hz tone 22 function(task, should) {
23
24 var bufferSource = context.createBufferSource();
25 bufferSource.buffer = toneBuffer;
26 23
27 // Create a delay node with an explicit max delay time (greater than the def ault of 1 second). 24 // Create offline audio context.
28 var delay = context.createDelay(2); 25 var context = new OfflineAudioContext(
29 // Set the delay time to a value greater than the default max delay so we ca n verify the delay 26 1, sampleRate * renderLengthSeconds, sampleRate);
30 // is working for this case. 27 var toneBuffer = createToneBuffer(
31 delayTimeSeconds = 1.5; 28 context, 20, 20 * toneLengthSeconds, sampleRate); // 20Hz tone
32 delay.delayTime.value = delayTimeSeconds;
33 29
34 bufferSource.connect(delay); 30 var bufferSource = context.createBufferSource();
35 delay.connect(context.destination); 31 bufferSource.buffer = toneBuffer;
36 bufferSource.start(0); 32
37 33 // Create a delay node with an explicit max delay time (greater than the
38 context.startRendering() 34 // default of 1 second).
39 .then(buffer => checkDelayedResult(buffer, toneBuffer, should)) 35 var delay = context.createDelay(2);
40 .then(() => task.done()); 36 // Set the delay time to a value greater than the default max delay so we
41 }); 37 // can verify the delay is working for this case.
38 delayTimeSeconds = 1.5;
39 delay.delayTime.value = delayTimeSeconds;
40
41 bufferSource.connect(delay);
42 delay.connect(context.destination);
43 bufferSource.start(0);
44
45 context.startRendering()
46 .then(buffer => checkDelayedResult(buffer, toneBuffer, should))
47 .then(() => task.done());
48 });
42 49
43 audit.run(); 50 audit.run();
44 </script> 51 </script>
45 52
46 </body> 53 </body>
47 </html> 54 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698