Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-duration-boundaryconditions.html

Issue 2315113002: MSE: Throw TypeError instead of InvalidAccessError per spec update (Closed)
Patch Set: addSourceBuffer(null) is really addSourceBuffer("null") in at least Blink Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-duration-boundaryconditions.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-duration-boundaryconditions.html b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-duration-boundaryconditions.html
index 8dbec0bc07c2f33c0029fac425ca2f901113c8f9..fd284d6163d08999ad56275ba941d1af2bf2bea0 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-duration-boundaryconditions.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-duration-boundaryconditions.html
@@ -9,7 +9,7 @@
<body>
<div id="log"></div>
<script>
- function DurationBoundaryConditionTest(testDurationValue, expectedError, description)
+ function DurationBoundaryConditionTest(testDurationValue, expectTypeError, description)
{
return mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
{
@@ -19,8 +19,8 @@
sourceBuffer.appendBuffer(MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init));
test.waitForExpectedEvents(function()
{
- if (expectedError) {
- assert_throws(expectedError,
+ if (expectTypeError) {
+ assert_throws({name: "TypeError"},
function() { mediaSource.duration = testDurationValue; },
"mediaSource.duration assignment throws an exception for " + testDurationValue);
test.done();
@@ -44,19 +44,19 @@
}, description);
}
- DurationBoundaryConditionTest(Math.pow(2, 31) - 1, null, "Set duration to 2^31 - 1");
- DurationBoundaryConditionTest(1, null, "Set duration to 1");
- DurationBoundaryConditionTest(Number.MAX_VALUE, null, "Set duration to Number.MAX_VALUE");
- DurationBoundaryConditionTest(Number.MIN_VALUE, null, "Set duration to Number.MIN_VALUE");
- DurationBoundaryConditionTest(Number.MAX_VALUE - 1, null, "Set duration to Number.MAX_VALUE - 1");
- DurationBoundaryConditionTest(Number.MIN_VALUE - 1, "InvalidAccessError", "Set duration to Number.MIN_VALUE - 1");
- DurationBoundaryConditionTest(Number.POSITIVE_INFINITY, null, "Set duration to Number.POSITIVE_INFINITY");
- DurationBoundaryConditionTest(Number.NEGATIVE_INFINITY, "InvalidAccessError", "Set duration to Number.NEGATIVE_INFINITY");
- DurationBoundaryConditionTest(-1 * Number.MAX_VALUE, "InvalidAccessError", "Set duration to lowest value.");
- DurationBoundaryConditionTest(-101.9, "InvalidAccessError", "Set duration to a negative double.");
- DurationBoundaryConditionTest(101.9, null, "Set duration to a positive double.");
- DurationBoundaryConditionTest(0, null, "Set duration to zero");
- DurationBoundaryConditionTest(NaN, "InvalidAccessError", "Set duration to NaN");
+ DurationBoundaryConditionTest(Math.pow(2, 31) - 1, false, "Set duration to 2^31 - 1");
+ DurationBoundaryConditionTest(1, false, "Set duration to 1");
+ DurationBoundaryConditionTest(Number.MAX_VALUE, false, "Set duration to Number.MAX_VALUE");
+ DurationBoundaryConditionTest(Number.MIN_VALUE, false, "Set duration to Number.MIN_VALUE");
+ DurationBoundaryConditionTest(Number.MAX_VALUE - 1, false, "Set duration to Number.MAX_VALUE - 1");
+ DurationBoundaryConditionTest(Number.MIN_VALUE - 1, true, "Set duration to Number.MIN_VALUE - 1");
+ DurationBoundaryConditionTest(Number.POSITIVE_INFINITY, false, "Set duration to Number.POSITIVE_INFINITY");
+ DurationBoundaryConditionTest(Number.NEGATIVE_INFINITY, true, "Set duration to Number.NEGATIVE_INFINITY");
+ DurationBoundaryConditionTest(-1 * Number.MAX_VALUE, true, "Set duration to lowest value.");
+ DurationBoundaryConditionTest(-101.9, true, "Set duration to a negative double.");
+ DurationBoundaryConditionTest(101.9, false, "Set duration to a positive double.");
+ DurationBoundaryConditionTest(0, false, "Set duration to zero");
+ DurationBoundaryConditionTest(NaN, true, "Set duration to NaN");
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698