WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
92620
Add test for decodeAudioData
https://bugs.webkit.org/show_bug.cgi?id=92620
Summary
Add test for decodeAudioData
Li Yin
Reported
2012-07-30 01:52:30 PDT
Spec:
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioContext-section
Attachments
Patch
(4.76 KB, patch)
2012-08-01 01:25 PDT
,
Li Yin
no flags
Details
Formatted Diff
Diff
Patch
(5.16 KB, patch)
2012-08-01 01:49 PDT
,
Li Yin
no flags
Details
Formatted Diff
Diff
Patch
(4.53 KB, patch)
2012-08-01 06:06 PDT
,
Li Yin
no flags
Details
Formatted Diff
Diff
Patch
(4.41 KB, patch)
2012-08-01 18:41 PDT
,
Li Yin
no flags
Details
Formatted Diff
Diff
Patch
(4.55 KB, patch)
2012-08-01 19:32 PDT
,
Li Yin
no flags
Details
Formatted Diff
Diff
Patch
(4.55 KB, patch)
2012-08-02 17:57 PDT
,
Li Yin
no flags
Details
Formatted Diff
Diff
Patch
(4.59 KB, patch)
2012-08-02 19:19 PDT
,
Li Yin
no flags
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Li Yin
Comment 1
2012-08-01 01:25:20 PDT
Created
attachment 155749
[details]
Patch
Li Yin
Comment 2
2012-08-01 01:44:10 PDT
The purpose of designing this test is to check if callback function can be invoked correctly. For the successCallback scenario, I can't find an audio file which can be decoded successfully in all platforms. The test can work correctly in chromium-linux platform, but I don't verify the result in chromium-win. In addition, the test is time out for chromium on MAC, I think the root cause is that it doesn't support ogg decoding.(If I am wrong, please feel free to correct me.) Hi Raymond, You designed codec tests, could you please give some advices? Thanks in advance.
Li Yin
Comment 3
2012-08-01 01:49:10 PDT
Created
attachment 155753
[details]
Patch
Li Yin
Comment 4
2012-08-01 06:06:48 PDT
Created
attachment 155792
[details]
Patch
Li Yin
Comment 5
2012-08-01 06:07:59 PDT
(In reply to
comment #2
)
> The purpose of designing this test is to check if callback function can be invoked correctly. > For the successCallback scenario, I can't find an audio file which can be decoded successfully in all platforms.
Sorry for the incorrect information, ogg format file should be decoded correctly for chromium on Linux, MAC and Windows.
> > The test can work correctly in chromium-linux platform, but I don't verify the result in chromium-win. > In addition, the test is time out for chromium on MAC, I think the root cause is that it doesn't support ogg decoding.(If I am wrong, please feel free to correct me.)
Sorry, the test can work correctly for chromium on MAC.
Raymond Toy
Comment 6
2012-08-01 09:21:56 PDT
Comment on
attachment 155792
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155792&action=review
Just a few minor comments on implementation. Otherwise, the test looks good.
> LayoutTests/ChangeLog:14 > + * webaudio/resources/media/error-format.txt: Added.
Perhaps a more obvious name would be good. Something like invalid-audio-file.txt. Might also be useful to have a real ogg (or mp3 or aac) file that we've manually corrupted in some way. There are also some Microsoft ADPCM wav files that we cannot decode because it's not supported by chromium.
> LayoutTests/webaudio/decode-audio-data-basic.html:36 > + debug("The " + index + " test: " + decodeCaseArray[index][0]);
Is this debug needed? I think it should be removed. You can add this information in the testPassed/testFailed messages.
> LayoutTests/webaudio/decode-audio-data-basic.html:47 > + testPassed("successCallback has been called correctly.");
As mentioned above, the message can include information about the test. I think that's better than the debug call above.
> LayoutTests/webaudio/decode-audio-data-basic.html:48 > + runDecodeTest(++index);
Do you need to call runDecodeTest here? Can you just call runDecodeTest(1) at the end of the file?
> LayoutTests/webaudio/decode-audio-data-basic.html:51 > + finishedJSTest();
Can finishedJSTest() be called at the end of the file, after calling runDecodeTest(1)?
> LayoutTests/webaudio/decode-audio-data-basic.html:58 > + finishJSTest();
Same comment as for line 51.
> LayoutTests/webaudio/decode-audio-data-basic.html:61 > + runDecodeTest(++index);
Same comment as for line 48.
> LayoutTests/webaudio/decode-audio-data-basic.html:68 > +runDecodeTest(0);
Can we just do runDecodeTest(0); runDecodeTest(1); finishJSTest(); I think this makes it clearer which tests are being run. It looks like with the current code, if runDecodeTest(0) fails, the remaining (one) test isn't run. I think it's beneficial to see all the test run, independent of whether a previous tests fails or not.
Li Yin
Comment 7
2012-08-01 18:41:24 PDT
Created
attachment 155944
[details]
Patch
Li Yin
Comment 8
2012-08-01 19:01:13 PDT
(In reply to
comment #6
)
> (From update of
attachment 155792
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=155792&action=review
> > Just a few minor comments on implementation. Otherwise, the test looks good. > > > LayoutTests/ChangeLog:14 > > + * webaudio/resources/media/error-format.txt: Added. > > Perhaps a more obvious name would be good. Something like invalid-audio-file.txt.
Fixed.
> > Might also be useful to have a real ogg (or mp3 or aac) file that we've manually corrupted in some way. There are also some Microsoft ADPCM wav files that we cannot decode because it's not supported by chromium. > > > LayoutTests/webaudio/decode-audio-data-basic.html:36 > > + debug("The " + index + " test: " + decodeCaseArray[index][0]); > > Is this debug needed? I think it should be removed. You can add this information in the testPassed/testFailed messages. > > > LayoutTests/webaudio/decode-audio-data-basic.html:47 > > + testPassed("successCallback has been called correctly."); > > As mentioned above, the message can include information about the test. I think that's better than the debug call above. >
Fixed.
> > LayoutTests/webaudio/decode-audio-data-basic.html:48 > > + runDecodeTest(++index); > > Do you need to call runDecodeTest here? Can you just call runDecodeTest(1) at the end of the file? > > > LayoutTests/webaudio/decode-audio-data-basic.html:51 > > + finishedJSTest(); > > Can finishedJSTest() be called at the end of the file, after calling runDecodeTest(1)? > > > LayoutTests/webaudio/decode-audio-data-basic.html:58 > > + finishJSTest(); > > Same comment as for line 51. > > > LayoutTests/webaudio/decode-audio-data-basic.html:61 > > + runDecodeTest(++index); > > Same comment as for line 48. > > > LayoutTests/webaudio/decode-audio-data-basic.html:68 > > +runDecodeTest(0); > > Can we just do > > runDecodeTest(0); > runDecodeTest(1); > finishJSTest(); > > I think this makes it clearer which tests are being run. It looks like with the current code, if runDecodeTest(0) fails, the remaining (one) test isn't run. I think it's beneficial to see all the test run, independent of whether a previous tests fails or not.
Fixed, I agree with you that it is better to run all the test no matter what is failed. In addition, I want to let the tests run one by one, and another test can be run after the callback is invoked. So I will keep it unchanged. And I think it is better for the expandablity. And in some other module such as WebSocket, this style is often used.
Chris Rogers
Comment 9
2012-08-01 19:07:57 PDT
Li, great test! I haven't looked fully at the patch yet, but would highly recommend using a .wav file instead of .ogg as the success case. Not all ports (like the mac port) support .ogg, but most would support .wav
Li Yin
Comment 10
2012-08-01 19:32:54 PDT
Created
attachment 155953
[details]
Patch
Li Yin
Comment 11
2012-08-01 19:34:30 PDT
(In reply to
comment #9
)
> Li, great test! I haven't looked fully at the patch yet, but would highly recommend using a .wav file instead of .ogg as the success case. Not all ports (like the mac port) support .ogg, but most would support .wav
Fixed. Thanks for your comments.
Raymond Toy
Comment 12
2012-08-02 12:41:36 PDT
Comment on
attachment 155953
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155953&action=review
Looks good to me, except for a couple of really minor nits. Don't have to fix them if you don't want to.
> LayoutTests/webaudio/decode-audio-data-basic.html:47 > + testFailed("The " + decodeCaseArray[index][0] + " test: successCallback should be called.");
Maybe be more forceful and say successCallback was not called.
> LayoutTests/webaudio/decode-audio-data-basic.html:54 > + testFailed("The " + decodeCaseArray[index][0] + " test: errorCallback should not be called.");
Maybe be more forceful: errorCallback was incorrectly called.
Li Yin
Comment 13
2012-08-02 17:57:30 PDT
Created
attachment 156221
[details]
Patch
Li Yin
Comment 14
2012-08-02 17:58:53 PDT
(In reply to
comment #12
)
> (From update of
attachment 155953
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=155953&action=review
> > Looks good to me, except for a couple of really minor nits. Don't have to fix them if you don't want to. > > > LayoutTests/webaudio/decode-audio-data-basic.html:47 > > + testFailed("The " + decodeCaseArray[index][0] + " test: successCallback should be called."); > > Maybe be more forceful and say > > successCallback was not called. > > > LayoutTests/webaudio/decode-audio-data-basic.html:54 > > + testFailed("The " + decodeCaseArray[index][0] + " test: errorCallback should not be called."); > > Maybe be more forceful: > > errorCallback was incorrectly called.
Fixed. Thanks for your comments.
Chris Rogers
Comment 15
2012-08-02 18:54:14 PDT
Comment on
attachment 156221
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=156221&action=review
Looks good overall:
> LayoutTests/webaudio/decode-audio-data-basic.html:28 > + ["resources/media/invalid-audio-file.txt", false]];
I think a JSON format might be better, something like: [[url:"resources/media/24bit-44khz.wav", result:true], ... Because it will make the test code below easier to read
Li Yin
Comment 16
2012-08-02 19:19:55 PDT
Created
attachment 156240
[details]
Patch
Li Yin
Comment 17
2012-08-02 19:21:25 PDT
(In reply to
comment #15
)
> (From update of
attachment 156221
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=156221&action=review
> > Looks good overall: > > > LayoutTests/webaudio/decode-audio-data-basic.html:28 > > + ["resources/media/invalid-audio-file.txt", false]]; > > I think a JSON format might be better, something like: > > [[url:"resources/media/24bit-44khz.wav", result:true], ... > > Because it will make the test code below easier to read
Fixed. They indeed make test be easier to read. Thanks.
Li Yin
Comment 18
2012-08-23 00:27:21 PDT
Hi Chris, Could you please give an official r+ and c+ if there are no issues? Please feel free to let me know if something is still needed to improved. Thanks in advance.
Chris Rogers
Comment 19
2012-08-23 11:07:13 PDT
Comment on
attachment 156240
[details]
Patch Thanks Li!
WebKit Review Bot
Comment 20
2012-08-23 11:43:33 PDT
Comment on
attachment 156240
[details]
Patch Clearing flags on attachment: 156240 Committed
r126458
: <
http://trac.webkit.org/changeset/126458
>
WebKit Review Bot
Comment 21
2012-08-23 11:43:37 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug