Index: media/renderers/video_renderer_impl_unittest.cc |
diff --git a/media/renderers/video_renderer_impl_unittest.cc b/media/renderers/video_renderer_impl_unittest.cc |
index 75c599e3d6b854170d74f55b01a209b13d68f752..aa494cb49ce79e6b24923e0759cd48ab36e578e8 100644 |
--- a/media/renderers/video_renderer_impl_unittest.cc |
+++ b/media/renderers/video_renderer_impl_unittest.cc |
@@ -97,26 +97,24 @@ |
.WillRepeatedly(Invoke(this, &VideoRendererImplTest::FlushRequested)); |
// Initialize, we shouldn't have any reads. |
- InitializeRenderer(low_delay, true); |
- } |
- |
- void InitializeRenderer(bool low_delay, bool expect_to_success) { |
- SCOPED_TRACE( |
- base::StringPrintf("InitializeRenderer(%d)", expect_to_success)); |
- WaitableMessageLoopEvent event; |
- CallInitialize(event.GetPipelineStatusCB(), low_delay, expect_to_success); |
- event.RunAndWaitForStatus(expect_to_success ? PIPELINE_OK |
- : DECODER_ERROR_NOT_SUPPORTED); |
+ InitializeRenderer(PIPELINE_OK, low_delay); |
+ } |
+ |
+ void InitializeRenderer(PipelineStatus expected, bool low_delay) { |
+ SCOPED_TRACE(base::StringPrintf("InitializeRenderer(%d)", expected)); |
+ WaitableMessageLoopEvent event; |
+ CallInitialize(event.GetPipelineStatusCB(), low_delay, expected); |
+ event.RunAndWaitForStatus(expected); |
} |
void CallInitialize(const PipelineStatusCB& status_cb, |
bool low_delay, |
- bool expect_to_success) { |
+ PipelineStatus decoder_status) { |
if (low_delay) |
demuxer_stream_.set_liveness(DemuxerStream::LIVENESS_LIVE); |
EXPECT_CALL(*decoder_, Initialize(_, _, _, _)) |
.WillOnce( |
- DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(expect_to_success))); |
+ DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(decoder_status))); |
EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); |
renderer_->Initialize( |
&demuxer_stream_, status_cb, media::SetDecryptorReadyCB(), |
@@ -532,7 +530,7 @@ |
} |
TEST_P(VideoRendererImplTest, VideoDecoder_InitFailure) { |
- InitializeRenderer(false, false); |
+ InitializeRenderer(DECODER_ERROR_NOT_SUPPORTED, false); |
Destroy(); |
} |