mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
Bug 1609861 part 4. Stop using NS_ERROR_DOM_TYPE_ERR in appendWindowStart/End setters. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D60222 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
85ffb59181
commit
5740554e85
@ -143,7 +143,7 @@ void SourceBuffer::SetAppendWindowStart(double aAppendWindowStart,
|
||||
}
|
||||
if (aAppendWindowStart < 0 ||
|
||||
aAppendWindowStart >= mCurrentAttributes.GetAppendWindowEnd()) {
|
||||
aRv.Throw(NS_ERROR_DOM_TYPE_ERR);
|
||||
aRv.ThrowTypeError(u"Invalid appendWindowStart value");
|
||||
return;
|
||||
}
|
||||
mCurrentAttributes.SetAppendWindowStart(aAppendWindowStart);
|
||||
@ -160,7 +160,7 @@ void SourceBuffer::SetAppendWindowEnd(double aAppendWindowEnd,
|
||||
}
|
||||
if (IsNaN(aAppendWindowEnd) ||
|
||||
aAppendWindowEnd <= mCurrentAttributes.GetAppendWindowStart()) {
|
||||
aRv.Throw(NS_ERROR_DOM_TYPE_ERR);
|
||||
aRv.ThrowTypeError(u"Invalid appendWindowEnd value");
|
||||
return;
|
||||
}
|
||||
mCurrentAttributes.SetAppendWindowEnd(aAppendWindowEnd);
|
||||
|
@ -33,51 +33,51 @@
|
||||
assert_true(sourceBuffer != null, "New SourceBuffer returned");
|
||||
sourceBuffer.appendWindowEnd = 500.0;
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowStart = Number.NEGATIVE_INFINITY; },
|
||||
"set appendWindowStart throws an exception for Number.NEGATIVE_INFINITY.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowStart = Number.POSITIVE_INFINITY; },
|
||||
"set appendWindowStart throws an exception for Number.POSITIVE_INFINITY.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowStart = Number.NaN; },
|
||||
"set appendWindowStart throws an exception for Number.NaN.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowStart = 600.0; },
|
||||
"set appendWindowStart throws an exception when greater than appendWindowEnd.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowStart = sourceBuffer.appendWindowEnd; },
|
||||
"set appendWindowStart throws an exception when equal to appendWindowEnd.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowEnd = sourceBuffer.appendWindowStart; },
|
||||
"set appendWindowEnd throws an exception when equal to appendWindowStart.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowEnd = sourceBuffer.appendWindowStart - 1; },
|
||||
"set appendWindowEnd throws an exception if less than appendWindowStart.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowStart = -100.0; },
|
||||
"set appendWindowStart throws an exception when less than 0.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowEnd = -100.0; },
|
||||
"set appendWindowEnd throws an exception when less than 0.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowEnd = Number.NaN; },
|
||||
"set appendWindowEnd throws an exception if NaN.");
|
||||
|
||||
assert_throws(new TypeError(),
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowEnd = undefined; },
|
||||
"set appendWindowEnd throws an exception if undefined.");
|
||||
|
||||
assert_throws({name: "TypeError"},
|
||||
assert_throws_js(TypeError,
|
||||
function() { sourceBuffer.appendWindowStart = undefined; },
|
||||
"set appendWindowStart throws an exception if undefined.");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user