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

Unified Diff: media/renderers/video_renderer_impl_unittest.cc

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