Index: media/filters/decrypting_video_decoder_unittest.cc |
diff --git a/media/filters/decrypting_video_decoder_unittest.cc b/media/filters/decrypting_video_decoder_unittest.cc |
index bc3f93aec9580c49738ae48dfe93527fe6bb3bef..285bab67aa19519f7c484a79223c52f69a3caed8 100644 |
--- a/media/filters/decrypting_video_decoder_unittest.cc |
+++ b/media/filters/decrypting_video_decoder_unittest.cc |
@@ -81,11 +81,11 @@ |
EXPECT_CALL(*this, DecryptorSet(expected_result)); |
} |
- // Initializes the |decoder_| and expects |success|. Note the initialization |
+ // Initializes the |decoder_| and expects |status|. Note the initialization |
// can succeed or fail. |
- void InitializeAndExpectResult(const VideoDecoderConfig& config, |
- bool success) { |
- decoder_->Initialize(config, false, NewExpectedBoolCB(success), |
+ void InitializeAndExpectStatus(const VideoDecoderConfig& config, |
+ PipelineStatus status) { |
+ decoder_->Initialize(config, false, NewExpectedStatusCB(status), |
base::Bind(&DecryptingVideoDecoderTest::FrameReady, |
base::Unretained(this))); |
message_loop_.RunUntilIdle(); |
@@ -99,7 +99,7 @@ |
EXPECT_CALL(*decryptor_, RegisterNewKeyCB(Decryptor::kVideo, _)) |
.WillOnce(SaveArg<1>(&key_added_cb_)); |
- InitializeAndExpectResult(TestVideoConfig::NormalEncrypted(), true); |
+ InitializeAndExpectStatus(TestVideoConfig::NormalEncrypted(), PIPELINE_OK); |
} |
// Reinitialize the |decoder_| and expects it to succeed. |
@@ -110,7 +110,7 @@ |
EXPECT_CALL(*decryptor_, RegisterNewKeyCB(Decryptor::kVideo, _)) |
.WillOnce(SaveArg<1>(&key_added_cb_)); |
- InitializeAndExpectResult(TestVideoConfig::LargeEncrypted(), true); |
+ InitializeAndExpectStatus(TestVideoConfig::LargeEncrypted(), PIPELINE_OK); |
} |
// Decode |buffer| and expect DecodeDone to get called with |status|. |
@@ -259,7 +259,8 @@ |
TEST_F(DecryptingVideoDecoderTest, Initialize_NullDecryptor) { |
ExpectDecryptorNotification(NULL, false); |
- InitializeAndExpectResult(TestVideoConfig::NormalEncrypted(), false); |
+ InitializeAndExpectStatus(TestVideoConfig::NormalEncrypted(), |
+ DECODER_ERROR_NOT_SUPPORTED); |
} |
TEST_F(DecryptingVideoDecoderTest, Initialize_Failure) { |
@@ -269,7 +270,8 @@ |
.WillRepeatedly(SaveArg<1>(&key_added_cb_)); |
EXPECT_CALL(*this, RequestDecryptorNotification(_)).Times(2); |
- InitializeAndExpectResult(TestVideoConfig::NormalEncrypted(), false); |
+ InitializeAndExpectStatus(TestVideoConfig::NormalEncrypted(), |
+ DECODER_ERROR_NOT_SUPPORTED); |
} |
TEST_F(DecryptingVideoDecoderTest, Reinitialize_Normal) { |
@@ -287,8 +289,9 @@ |
.WillOnce(RunCallback<1>(false)); |
// Reinitialize() expects the reinitialization to succeed. Call |
- // InitializeAndExpectResult() directly to test the reinitialization failure. |
- InitializeAndExpectResult(TestVideoConfig::NormalEncrypted(), false); |
+ // InitializeAndExpectStatus() directly to test the reinitialization failure. |
+ InitializeAndExpectStatus(TestVideoConfig::NormalEncrypted(), |
+ DECODER_ERROR_NOT_SUPPORTED); |
} |
// Test normal decrypt and decode case. |
@@ -410,8 +413,9 @@ |
DecryptorReadyCB decryptor_ready_cb; |
EXPECT_CALL(*this, RequestDecryptorNotification(_)) |
.WillOnce(SaveArg<0>(&decryptor_ready_cb)); |
- decoder_->Initialize(TestVideoConfig::NormalEncrypted(), false, |
- NewExpectedBoolCB(false), |
+ decoder_->Initialize(TestVideoConfig::NormalEncrypted(), |
+ false, |
+ NewExpectedStatusCB(DECODER_ERROR_NOT_SUPPORTED), |
base::Bind(&DecryptingVideoDecoderTest::FrameReady, |
base::Unretained(this))); |
message_loop_.RunUntilIdle(); |
@@ -435,7 +439,8 @@ |
EXPECT_CALL(*decryptor_, InitializeVideoDecoder(_, _)) |
.WillOnce(SaveArg<1>(&pending_init_cb_)); |
- InitializeAndExpectResult(TestVideoConfig::NormalEncrypted(), false); |
+ InitializeAndExpectStatus(TestVideoConfig::NormalEncrypted(), |
+ DECODER_ERROR_NOT_SUPPORTED); |
EXPECT_FALSE(pending_init_cb_.is_null()); |
Destroy(); |