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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/constructor/convolver.html

Issue 2348373002: AudioBufferSourceOptions.buffer should be nullable. (Closed)
Patch Set: Created 4 years, 3 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 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test Constructor: Convolver</title> 4 <title>Test Constructor: Convolver</title>
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/audio-testing.js"></script> 7 <script src="../resources/audio-testing.js"></script>
8 <script src="audionodeoptions.js"></script> 8 <script src="audionodeoptions.js"></script>
9 </head> 9 </head>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 "did not construct correct node correctly") 67 "did not construct correct node correctly")
68 68
69 taskDone(); 69 taskDone();
70 }); 70 });
71 71
72 audit.defineTask("test AudioNodeOptions", function (taskDone) { 72 audit.defineTask("test AudioNodeOptions", function (taskDone) {
73 testAudioNodeOptions(context, "ConvolverNode"); 73 testAudioNodeOptions(context, "ConvolverNode");
74 taskDone(); 74 taskDone();
75 }); 75 });
76 76
77 audit.defineTask("nullable buffer", function (taskDone) {
78 var node;
79 var success = true;
80
81 var options = { buffer: null };
82
83 success = Should("node = new ConvolverNode(c, " + JSON.stringify(options ), function () {
84 node = new ConvolverNode(context, options);
85 }).notThrow();
86
87 success = Should("node.buffer", node.buffer)
88 .beEqualTo(null);
89
90 Should("Null buffer in constructor handled", success)
91 .summarize(
92 "correctly",
93 "incorrectly");
94
95 taskDone();
96 });
97
77 audit.defineTask("construct with options", function (taskDone) { 98 audit.defineTask("construct with options", function (taskDone) {
78 var buf = context.createBuffer(1, 1, context.sampleRate); 99 var buf = context.createBuffer(1, 1, context.sampleRate);
79 var options = { 100 var options = {
80 buffer: buf, 101 buffer: buf,
81 disableNormalization: false 102 disableNormalization: false
82 }; 103 };
83 104
84 var message = "node = new ConvolverNode(c, " + JSON.stringify(options) + ")"; 105 var message = "node = new ConvolverNode(c, " + JSON.stringify(options) + ")";
85 106
86 var node; 107 var node;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 "constructed with correct attributes", 144 "constructed with correct attributes",
124 "was not constructed correctly"); 145 "was not constructed correctly");
125 146
126 taskDone(); 147 taskDone();
127 }); 148 });
128 149
129 audit.runTasks(); 150 audit.runTasks();
130 </script> 151 </script>
131 </body> 152 </body>
132 </html> 153 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698