From cbe75bc86de1ad8068e35dc7f4d488efafea57b9 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 30 Dec 2014 12:22:45 -0800 Subject: [PATCH] Bug 1116355 - Throw when setting SourceBuffer mode to 'sequence'. r=karlt,rs=Ms2ger --- dom/media/mediasource/SourceBuffer.cpp | 4 +++ dom/media/mediasource/test/mochitest.ini | 1 + .../mediasource/test/test_SetModeThrows.html | 34 +++++++++++++++++++ .../mediasource-sourcebuffer-mode.html.ini | 2 ++ 4 files changed, 41 insertions(+) create mode 100644 dom/media/mediasource/test/test_SetModeThrows.html diff --git a/dom/media/mediasource/SourceBuffer.cpp b/dom/media/mediasource/SourceBuffer.cpp index 838e02c56ba..88b352b42f9 100644 --- a/dom/media/mediasource/SourceBuffer.cpp +++ b/dom/media/mediasource/SourceBuffer.cpp @@ -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); diff --git a/dom/media/mediasource/test/mochitest.ini b/dom/media/mediasource/test/mochitest.ini index fa80aa756b8..fa06f72d2c7 100644 --- a/dom/media/mediasource/test/mochitest.ini +++ b/dom/media/mediasource/test/mochitest.ini @@ -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] diff --git a/dom/media/mediasource/test/test_SetModeThrows.html b/dom/media/mediasource/test/test_SetModeThrows.html new file mode 100644 index 00000000000..8254b8ca050 --- /dev/null +++ b/dom/media/mediasource/test/test_SetModeThrows.html @@ -0,0 +1,34 @@ + + + + MSE: append initialization only + + + + + +
+
+
+ + diff --git a/testing/web-platform/meta/media-source/mediasource-sourcebuffer-mode.html.ini b/testing/web-platform/meta/media-source/mediasource-sourcebuffer-mode.html.ini index 85f1f83353d..527f68c3a45 100644 --- a/testing/web-platform/meta/media-source/mediasource-sourcebuffer-mode.html.ini +++ b/testing/web-platform/meta/media-source/mediasource-sourcebuffer-mode.html.ini @@ -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