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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/constructor/audiobuffer.html

Issue 2397793002: AudioBuffer numberOfChannels defaults to 1 (Closed)
Patch Set: Rebase Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/constructor/audiobuffer.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/audiobuffer.html b/third_party/WebKit/LayoutTests/webaudio/constructor/audiobuffer.html
index 7e745f5dc299ae4bacddae97701a33253a0b9bee..dbefb4d2f11c2d69aa4ebd3bbd837cb8496fcffb 100644
--- a/third_party/WebKit/LayoutTests/webaudio/constructor/audiobuffer.html
+++ b/third_party/WebKit/LayoutTests/webaudio/constructor/audiobuffer.html
@@ -46,31 +46,40 @@
audit.defineTask("required options", function (taskDone) {
var success = true;
- success = Should("new AudioBuffer(context, {})", function () {
+ var buffer;
+
+ // The length attribute is required; all others are optional.
+ success = Should("buffer = new AudioBuffer(context, {})", function () {
var buffer = new AudioBuffer(context, {});
- }).throw("NotFoundError");
+ }).throw("TypeError");
- success = Should("new AudioBuffer(context, {numberOfChannels: 1}",
+ success = Should("buffer = new AudioBuffer(context, {numberOfChannels: 1}",
function () {
- var buffer = new AudioBuffer(context, {
+ buffer = new AudioBuffer(context, {
numberOfChannels: 1
});
- }).throw("NotFoundError") && success;
+ }).throw("TypeError") && success;
- // The sampleRate isn't required, but numberOfChannels and length are.
+ // Length is required, but others are optional.
success = Should(
- "new AudioBuffer(context, {numberOfChannels: 1, length: 1}",
+ "buffer = new AudioBuffer(context, {length: 21}",
function () {
- var buffer = new AudioBuffer(context, {
- numberOfChannels: 1,
- length: 1
+ buffer = new AudioBuffer(context, {
+ length: 21
});
}).notThrow() && success;
+ // Verify the buffer has the correct values.
+ success = Should("buffer.numberOfChannels", buffer.numberOfChannels)
+ .beEqualTo(1) && success;
+ success = Should("buffer.length", buffer.length)
+ .beEqualTo(21) && success;
+ success = Should("buffer.sampleRate", buffer.sampleRate)
+ .beEqualTo(context.sampleRate) && success;
success = Should(
- "new AudioBuffer(context, {numberOfChannels: 1, length: 1, sampleRate: 48000}",
+ "buffer = new AudioBuffer(context, {numberOfChannels: 1, length: 1, sampleRate: 48000}",
function () {
- var buffer = new AudioBuffer(context, {
+ buffer = new AudioBuffer(context, {
numberOfChannels: 1,
length: 1,
sampleRate: 48000
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698