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

Unified Diff: media/filters/audio_decoder_selector_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/cast/sender/h264_vt_encoder_unittest.cc ('k') | media/filters/audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_decoder_selector_unittest.cc
diff --git a/media/filters/audio_decoder_selector_unittest.cc b/media/filters/audio_decoder_selector_unittest.cc
index 2bb1f6d263e7261c6e499518e3618dd1f4d53e3c..29570c97fbf2afb617a181af2335004fa88b3e57 100644
--- a/media/filters/audio_decoder_selector_unittest.cc
+++ b/media/filters/audio_decoder_selector_unittest.cc
@@ -196,8 +196,7 @@ TEST_F(AudioDecoderSelectorTest, ClearStream_NoDecryptor_OneClearDecoder) {
UseClearStream();
InitializeDecoderSelector(kNoDecryptor, 1);
- EXPECT_CALL(*decoder_1_, Initialize(_, _, _))
- .WillOnce(RunCallback<1>(PIPELINE_OK));
+ EXPECT_CALL(*decoder_1_, Initialize(_, _, _)).WillOnce(RunCallback<1>(true));
EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, IsNull()));
SelectDecoder();
@@ -219,10 +218,8 @@ TEST_F(AudioDecoderSelectorTest, ClearStream_NoDecryptor_MultipleClearDecoder) {
UseClearStream();
InitializeDecoderSelector(kNoDecryptor, 2);
- EXPECT_CALL(*decoder_1_, Initialize(_, _, _))
- .WillOnce(RunCallback<1>(DECODER_ERROR_NOT_SUPPORTED));
- EXPECT_CALL(*decoder_2_, Initialize(_, _, _))
- .WillOnce(RunCallback<1>(PIPELINE_OK));
+ EXPECT_CALL(*decoder_1_, Initialize(_, _, _)).WillOnce(RunCallback<1>(false));
+ EXPECT_CALL(*decoder_2_, Initialize(_, _, _)).WillOnce(RunCallback<1>(true));
EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull()));
SelectDecoder();
@@ -233,8 +230,7 @@ TEST_F(AudioDecoderSelectorTest,
UseClearStream();
InitializeDecoderSelector(kNoDecryptor, 2);
- EXPECT_CALL(*decoder_1_, Initialize(_, _, _))
- .WillOnce(RunCallback<1>(DECODER_ERROR_NOT_SUPPORTED));
+ EXPECT_CALL(*decoder_1_, Initialize(_, _, _)).WillOnce(RunCallback<1>(false));
EXPECT_CALL(*decoder_2_, Initialize(_, _, _));
SelectDecoderAndDestroy();
@@ -246,8 +242,7 @@ TEST_F(AudioDecoderSelectorTest, ClearStream_HasDecryptor) {
UseClearStream();
InitializeDecoderSelector(kDecryptOnly, 1);
- EXPECT_CALL(*decoder_1_, Initialize(_, _, _))
- .WillOnce(RunCallback<1>(PIPELINE_OK));
+ EXPECT_CALL(*decoder_1_, Initialize(_, _, _)).WillOnce(RunCallback<1>(true));
EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, IsNull()));
SelectDecoder();
@@ -297,8 +292,7 @@ TEST_F(AudioDecoderSelectorTest, EncryptedStream_DecryptOnly_OneClearDecoder) {
UseEncryptedStream();
InitializeDecoderSelector(kDecryptOnly, 1);
- EXPECT_CALL(*decoder_1_, Initialize(_, _, _))
- .WillOnce(RunCallback<1>(PIPELINE_OK));
+ EXPECT_CALL(*decoder_1_, Initialize(_, _, _)).WillOnce(RunCallback<1>(true));
EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, NotNull()));
SelectDecoder();
@@ -322,10 +316,8 @@ TEST_F(AudioDecoderSelectorTest,
UseEncryptedStream();
InitializeDecoderSelector(kDecryptOnly, 2);
- EXPECT_CALL(*decoder_1_, Initialize(_, _, _))
- .WillOnce(RunCallback<1>(DECODER_ERROR_NOT_SUPPORTED));
- EXPECT_CALL(*decoder_2_, Initialize(_, _, _))
- .WillOnce(RunCallback<1>(PIPELINE_OK));
+ EXPECT_CALL(*decoder_1_, Initialize(_, _, _)).WillOnce(RunCallback<1>(false));
+ EXPECT_CALL(*decoder_2_, Initialize(_, _, _)).WillOnce(RunCallback<1>(true));
EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, NotNull()));
SelectDecoder();
@@ -336,8 +328,7 @@ TEST_F(AudioDecoderSelectorTest,
UseEncryptedStream();
InitializeDecoderSelector(kDecryptOnly, 2);
- EXPECT_CALL(*decoder_1_, Initialize(_, _, _))
- .WillOnce(RunCallback<1>(DECODER_ERROR_NOT_SUPPORTED));
+ EXPECT_CALL(*decoder_1_, Initialize(_, _, _)).WillOnce(RunCallback<1>(false));
EXPECT_CALL(*decoder_2_, Initialize(_, _, _));
SelectDecoderAndDestroy();
« no previous file with comments | « media/cast/sender/h264_vt_encoder_unittest.cc ('k') | media/filters/audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698