Title: [123306] trunk/LayoutTests
- Revision
- 123306
- Author
- [email protected]
- Date
- 2012-07-22 19:11:54 -0700 (Sun, 22 Jul 2012)
Log Message
Improve BiquadFilterNode test case
https://bugs.webkit.org/show_bug.cgi?id=90937
Patch by Li Yin <[email protected]> on 2012-07-22
Reviewed by Kentaro Hara.
Spec: http://www.w3.org/TR/webaudio/#BiquadFilterNode
Improve BiquadFilterNode test to cover constant value and number of inputs and outputs.
* webaudio/biquadfilternode-basic-expected.txt:
* webaudio/biquadfilternode-basic.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (123305 => 123306)
--- trunk/LayoutTests/ChangeLog 2012-07-23 01:27:37 UTC (rev 123305)
+++ trunk/LayoutTests/ChangeLog 2012-07-23 02:11:54 UTC (rev 123306)
@@ -1,3 +1,16 @@
+2012-07-22 Li Yin <[email protected]>
+
+ Improve BiquadFilterNode test case
+ https://bugs.webkit.org/show_bug.cgi?id=90937
+
+ Reviewed by Kentaro Hara.
+
+ Spec: http://www.w3.org/TR/webaudio/#BiquadFilterNode
+ Improve BiquadFilterNode test to cover constant value and number of inputs and outputs.
+
+ * webaudio/biquadfilternode-basic-expected.txt:
+ * webaudio/biquadfilternode-basic.html:
+
2012-07-22 Yoshifumi Inoue <[email protected]>
[Tests] Rename fast/forms/number/*.html to number-*.html
Modified: trunk/LayoutTests/webaudio/biquadfilternode-basic-expected.txt (123305 => 123306)
--- trunk/LayoutTests/webaudio/biquadfilternode-basic-expected.txt 2012-07-23 01:27:37 UTC (rev 123305)
+++ trunk/LayoutTests/webaudio/biquadfilternode-basic-expected.txt 2012-07-23 02:11:54 UTC (rev 123306)
@@ -2,6 +2,8 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+PASS BiquadFilterNode has one iutput.
+PASS BiquadFilterNode has one output.
PASS Biquad filter defaults to low-pass filter.
PASS Biquad filter type 0 is settable.
PASS Biquad filter type 1 is settable.
Modified: trunk/LayoutTests/webaudio/biquadfilternode-basic.html (123305 => 123306)
--- trunk/LayoutTests/webaudio/biquadfilternode-basic.html 2012-07-23 01:27:37 UTC (rev 123305)
+++ trunk/LayoutTests/webaudio/biquadfilternode-basic.html 2012-07-23 02:11:54 UTC (rev 123306)
@@ -1,5 +1,4 @@
<!DOCTYPE html>
-
<html>
<head>
<script src=""
@@ -25,22 +24,36 @@
context = new webkitAudioContext();
var filter = context.createBiquadFilter();
+
+ if (filter.numberOfInputs === 1)
+ testPassed("BiquadFilterNode has one iutput.");
+ else
+ testFailed("BiquadFilterNode should have one iutput.");
- // FIXME: we need to expose the actual filter type constants in the IDL
+ if (filter.numberOfOutputs === 1)
+ testPassed("BiquadFilterNode has one output.");
+ else
+ testFailed("BiquadFilterNode should have one output.");
- // Check the filter type.
- if (filter.type == 0)
+ if (filter.type === filter.LOWPASS)
testPassed("Biquad filter defaults to low-pass filter.");
else
testFailed("Biquad filter should default to low-pass filter.");
// Check that all legal filter types can be set.
- // FIXME: use last defined filter constant (ALLPASS) instead of hard-coded 7 once it's defined in the IDL.
- for (var i = 0; i <= 7; ++i) {
+ var filterTypeArray = [filter.LOWPASS,
+ filter.HIGHPASS,
+ filter.BANDPASS,
+ filter.LOWSHELF,
+ filter.HIGHSHELF,
+ filter.PEAKING,
+ filter.NOTCH,
+ filter.ALLPASS];
+
+ for (var i = 0; i < filterTypeArray.length; ++i) {
try {
- filter.type = i;
-
- if (filter.type == i) {
+ filter.type = filterTypeArray[i];
+ if (filter.type === filterTypeArray[i] && filterTypeArray[i] === i) {
var message = "Biquad filter type " + i + " is settable.";
testPassed(message);
} else {
@@ -55,7 +68,7 @@
// Check that illegal filter type throws.
try {
- filter.type = 8;
+ filter.type = filter.ALLPASS + 1;
testFailed("Illegal filter type should throw exception.");
} catch(e) {
testPassed("Illegal filter type correctly throws exception.");
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes