Changeset 196130 in webkit


Ignore:
Timestamp:
Feb 4, 2016 10:03:34 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Specify an exception for createChannelMerger, createChannelSplitter and createPeriodicWave
https://bugs.webkit.org/show_bug.cgi?id=150925

Patch by Hyemi Shin <hyemi.sin@samsung.com> on 2016-02-04
Reviewed by Darin Adler.

createChannelMerger and createChannelSplitter should throw INDEX_SIZE_ERR
for invalid numberOfInputs value.
createPeriodicWave should throw INDEX_SIZE_ERR for invalid lengths of parameters.

Source/WebCore:

Tests: webaudio/audiochannelmerger-basic.html

webaudio/audiochannelsplitter.html
webaudio/periodicwave-lengths.html

  • Modules/webaudio/AudioContext.cpp:

(WebCore::AudioContext::createChannelSplitter):
(WebCore::AudioContext::createChannelMerger):
(WebCore::AudioContext::createPeriodicWave):

LayoutTests:

  • webaudio/audiochannelmerger-basic-expected.txt: numberOfInputs could be 32.
  • webaudio/audiochannelmerger-basic.html: Ditto.
  • webaudio/audiochannelsplitter-expected.txt: Ditto.
  • webaudio/audiochannelsplitter.html: Ditto.
  • webaudio/periodicwave-lengths-expected.txt: Added.
  • webaudio/periodicwave-lengths.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r196126 r196130  
     12016-02-04  Hyemi Shin  <hyemi.sin@samsung.com>
     2
     3        Specify an exception for createChannelMerger, createChannelSplitter and createPeriodicWave
     4        https://bugs.webkit.org/show_bug.cgi?id=150925
     5
     6        Reviewed by Darin Adler.
     7
     8        createChannelMerger and createChannelSplitter should throw INDEX_SIZE_ERR
     9        for invalid numberOfInputs value.
     10        createPeriodicWave should throw INDEX_SIZE_ERR for invalid lengths of parameters.
     11
     12        * webaudio/audiochannelmerger-basic-expected.txt: numberOfInputs could be 32.
     13        * webaudio/audiochannelmerger-basic.html: Ditto.
     14        * webaudio/audiochannelsplitter-expected.txt: Ditto.
     15        * webaudio/audiochannelsplitter.html: Ditto.
     16        * webaudio/periodicwave-lengths-expected.txt: Added.
     17        * webaudio/periodicwave-lengths.html: Added.
     18
    1192016-02-04  Ryan Haddad  <ryanhaddad@apple.com>
    220
  • trunk/LayoutTests/webaudio/audiochannelmerger-basic-expected.txt

    r142848 r196130  
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    44
    5 PASS Exception was thrown for numberOfInputs <= 0.
    6 PASS Exception was thrown for numberOfInputs >= 32.
     5PASS IndexSizeError was thrown for numberOfInputs <= 0.
     6PASS IndexSizeError was thrown for numberOfInputs > 32.
    77PASS AudioChannelMerger created successfully with numberOfInputs = 32.
    88PASS AudioChannelMerger created successfully with empty parameter.
  • trunk/LayoutTests/webaudio/audiochannelmerger-basic.html

    r155286 r196130  
    2727    try {
    2828        var mergernode = context.createChannelMerger(0);
    29         testFailed("Exception should be thrown for numberOfInputs <= 0.");
     29        testFailed("IndexSizeError should be thrown for numberOfInputs <= 0.");
    3030    } catch(e) {
    31         testPassed("Exception was thrown for numberOfInputs <= 0.");
     31        if (e.code === DOMException.INDEX_SIZE_ERR)
     32            testPassed("IndexSizeError was thrown for numberOfInputs <= 0.");
     33        else
     34            testFailed("IndexSizeError should be thrown for numberOfInputs <= 0.");
    3235    }
    3336
    3437    try {
    3538        var mergernode = context.createChannelMerger(33);
    36         testFailed("Exception should be thrown for numberOfInputs >= 32.");
     39        testFailed("IndexSizeError should be thrown for numberOfInputs > 32.");
    3740    } catch(e) {
    38         testPassed("Exception was thrown for numberOfInputs >= 32.");
     41        if (e.code === DOMException.INDEX_SIZE_ERR)
     42            testPassed("IndexSizeError was thrown for numberOfInputs > 32.");
     43        else
     44            testFailed("IndexSizeError should be thrown for numberOfInputs > 32.");
    3945    }
    4046
  • trunk/LayoutTests/webaudio/audiochannelsplitter-expected.txt

    r142848 r196130  
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    44
    5 PASS Exception been thrown for numberOfOutputs <= 0.
    6 PASS Exception been thrown for numberOfOutputs >= 32.
     5PASS IndexSizeError been thrown for numberOfOutputs <= 0.
     6PASS IndexSizeError been thrown for numberOfOutputs > 32.
    77PASS AudioChannelSplitter created successfully with numberOfOutputs = 32.
    88PASS AudioChannelSplitter has 32 outputs when it is created with numberOfOutputs = 32.
  • trunk/LayoutTests/webaudio/audiochannelsplitter.html

    r155286 r196130  
    8686    try {
    8787        var splitternode = context.createChannelSplitter(0);
    88         testFailed("Exception should be thrown for numberOfOutputs <= 0.");
     88        testFailed("IndexSizeError should be thrown for numberOfOutputs <= 0.");
    8989    } catch(e) {
    90         testPassed("Exception been thrown for numberOfOutputs <= 0.");
     90        if (e.code === DOMException.INDEX_SIZE_ERR)
     91            testPassed("IndexSizeError been thrown for numberOfOutputs <= 0.");
     92        else
     93            testFailed("IndexSizeError should be thrown for numberOfOutputs <= 0.");
    9194    }
    9295
    9396    try {
    9497        var splitternode = context.createChannelSplitter(33);
    95         testFailed("Exception should be thrown for numerOfOutputs >= 32.");
     98        testFailed("IndexSizeError should be thrown for numerOfOutputs > 32.");
    9699    } catch(e) {
    97         testPassed("Exception been thrown for numberOfOutputs >= 32.");
     100        if (e.code === DOMException.INDEX_SIZE_ERR)
     101            testPassed("IndexSizeError been thrown for numberOfOutputs > 32.");
     102        else
     103            testFailed("IndexSizeError should be thrown for numerOfOutputs > 32.");
    98104    }
    99105
  • trunk/Source/WebCore/ChangeLog

    r196128 r196130  
     12016-02-04  Hyemi Shin  <hyemi.sin@samsung.com>
     2
     3        Specify an exception for createChannelMerger, createChannelSplitter and createPeriodicWave
     4        https://bugs.webkit.org/show_bug.cgi?id=150925
     5
     6        Reviewed by Darin Adler.
     7
     8        createChannelMerger and createChannelSplitter should throw INDEX_SIZE_ERR
     9        for invalid numberOfInputs value.
     10        createPeriodicWave should throw INDEX_SIZE_ERR for invalid lengths of parameters.
     11
     12        Tests: webaudio/audiochannelmerger-basic.html
     13               webaudio/audiochannelsplitter.html
     14               webaudio/periodicwave-lengths.html
     15
     16        * Modules/webaudio/AudioContext.cpp:
     17        (WebCore::AudioContext::createChannelSplitter):
     18        (WebCore::AudioContext::createChannelMerger):
     19        (WebCore::AudioContext::createPeriodicWave):
     20
    1212016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    222
  • trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp

    r194496 r196130  
    609609
    610610    if (!node.get()) {
    611         ec = SYNTAX_ERR;
     611        ec = INDEX_SIZE_ERR;
    612612        return nullptr;
    613613    }
     
    630630
    631631    if (!node.get()) {
    632         ec = SYNTAX_ERR;
     632        ec = INDEX_SIZE_ERR;
    633633        return nullptr;
    634634    }
     
    656656   
    657657    if (!real || !imag || (real->length() != imag->length() || (real->length() > MaxPeriodicWaveLength) || (real->length() <= 0))) {
    658         ec = SYNTAX_ERR;
     658        ec = INDEX_SIZE_ERR;
    659659        return nullptr;
    660660    }
Note: See TracChangeset for help on using the changeset viewer.