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

Unified Diff: media/filters/fake_video_decoder_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/filters/fake_video_decoder.cc ('k') | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/fake_video_decoder_unittest.cc
diff --git a/media/filters/fake_video_decoder_unittest.cc b/media/filters/fake_video_decoder_unittest.cc
index 4bb9911a12373472edc20ca1fd445c8796c0135d..f335c02654dabc10019e4451d5016673fe2f7fb7 100644
--- a/media/filters/fake_video_decoder_unittest.cc
+++ b/media/filters/fake_video_decoder_unittest.cc
@@ -47,17 +47,17 @@ class FakeVideoDecoderTest
Destroy();
}
- void InitializeWithConfigAndExpectStatus(const VideoDecoderConfig& config,
- PipelineStatus status) {
+ void InitializeWithConfigAndExpectResult(const VideoDecoderConfig& config,
+ bool success) {
decoder_->Initialize(
- config, false, NewExpectedStatusCB(status),
+ config, false, NewExpectedBoolCB(success),
base::Bind(&FakeVideoDecoderTest::FrameReady, base::Unretained(this)));
message_loop_.RunUntilIdle();
current_config_ = config;
}
void Initialize() {
- InitializeWithConfigAndExpectStatus(TestVideoConfig::Normal(), PIPELINE_OK);
+ InitializeWithConfigAndExpectResult(TestVideoConfig::Normal(), true);
}
void EnterPendingInitState() {
@@ -252,8 +252,7 @@ TEST_P(FakeVideoDecoderTest, Initialize) {
TEST_P(FakeVideoDecoderTest, SimulateFailureToInitialize) {
decoder_->SimulateFailureToInit();
- InitializeWithConfigAndExpectStatus(TestVideoConfig::Normal(),
- DECODER_ERROR_NOT_SUPPORTED);
+ InitializeWithConfigAndExpectResult(TestVideoConfig::Normal(), false);
Decode();
EXPECT_EQ(last_decode_status_, VideoDecoder::kDecodeError);
}
@@ -345,7 +344,7 @@ TEST_P(FakeVideoDecoderTest, ReadWithHold_DecodingDelay) {
TEST_P(FakeVideoDecoderTest, Reinitialize) {
Initialize();
ReadOneFrame();
- InitializeWithConfigAndExpectStatus(TestVideoConfig::Large(), PIPELINE_OK);
+ InitializeWithConfigAndExpectResult(TestVideoConfig::Large(), true);
ReadOneFrame();
}
@@ -353,8 +352,7 @@ TEST_P(FakeVideoDecoderTest, SimulateFailureToReinitialize) {
Initialize();
ReadOneFrame();
decoder_->SimulateFailureToInit();
- InitializeWithConfigAndExpectStatus(TestVideoConfig::Normal(),
- DECODER_ERROR_NOT_SUPPORTED);
+ InitializeWithConfigAndExpectResult(TestVideoConfig::Normal(), false);
Decode();
EXPECT_EQ(last_decode_status_, VideoDecoder::kDecodeError);
}
« no previous file with comments | « media/filters/fake_video_decoder.cc ('k') | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698