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

Side by Side Diff: LayoutTests/webaudio/audiobuffersource-channels.html

Issue 190953005: Support nullable buffer for AudioBufferSourceNode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « no previous file | LayoutTests/webaudio/audiobuffersource-channels-expected.txt » ('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/js-test.js"></script> 5 <script src="../resources/js-test.js"></script>
6 <script type="text/javascript" src="resources/audio-testing.js"></script> 6 <script type="text/javascript" src="resources/audio-testing.js"></script>
7 </head> 7 </head>
8 8
9 <body> 9 <body>
10 <div id="description"></div> 10 <div id="description"></div>
(...skipping 11 matching lines...) Expand all
22 testRunner.waitUntilDone(); 22 testRunner.waitUntilDone();
23 } 23 }
24 24
25 window.jsTestIsAsync = true; 25 window.jsTestIsAsync = true;
26 26
27 context = new webkitAudioContext(); 27 context = new webkitAudioContext();
28 source = context.createBufferSource(); 28 source = context.createBufferSource();
29 29
30 // Make sure we can't set to something which isn't an AudioBuffer. 30 // Make sure we can't set to something which isn't an AudioBuffer.
31 shouldThrow("source.buffer = 57", '"TypeError: Failed to set the \'buffer\' property on \'AudioBufferSourceNode\': The provided value is not of type \'Audio Buffer\'."'); 31 shouldThrow("source.buffer = 57", '"TypeError: Failed to set the \'buffer\' property on \'AudioBufferSourceNode\': The provided value is not of type \'Audio Buffer\'."');
32 shouldThrow("source.buffer = null", '"TypeError: Failed to set the \'buffer\ ' property on \'AudioBufferSourceNode\': buffer cannot be null"');
33 32
34 // Check that mono buffer can be set. 33 // Check that mono buffer can be set.
35 try { 34 try {
35 var nullableBuffer = null;
36 source.buffer = nullableBuffer;
37 if (source.buffer.numberOfChannels == 1)
38 testPassed("Nullable buffer can be set.");
39 else
40 testFailed("Nullable buffer must be mono.");
41 } catch(e) {
42 testFailed("Nullable buffer can not be set.");
43 }
44
45 // Check that mono buffer can be set.
46 try {
36 var monoBuffer = context.createBuffer(1, 1024, context.sampleRate); 47 var monoBuffer = context.createBuffer(1, 1024, context.sampleRate);
37 source.buffer = monoBuffer; 48 source.buffer = monoBuffer;
38 testPassed("Mono buffer can be set."); 49 testPassed("Mono buffer can be set.");
39 } catch(e) { 50 } catch(e) {
40 testFailed("Mono buffer can not be set."); 51 testFailed("Mono buffer can not be set.");
41 } 52 }
42 53
43 // Check that stereo buffer can be set. 54 // Check that stereo buffer can be set.
44 try { 55 try {
45 var stereoBuffer = context.createBuffer(2, 1024, context.sampleRate); 56 var stereoBuffer = context.createBuffer(2, 1024, context.sampleRate);
(...skipping 18 matching lines...) Expand all
64 75
65 finishJSTest(); 76 finishJSTest();
66 } 77 }
67 78
68 runTest(); 79 runTest();
69 80
70 </script> 81 </script>
71 82
72 </body> 83 </body>
73 </html> 84 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/webaudio/audiobuffersource-channels-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698