From b584b99991bbc23a7ad73c70466fd64e47a1b75b Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Thu, 5 Jul 2012 03:30:32 +0000 Subject: [PATCH] AudioNode test should cover numberOfInputs and numberOfOutputs of AudioDestinationNode https://bugs.webkit.org/show_bug.cgi?id=90578 Patch by Li Yin on 2012-07-04 Reviewed by Chris Rogers. Spec: http://www.w3.org/TR/webaudio/#AudioDestinationNode-section An AudioSourceNode has no inputs and a single output. An AudioDestinationNode has one input and no outputs. Currently, the test webaudio/audionode.html has covered AudioSourceNode, it is still required to cover AudioDestinationNode. * webaudio/audionode-expected.txt: * webaudio/audionode.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121877 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 16 ++++++++++++++++ LayoutTests/webaudio/audionode-expected.txt | 2 ++ LayoutTests/webaudio/audionode.html | 17 ++++++++++++++--- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index a34406b..3f743b3 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,19 @@ +2012-07-04 Li Yin + + AudioNode test should cover numberOfInputs and numberOfOutputs of AudioDestinationNode + https://bugs.webkit.org/show_bug.cgi?id=90578 + + Reviewed by Chris Rogers. + + Spec: http://www.w3.org/TR/webaudio/#AudioDestinationNode-section + An AudioSourceNode has no inputs and a single output. + An AudioDestinationNode has one input and no outputs. + Currently, the test webaudio/audionode.html has covered AudioSourceNode, + it is still required to cover AudioDestinationNode. + + * webaudio/audionode-expected.txt: + * webaudio/audionode.html: + 2012-07-04 Yoshifumi Inoue Unreviewed Chromium gardening, drop test expectations for diff --git a/LayoutTests/webaudio/audionode-expected.txt b/LayoutTests/webaudio/audionode-expected.txt index 352d6af..0540fe7 100644 --- a/LayoutTests/webaudio/audionode-expected.txt +++ b/LayoutTests/webaudio/audionode-expected.txt @@ -7,6 +7,8 @@ PASS audioNode.noteGrainOn() threw exception TypeError: Not enough arguments. PASS audioNode.noteOff() threw exception TypeError: Not enough arguments. PASS Source AudioNode has no inputs. PASS Source AudioNode has one output. +PASS Destination AudioNode has one input. +PASS Destination AudioNode has no outputs. PASS connect() exception thrown for illegal destination AudioNode. PASS connect() exception thrown for illegal output index. PASS connect() exception thrown for illegal input index. diff --git a/LayoutTests/webaudio/audionode.html b/LayoutTests/webaudio/audionode.html index da00da2..dd0dc32 100644 --- a/LayoutTests/webaudio/audionode.html +++ b/LayoutTests/webaudio/audionode.html @@ -31,17 +31,28 @@ function runTest() { shouldThrow("audioNode.noteGrainOn()"); shouldThrow("audioNode.noteOff()"); - // Check number of inputs and outputs. - if (audioNode.numberOfInputs == 0) + // Check input and output numbers of AudioSourceNode. + if (audioNode.numberOfInputs === 0) testPassed("Source AudioNode has no inputs."); else testFailed("Source AudioNode should not have inputs."); - if (audioNode.numberOfOutputs == 1) + if (audioNode.numberOfOutputs === 1) testPassed("Source AudioNode has one output."); else testFailed("Source AudioNode should have one output."); + // Check input and output numbers of AudioDestinationNode + if (context.destination.numberOfInputs === 1) + testPassed("Destination AudioNode has one input."); + else + testFailed("Destination AudioNode should have one input."); + + if (context.destination.numberOfOutputs === 0) + testPassed("Destination AudioNode has no outputs."); + else + testFailed("Destination AudioNode should have no outputs."); + // Try calling connect() method with illegal values. try { -- 2.7.4