mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1563728 - Throw when the three parameters of BiquadFilterNode.getFrequencyResponse aren't of the same size. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D37056 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
76dc4579b9
commit
3ffaf1696e
@ -13,6 +13,7 @@
|
||||
#include "WebAudioUtils.h"
|
||||
#include "blink/Biquad.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "AudioParamTimeline.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -299,16 +300,20 @@ void BiquadFilterNode::SetType(BiquadFilterType aType) {
|
||||
static_cast<int32_t>(aType));
|
||||
}
|
||||
|
||||
void BiquadFilterNode::GetFrequencyResponse(
|
||||
const Float32Array& aFrequencyHz, const Float32Array& aMagResponse,
|
||||
const Float32Array& aPhaseResponse) {
|
||||
void BiquadFilterNode::GetFrequencyResponse(const Float32Array& aFrequencyHz,
|
||||
const Float32Array& aMagResponse,
|
||||
const Float32Array& aPhaseResponse,
|
||||
ErrorResult& aRv) {
|
||||
aFrequencyHz.ComputeLengthAndData();
|
||||
aMagResponse.ComputeLengthAndData();
|
||||
aPhaseResponse.ComputeLengthAndData();
|
||||
|
||||
uint32_t length =
|
||||
std::min(std::min(aFrequencyHz.Length(), aMagResponse.Length()),
|
||||
aPhaseResponse.Length());
|
||||
if (!(aFrequencyHz.Length() == aMagResponse.Length() &&
|
||||
aMagResponse.Length() == aPhaseResponse.Length())) {
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
|
||||
}
|
||||
|
||||
uint32_t length = aFrequencyHz.Length();
|
||||
if (!length) {
|
||||
return;
|
||||
}
|
||||
|
@ -48,7 +48,8 @@ class BiquadFilterNode final : public AudioNode {
|
||||
|
||||
void GetFrequencyResponse(const Float32Array& aFrequencyHz,
|
||||
const Float32Array& aMagResponse,
|
||||
const Float32Array& aPhaseResponse);
|
||||
const Float32Array& aPhaseResponse,
|
||||
ErrorResult& aRv);
|
||||
|
||||
const char* NodeType() const override { return "BiquadFilterNode"; }
|
||||
|
||||
|
@ -39,6 +39,7 @@ interface BiquadFilterNode : AudioNode {
|
||||
readonly attribute AudioParam Q; // Quality factor
|
||||
readonly attribute AudioParam gain; // in Decibels
|
||||
|
||||
[Throws]
|
||||
void getFrequencyResponse(Float32Array frequencyHz,
|
||||
Float32Array magResponse,
|
||||
Float32Array phaseResponse);
|
||||
|
@ -1,13 +0,0 @@
|
||||
[biquad-basic.html]
|
||||
[X getFrequencyResponse(new Float32Array(10), new Float32Array(1), new Float32Array(20)) did not throw an exception.]
|
||||
expected: FAIL
|
||||
|
||||
[X getFrequencyResponse(new Float32Array(10), new Float32Array(20), new Float32Array(1)) did not throw an exception.]
|
||||
expected: FAIL
|
||||
|
||||
[< [exceptions-getFrequencyData\] 2 out of 5 assertions were failed.]
|
||||
expected: FAIL
|
||||
|
||||
[# AUDIT TASK RUNNER FINISHED: 1 out of 5 tasks were failed.]
|
||||
expected: FAIL
|
||||
|
Loading…
Reference in New Issue
Block a user