diff --git a/content/media/webaudio/AudioContext.cpp b/content/media/webaudio/AudioContext.cpp index a8df6e50409..95e6b61fa50 100644 --- a/content/media/webaudio/AudioContext.cpp +++ b/content/media/webaudio/AudioContext.cpp @@ -106,7 +106,7 @@ AudioContext::CreateGain() already_AddRefed AudioContext::CreateDelay(float aMaxDelayTime, ErrorResult& aRv) { - if (aMaxDelayTime <= 0.f) { + if (aMaxDelayTime <= 0.f || aMaxDelayTime >= 3.f) { aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return nullptr; } diff --git a/content/media/webaudio/test/test_delayNode.html b/content/media/webaudio/test/test_delayNode.html index 135df473d2a..7e4d872b963 100644 --- a/content/media/webaudio/test/test_delayNode.html +++ b/content/media/webaudio/test/test_delayNode.html @@ -56,6 +56,9 @@ addLoadEvent(function() { expectException(function() { context.createDelay(0); }, DOMException.NOT_SUPPORTED_ERR); + expectException(function() { + context.createDelay(3); + }, DOMException.NOT_SUPPORTED_ERR); expectException(function() { context.createDelay(-1); }, DOMException.NOT_SUPPORTED_ERR);