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

Unified Diff: media/renderers/video_renderer_impl_unittest.cc

Issue 1146913008: Revert of media: Simplify {Audio|Video}Decoder initialization callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/renderers/audio_renderer_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « media/renderers/audio_renderer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698