Bug 811555 - Make AudioContext.createDelay not accept arguments greater than or equal to 3; r=bzbarsky

--HG--
extra : rebase_source : 5ad2006acb9c27ba7f94c0d1858a19d71cc663c4
This commit is contained in:
Ehsan Akhgari 2012-11-13 16:46:25 -08:00
parent 7c4b4c24c9
commit d6aa3be16d
2 changed files with 4 additions and 1 deletions

View File

@ -106,7 +106,7 @@ AudioContext::CreateGain()
already_AddRefed<DelayNode>
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;
}

View File

@ -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);