Bug 1116355 - Throw when setting SourceBuffer mode to 'sequence'. r=karlt,rs=Ms2ger

This commit is contained in:
Bobby Holley 2014-12-30 12:22:45 -08:00
parent 3d107583b2
commit 3be4fc69dd
4 changed files with 41 additions and 0 deletions

View File

@ -49,6 +49,10 @@ SourceBuffer::SetMode(SourceBufferAppendMode aMode, ErrorResult& aRv)
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (aMode == SourceBufferAppendMode::Sequence) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return;
}
MOZ_ASSERT(mMediaSource->ReadyState() != MediaSourceReadyState::Closed);
if (mMediaSource->ReadyState() == MediaSourceReadyState::Ended) {
mMediaSource->SetReadyState(MediaSourceReadyState::Open);

View File

@ -19,6 +19,7 @@ skip-if = (toolkit == 'android' || buildapp == 'mulet') #timeout android/mulet o
[test_SeekableAfterEndOfStreamSplit.html]
[test_SeekableBeforeEndOfStream.html]
[test_SeekableBeforeEndOfStreamSplit.html]
[test_SetModeThrows.html]
[test_SplitAppendDelay.html]
[test_SplitAppend.html]
[test_WaitingOnMissingData.html]

View File

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<html>
<head>
<title>MSE: append initialization only</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="mediasource.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
// This test should be removed when we implement sequence mode in bug 1116353
runWithMSE(function (ms, v) {
ms.addEventListener("sourceopen", function () {
var sb = ms.addSourceBuffer("video/webm");
sb.mode = "segments";
ok("true", "Setting to segments does not throw");
try {
sb.mode = "sequence";
ok(false, "Should have thrown");
} catch (e) { ok(/supported/.test(e), "Correctly threw not supported: " + e); }
SimpleTest.finish();
});
});
</script>
</pre>
</body>
</html>

View File

@ -2,4 +2,6 @@
type: testharness
[Test setting SourceBuffer.mode and SourceBuffer.timestampOffset while parsing media segment.]
expected: FAIL
[Test setting SourceBuffer.mode]
expected: FAIL # Not supported yet - see bug 1116353