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

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

Issue 825603005: AudioBufferSourceNode.buffer can only be set once. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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 type="text/javascript" src="resources/audio-testing.js"></script> 6 <script type="text/javascript" src="resources/audio-testing.js"></script>
7 <script src="resources/compatibility.js"></script> 7 <script src="resources/compatibility.js"></script>
8 </head> 8 </head>
9 9
10 <body> 10 <body>
(...skipping 17 matching lines...) Expand all
28 context = new AudioContext(); 28 context = new AudioContext();
29 source = context.createBufferSource(); 29 source = context.createBufferSource();
30 30
31 // Make sure we can't set to something which isn't an AudioBuffer. 31 // Make sure we can't set to something which isn't an AudioBuffer.
32 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 = 57", '"TypeError: Failed to set the \'buffer\' property on \'AudioBufferSourceNode\': The provided value is not of type \'Audio Buffer\'."');
33 shouldThrow("source.buffer = null", '"TypeError: Failed to set the \'buffer\ ' property on \'AudioBufferSourceNode\': The provided value is not of type \'Aud ioBuffer\'."'); 33 shouldThrow("source.buffer = null", '"TypeError: Failed to set the \'buffer\ ' property on \'AudioBufferSourceNode\': The provided value is not of type \'Aud ioBuffer\'."');
34 34
35 // Check that mono buffer can be set. 35 // Check that mono buffer can be set.
36 try { 36 try {
37 var monoBuffer = context.createBuffer(1, 1024, context.sampleRate); 37 var monoBuffer = context.createBuffer(1, 1024, context.sampleRate);
38 source = context.createBufferSource();
hongchan 2015/01/16 23:42:09 This is something I am not comfortable with. Even
Raymond Toy 2015/01/17 00:03:16 The global source is needed for the shouldThrow()
Raymond Toy 2015/01/20 18:06:00 Done.
38 source.buffer = monoBuffer; 39 source.buffer = monoBuffer;
39 testPassed("Mono buffer can be set."); 40 testPassed("Mono buffer can be set.");
40 } catch(e) { 41 } catch(e) {
41 testFailed("Mono buffer can not be set."); 42 testFailed("Mono buffer can not be set.");
42 } 43 }
43 44
44 // Check that stereo buffer can be set. 45 // Check that stereo buffer can be set.
45 try { 46 try {
46 var stereoBuffer = context.createBuffer(2, 1024, context.sampleRate); 47 var stereoBuffer = context.createBuffer(2, 1024, context.sampleRate);
48 source = context.createBufferSource();
47 source.buffer = stereoBuffer; 49 source.buffer = stereoBuffer;
48 testPassed("Stereo buffer can be set."); 50 testPassed("Stereo buffer can be set.");
49 } catch(e) { 51 } catch(e) {
50 testFailed("Stereo buffer can not be set."); 52 testFailed("Stereo buffer can not be set.");
51 } 53 }
52 54
53 // Check buffers with more than two channels. 55 // Check buffers with more than two channels.
54 for (var i = 3; i < 10; ++i) { 56 for (var i = 3; i < 10; ++i) {
55 try { 57 try {
56 var buffer = context.createBuffer(i, 1024, context.sampleRate); 58 var buffer = context.createBuffer(i, 1024, context.sampleRate);
59 source = context.createBufferSource();
57 source.buffer = buffer; 60 source.buffer = buffer;
58 var message = i + " channels buffer can be set."; 61 var message = i + " channels buffer can be set.";
59 testPassed(message); 62 testPassed(message);
60 } catch(e) { 63 } catch(e) {
61 var message = i + " channels buffer can not be set."; 64 var message = i + " channels buffer can not be set.";
62 testFailed(message); 65 testFailed(message);
63 } 66 }
64 } 67 }
65 68
66 finishJSTest(); 69 finishJSTest();
67 } 70 }
68 71
69 runTest(); 72 runTest();
70 73
71 </script> 74 </script>
72 75
73 </body> 76 </body>
74 </html> 77 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/webaudio/dom-exceptions.html » ('j') | LayoutTests/webaudio/dom-exceptions-expected.txt » ('J')

Powered by Google App Engine
This is Rietveld 408576698