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

Unified Diff: content/renderer/media/rtc_video_decoder_unittest.cc

Issue 8528045: corresponding change in CaptureVideoDecoder and RTCVideoDecoder due to pull model used in medi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 9 years, 1 month 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 | « content/renderer/media/rtc_video_decoder.cc ('k') | content/renderer/media/video_capture_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_video_decoder_unittest.cc
===================================================================
--- content/renderer/media/rtc_video_decoder_unittest.cc (revision 109978)
+++ content/renderer/media/rtc_video_decoder_unittest.cc (working copy)
@@ -114,6 +114,8 @@
RTCVideoDecoderTest() {
decoder_ = new RTCVideoDecoder(&message_loop_, kUrl);
renderer_ = new MockVideoRenderer();
+ read_cb_ = base::Bind(&RTCVideoDecoderTest::FrameReady,
+ base::Unretained(this));
DCHECK(decoder_);
@@ -149,6 +151,7 @@
MockStatisticsCallback stats_callback_object_;
StrictMock<MockFilterHost> host_;
MessageLoop message_loop_;
+ media::VideoDecoder::ReadCB read_cb_;
private:
DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoderTest);
@@ -180,6 +183,20 @@
EXPECT_EQ(RTCVideoDecoder::kNormal, decoder_->state_);
}
+TEST_F(RTCVideoDecoderTest, DoFlush) {
+ const base::TimeDelta kZero;
+
+ InitializeDecoderSuccessfully();
+
+ EXPECT_CALL(*this, FrameReady(_));
+ decoder_->Read(read_cb_);
+ decoder_->Pause(media::NewExpectedClosure());
+ decoder_->Flush(media::NewExpectedClosure());
+
+ message_loop_.RunAllPending();
+ EXPECT_EQ(RTCVideoDecoder::kPaused, decoder_->state_);
+}
+
TEST_F(RTCVideoDecoderTest, DoRenderFrame) {
const base::TimeDelta kZero;
EXPECT_CALL(host_, GetTime()).WillRepeatedly(Return(base::TimeDelta()));
« no previous file with comments | « content/renderer/media/rtc_video_decoder.cc ('k') | content/renderer/media/video_capture_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698