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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-channels.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-max-contexts.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 </head> 9 </head>
10 10
11 <body> 11 <body>
12 <script> 12 <script>
13 let audit = Audit.createTaskRunner(); 13 let audit = Audit.createTaskRunner();
14 let context; 14 let context;
15 let source; 15 let source;
16 16
17 audit.define("validate .buffer", 17 audit.define(
18 function(task, should) { 18 {
19 task.describe( 19 label: 'validate .buffer',
20 "AudioBufferSourceNode validates AudioBuffer in .buffer attribute setter" 20 description: 'Validatation of AudioBuffer in .buffer attribute setter'
21 ); 21 },
22 context = new AudioContext(); 22 function(task, should) {
23 source = context.createBufferSource(); 23 context = new AudioContext();
24 source = context.createBufferSource();
24 25
25 // Make sure we can't set to something which isn't an AudioBuffer. 26 // Make sure we can't set to something which isn't an AudioBuffer.
26 should(function() { 27 should(function() {
27 source.buffer = 57; 28 source.buffer = 57;
28 }, "source.buffer = 57") 29 }, 'source.buffer = 57').throw('TypeError');
29 .throw("TypeError");
30 30
31 should(function() { 31 should(function() {
32 source.buffer = null; 32 source.buffer = null;
33 }, "source.buffer = null") 33 }, 'source.buffer = null').throw('TypeError');
34 .throw("TypeError");
35 34
36 // Check that mono buffer can be set. 35 // Check that mono buffer can be set.
37 should(function() { 36 should(function() {
38 let monoBuffer = context.createBuffer(1, 1024, context.sampleRate); 37 let monoBuffer = context.createBuffer(1, 1024, context.sampleRate);
39 let testSource = context.createBufferSource(); 38 let testSource = context.createBufferSource();
40 testSource.buffer = monoBuffer; 39 testSource.buffer = monoBuffer;
41 }, "Setting source with mono buffer") 40 }, 'Setting source with mono buffer').notThrow();
42 .notThrow();
43 41
44 // Check that stereo buffer can be set. 42 // Check that stereo buffer can be set.
45 should(function() { 43 should(function() {
46 let stereoBuffer = context.createBuffer(2, 1024, context.sampleRate); 44 let stereoBuffer = context.createBuffer(2, 1024, context.sampleRate);
47 let testSource = context.createBufferSource(); 45 let testSource = context.createBufferSource();
48 testSource.buffer = stereoBuffer; 46 testSource.buffer = stereoBuffer;
49 }, "Setting source with stereo buffer") 47 }, 'Setting source with stereo buffer').notThrow();
50 .notThrow();
51 48
52 // Check buffers with more than two channels. 49 // Check buffers with more than two channels.
53 for (let i = 3; i < 10; ++i) { 50 for (let i = 3; i < 10; ++i) {
54 should(function() { 51 should(function() {
55 let buffer = context.createBuffer(i, 1024, context.sampleRate); 52 let buffer = context.createBuffer(i, 1024, context.sampleRate);
56 let testSource = context.createBufferSource(); 53 let testSource = context.createBufferSource();
57 testSource.buffer = buffer; 54 testSource.buffer = buffer;
58 }, "Setting source with " + i + " channels buffer") 55 }, 'Setting source with ' + i + ' channels buffer').notThrow();
59 .notThrow(); 56 }
60 } 57 task.done();
61 task.done(); 58 });
62 });
63 59
64 audit.run(); 60 audit.run();
65 61
66 </script> 62 </script>
67 63
68 </body> 64 </body>
69 </html> 65 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-max-contexts.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698