diff options
author | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 23:08:45 +0000 |
---|---|---|
committer | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 23:08:45 +0000 |
commit | a3b3f77ed0b0f70122e44f4701a11300c13afdcb (patch) | |
tree | 0987510de876c1e4529b5c019cc613569b81d6ca /media | |
parent | 016fbc76be467caf9791a80eaf2c3b6491580422 (diff) | |
download | chromium_src-a3b3f77ed0b0f70122e44f4701a11300c13afdcb.zip chromium_src-a3b3f77ed0b0f70122e44f4701a11300c13afdcb.tar.gz chromium_src-a3b3f77ed0b0f70122e44f4701a11300c13afdcb.tar.bz2 |
VideoDecoderImpl Mock Engine leak callback.
Review URL: http://codereview.chromium.org/2085013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/video_decoder_impl_unittest.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/media/filters/video_decoder_impl_unittest.cc b/media/filters/video_decoder_impl_unittest.cc index 174b185..1ca1e2a 100644 --- a/media/filters/video_decoder_impl_unittest.cc +++ b/media/filters/video_decoder_impl_unittest.cc @@ -60,6 +60,8 @@ class MockVideoDecodeEngine : public VideoDecodeEngine { MOCK_METHOD1(Flush, void(Task* done_cb)); MOCK_CONST_METHOD0(state, State()); MOCK_CONST_METHOD0(GetSurfaceFormat, VideoFrame::Format()); + + scoped_ptr<FillThisBufferCallback> fill_buffer_callback_; }; // Class that just mocks the private functions. @@ -206,6 +208,10 @@ TEST_F(VideoDecoderImplTest, Initialize_QueryInterfaceFails) { message_loop_.RunAllPending(); } +ACTION_P(SaveCallback, engine) { + engine->fill_buffer_callback_.reset(arg3); +} + TEST_F(VideoDecoderImplTest, Initialize_EngineFails) { // Test successful initialization. AVStreamProvider* av_stream_provider = demuxer_; @@ -215,7 +221,7 @@ TEST_F(VideoDecoderImplTest, Initialize_EngineFails) { .WillOnce(Return(&stream_)); EXPECT_CALL(*engine_, Initialize(_, _, _, _, _)) - .WillOnce(WithArg<4>(InvokeRunnable())); + .WillOnce(DoAll(SaveCallback(engine_), WithArg<4>(InvokeRunnable()))); EXPECT_CALL(*engine_, state()) .WillOnce(Return(VideoDecodeEngine::kError)); @@ -237,7 +243,7 @@ TEST_F(VideoDecoderImplTest, Initialize_Successful) { .WillOnce(Return(&stream_)); EXPECT_CALL(*engine_, Initialize(_, _, _, _, _)) - .WillOnce(WithArg<4>(InvokeRunnable())); + .WillOnce(DoAll(SaveCallback(engine_), WithArg<4>(InvokeRunnable()))); EXPECT_CALL(*engine_, state()) .WillOnce(Return(VideoDecodeEngine::kNormal)); |