Closed
Bug 1457013
Opened 7 years ago
Closed 7 years ago
AudioBuffer ctor throws wrong exceptions with out-of-range arguments
Categories
(Core :: Web Audio, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla61
| Tracking | Status | |
|---|---|---|
| firefox61 | --- | fixed |
People
(Reporter: toy.raymond, Assigned: achronop)
Details
(Keywords: dev-doc-complete)
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36
Steps to reproduce:
Run
n0 = new AudioBuffer({"numberOfChannels":0,"length":1,"sampleRate":16000});
n1 = new AudioBuffer({numberOfChannels: 2, length: 10, sampleRate: 48000});
n1.getChannelData(3)
Actual results:
Construction of n0 threw an IndexSizeError.
Same thing if you set length to 1 or sampleRate to a rate that's not supported.
n1.getChannelData(3) threw SyntaxError
Expected results:
I was expecting NotSupportedError as mentioned in https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createbuffer
Similarly, getChannelData(3) should throw IndexSizeError: https://webaudio.github.io/web-audio-api/#dom-audiobuffer-getchanneldata-channel
| Reporter | ||
Comment 1•7 years ago
|
||
Oops. I meant setting length to 0.
Updated•7 years ago
|
Component: Untriaged → Web Audio
Product: Firefox → Core
Updated•7 years ago
|
Rank: 25
Priority: -- → P3
Updated•7 years ago
|
Summary: audiobuffer → AudioBuffer ctor throws wrong exceptions with out-of-range arguments
| Assignee | ||
Updated•7 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Comment hidden (mozreview-request) |
Comment 3•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8971270 [details]
Bug 1457013 - In AudioBuffer return NOT_SUPPORTED error message for various cases to align with the spec.
https://reviewboard.mozilla.org/r/240040/#review245802
Attachment #8971270 -
Flags: review?(padenot) → review+
| Assignee | ||
Comment 4•7 years ago
|
||
Assignee: nobody → achronop
Updated•7 years ago
|
Keywords: dev-doc-needed
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 7•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8971624 [details]
Bug 1457013 - Update AudioBuffer mochitest to expect not supported error.
https://reviewboard.mozilla.org/r/240384/#review246438
Attachment #8971624 -
Flags: review?(padenot) → review+
Pushed by achronop@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/42439f5ecc0d
In AudioBuffer return NOT_SUPPORTED error message for various cases to align with the spec. r=padenot
https://hg.mozilla.org/integration/autoland/rev/d1623ae65516
Update AudioBuffer mochitest to expect not supported error. r=padenot
Comment 9•7 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/42439f5ecc0d
https://hg.mozilla.org/mozilla-central/rev/d1623ae65516
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Comment 10•7 years ago
|
||
Documentation updated:
Added range information and exception info to https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/AudioBuffer
Same kinds of changes to https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createBuffer
Updated https://developer.mozilla.org/en-US/Firefox/Releases/61#Web_Audio_Media_and_WebRTC
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•