Closed
Bug 1186343
Opened 10 years ago
Closed 10 years ago
WaveShaperNode#setCurve should throw when the curve is less than two elements
Categories
(Core :: Web Audio, defect)
Core
Web Audio
Tracking
()
RESOLVED
FIXED
mozilla42
| Tracking | Status | |
|---|---|---|
| firefox42 | --- | fixed |
People
(Reporter: padenot, Assigned: bbouvier, Mentored)
Details
Attachments
(1 file)
|
5.24 KB,
patch
|
padenot
:
review+
smaug
:
review+
|
Details | Diff | Splinter Review |
Spec bug: https://github.com/WebAudio/web-audio-api/issues/464
The code is here: https://dxr.mozilla.org/mozilla-central/source/dom/media/webaudio/WaveShaperNode.cpp#313. The WebIDL interface is here: https://dxr.mozilla.org/mozilla-central/source/dom/media/webaudio/WaveShaperNode.cpp#313
This bug involves the following steps:
- In the webidl file, make it so that the setter can throw (you can search DXR with SetterThrows to check how this is done).
- In the C++ code, modify the method signature so that it compiles with the SetterThrows, check the size of the curve, and throw the correct exception if the size is less than two.
- Write a test that tests that the correct exception is thrown in the right situation (and not thrown in other situations). https://dxr.mozilla.org/mozilla-central/source/dom/media/webaudio/test contains a lot of other web audio tests for inspiration.
| Assignee | ||
Comment 1•10 years ago
|
||
Fwiw, the WebIDL interface is there: https://dxr.mozilla.org/mozilla-central/source/dom/webidl/WaveShaperNode.webidl
| Assignee | ||
Comment 2•10 years ago
|
||
I was curious what the Firefox development process looked like. How does that patch look?
Also, which test suite should I flag in the try flags, to test that this change works on all platforms? mochitests-all?
| Reporter | ||
Comment 3•10 years ago
|
||
Comment on attachment 8637163 [details] [diff] [review]
webaudio.patch
Review of attachment 8637163 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for the patch, looks good (with the comment addressed).
You want to run mochitest-3 for desktop platforms, and mochitest-10 for android.
::: dom/webidl/WaveShaperNode.webidl
@@ +17,5 @@
> };
>
> interface WaveShaperNode : AudioNode {
>
> + [SetterThrows] attribute Float32Array? curve;
We usually put extended attribute on their own line, above the member they refer to.
Attachment #8637163 -
Flags: review?(padenot) → review+
| Assignee | ||
Comment 4•10 years ago
|
||
Thanks for the review! I've updated the spacing in the webidl file.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d92588ec9f9d
| Assignee | ||
Comment 5•10 years ago
|
||
Comment on attachment 8637163 [details] [diff] [review]
webaudio.patch
Review of attachment 8637163 [details] [diff] [review]:
-----------------------------------------------------------------
Adding smaug for the changes in the webidl file (setting curve can throw, as per spec in comment 0).
Attachment #8637163 -
Flags: review?(bugs)
Comment 6•10 years ago
|
||
Comment on attachment 8637163 [details] [diff] [review]
webaudio.patch
What paul said about [SetterThrows] being on its own line.
Attachment #8637163 -
Flags: review?(bugs) → review+
Comment 8•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in
before you can comment on or make changes to this bug.
Description
•