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

Unified Diff: media/filters/video_frame_stream_unittest.cc

Issue 347813004: Clear active splice flag after an explicit Reset(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « media/filters/fake_demuxer_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « media/filters/fake_demuxer_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698