ConvolverNode setBuffer() should not ASSERT on null buffer
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 May 2012 22:15:03 +0000 (22:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 May 2012 22:15:03 +0000 (22:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=85653

Patch by Raymond Toy <rtoy@google.com> on 2012-05-07
Reviewed by Chris Rogers.

Source/WebCore:

Test: webaudio/convolver-setBuffer-null.html

* Modules/webaudio/ConvolverNode.cpp:
(WebCore::ConvolverNode::setBuffer):  Don't ASSERT on null buffer.

LayoutTests:

* webaudio/convolver-setBuffer-null-expected.txt: Added.
* webaudio/convolver-setBuffer-null.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116358 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/webaudio/convolver-setBuffer-null-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/convolver-setBuffer-null.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/ConvolverNode.cpp

index fe37c36..eff4d18 100644 (file)
@@ -1,3 +1,13 @@
+2012-05-07  Raymond Toy  <rtoy@google.com>
+
+        ConvolverNode setBuffer() should not ASSERT on null buffer
+        https://bugs.webkit.org/show_bug.cgi?id=85653
+
+        Reviewed by Chris Rogers.
+
+        * webaudio/convolver-setBuffer-null-expected.txt: Added.
+        * webaudio/convolver-setBuffer-null.html: Added.
+
 2012-05-07  Ken Buchanan  <kenrb@chromium.org>
 
         Crash due to positioned object list not being cleared during block flow split
diff --git a/LayoutTests/webaudio/convolver-setBuffer-null-expected.txt b/LayoutTests/webaudio/convolver-setBuffer-null-expected.txt
new file mode 100644 (file)
index 0000000..62c8d7b
--- /dev/null
@@ -0,0 +1,9 @@
+Tests that ConvolverNode impulse response buffer can be set to 0.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS ConvolverNode impulse response buffer was set to 0.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/webaudio/convolver-setBuffer-null.html b/LayoutTests/webaudio/convolver-setBuffer-null.html
new file mode 100644 (file)
index 0000000..a042767
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/>
+<script src="resources/audio-testing.js"></script>
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+description("Tests that ConvolverNode impulse response buffer can be set to 0.");
+
+function runTest()
+{
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+
+    window.jsTestIsAsync = true;
+
+    var context = new webkitAudioContext();
+    var conv = context.createConvolver();
+
+    conv.buffer = 0;
+    testPassed("ConvolverNode impulse response buffer was set to 0.");
+
+    finishJSTest();
+}
+
+runTest();
+successfullyParsed = true;
+</script>
+
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index 3fb57b6..dac5bee 100644 (file)
@@ -1,3 +1,15 @@
+2012-05-07  Raymond Toy  <rtoy@google.com>
+
+        ConvolverNode setBuffer() should not ASSERT on null buffer
+        https://bugs.webkit.org/show_bug.cgi?id=85653
+
+        Reviewed by Chris Rogers.
+
+        Test: webaudio/convolver-setBuffer-null.html
+
+        * Modules/webaudio/ConvolverNode.cpp:
+        (WebCore::ConvolverNode::setBuffer):  Don't ASSERT on null buffer.
+
 2012-05-07  Ken Buchanan  <kenrb@chromium.org>
 
         Crash due to positioned object list not being cleared during block flow split
index f263e27..c8010d0 100644 (file)
@@ -113,7 +113,6 @@ void ConvolverNode::setBuffer(AudioBuffer* buffer)
 {
     ASSERT(isMainThread());
     
-    ASSERT(buffer);
     if (!buffer)
         return;