Index: media/filters/video_frame_stream_unittest.cc |
diff --git a/media/filters/video_frame_stream_unittest.cc b/media/filters/video_frame_stream_unittest.cc |
index 30120d212375e7c42bc9038457276464c0795c58..f2494042a19ee4cba11a9fda782bea49fec96566 100644 |
--- a/media/filters/video_frame_stream_unittest.cc |
+++ b/media/filters/video_frame_stream_unittest.cc |
@@ -14,6 +14,7 @@ |
#include "testing/gtest/include/gtest/gtest.h" |
using ::testing::_; |
+using ::testing::AnyNumber; |
using ::testing::Assign; |
using ::testing::Invoke; |
using ::testing::NiceMock; |
@@ -85,6 +86,7 @@ class VideoFrameStreamTest |
EXPECT_FALSE(is_initialized_); |
} |
+ MOCK_METHOD1(OnNewSpliceBuffer, void(base::TimeDelta)); |
MOCK_METHOD1(SetDecryptorReadyCallback, void(const media::DecryptorReadyCB&)); |
void OnStatistics(const PipelineStatistics& statistics) { |
@@ -532,6 +534,26 @@ TEST_P(VideoFrameStreamTest, Reset_AfterNormalRead) { |
Read(); |
} |
+TEST_P(VideoFrameStreamTest, Reset_AfterNormalReadWithActiveSplice) { |
+ video_frame_stream_->set_splice_observer(base::Bind( |
+ &VideoFrameStreamTest::OnNewSpliceBuffer, base::Unretained(this))); |
+ Initialize(); |
+ |
+ // Send buffers with a splice timestamp, which sets the active splice flag. |
+ const base::TimeDelta splice_timestamp = base::TimeDelta(); |
+ demuxer_stream_->set_splice_timestamp(splice_timestamp); |
+ EXPECT_CALL(*this, OnNewSpliceBuffer(splice_timestamp)).Times(AnyNumber()); |
+ Read(); |
+ |
+ // Issue an explicit Reset() and clear the splice timestamp. |
+ Reset(); |
+ demuxer_stream_->set_splice_timestamp(kNoTimestamp()); |
+ |
+ // Ensure none of the upcoming calls indicate they have a splice timestamp. |
+ EXPECT_CALL(*this, OnNewSpliceBuffer(_)).Times(0); |
+ Read(); |
+} |
+ |
TEST_P(VideoFrameStreamTest, Reset_AfterDemuxerRead_ConfigChange) { |
Initialize(); |
EnterPendingState(DEMUXER_READ_CONFIG_CHANGE); |