| Index: media/filters/decrypting_audio_decoder_unittest.cc
|
| diff --git a/media/filters/decrypting_audio_decoder_unittest.cc b/media/filters/decrypting_audio_decoder_unittest.cc
|
| index bb82a4c484d2af34210ce530a5c434c4a2a2896e..1f8395bf53a7173b11c65c3333351bd5afb5b37b 100644
|
| --- a/media/filters/decrypting_audio_decoder_unittest.cc
|
| +++ b/media/filters/decrypting_audio_decoder_unittest.cc
|
| @@ -79,8 +79,8 @@
|
| Destroy();
|
| }
|
|
|
| - void InitializeAndExpectResult(const AudioDecoderConfig& config,
|
| - bool success) {
|
| + void InitializeAndExpectStatus(const AudioDecoderConfig& config,
|
| + PipelineStatus status) {
|
| // Initialize data now that the config is known. Since the code uses
|
| // invalid values (that CreateEmptyBuffer() doesn't support), tweak them
|
| // just for CreateEmptyBuffer().
|
| @@ -94,7 +94,7 @@
|
| kNoTimestamp());
|
| decoded_frame_list_.push_back(decoded_frame_);
|
|
|
| - decoder_->Initialize(config, NewExpectedBoolCB(success),
|
| + decoder_->Initialize(config, NewExpectedStatusCB(status),
|
| base::Bind(&DecryptingAudioDecoderTest::FrameReady,
|
| base::Unretained(this)));
|
| message_loop_.RunUntilIdle();
|
| @@ -119,7 +119,7 @@
|
| config_.Initialize(kCodecVorbis, kSampleFormatPlanarF32,
|
| CHANNEL_LAYOUT_STEREO, kSampleRate, NULL, 0, true, true,
|
| base::TimeDelta(), 0);
|
| - InitializeAndExpectResult(config_, true);
|
| + InitializeAndExpectStatus(config_, PIPELINE_OK);
|
| }
|
|
|
| void Reinitialize() {
|
| @@ -132,7 +132,7 @@
|
| .WillOnce(RunCallback<1>(true));
|
| EXPECT_CALL(*decryptor_, RegisterNewKeyCB(Decryptor::kAudio, _))
|
| .WillOnce(SaveArg<1>(&key_added_cb_));
|
| - decoder_->Initialize(new_config, NewExpectedBoolCB(true),
|
| + decoder_->Initialize(new_config, NewExpectedStatusCB(PIPELINE_OK),
|
| base::Bind(&DecryptingAudioDecoderTest::FrameReady,
|
| base::Unretained(this)));
|
| }
|
| @@ -288,7 +288,7 @@
|
| AudioDecoderConfig config(kCodecVorbis, kSampleFormatPlanarF32,
|
| CHANNEL_LAYOUT_STEREO, kSampleRate, NULL, 0, false);
|
|
|
| - InitializeAndExpectResult(config, false);
|
| + InitializeAndExpectStatus(config, DECODER_ERROR_NOT_SUPPORTED);
|
| }
|
|
|
| // Ensure decoder handles invalid audio configs without crashing.
|
| @@ -296,7 +296,7 @@
|
| AudioDecoderConfig config(kUnknownAudioCodec, kUnknownSampleFormat,
|
| CHANNEL_LAYOUT_STEREO, 0, NULL, 0, true);
|
|
|
| - InitializeAndExpectResult(config, false);
|
| + InitializeAndExpectStatus(config, PIPELINE_ERROR_DECODE);
|
| }
|
|
|
| // Ensure decoder handles unsupported audio configs without crashing.
|
| @@ -307,14 +307,14 @@
|
|
|
| AudioDecoderConfig config(kCodecVorbis, kSampleFormatPlanarF32,
|
| CHANNEL_LAYOUT_STEREO, kSampleRate, NULL, 0, true);
|
| - InitializeAndExpectResult(config, false);
|
| + InitializeAndExpectStatus(config, DECODER_ERROR_NOT_SUPPORTED);
|
| }
|
|
|
| TEST_F(DecryptingAudioDecoderTest, Initialize_NullDecryptor) {
|
| ExpectDecryptorNotification(NULL, false);
|
| AudioDecoderConfig config(kCodecVorbis, kSampleFormatPlanarF32,
|
| CHANNEL_LAYOUT_STEREO, kSampleRate, NULL, 0, true);
|
| - InitializeAndExpectResult(config, false);
|
| + InitializeAndExpectStatus(config, DECODER_ERROR_NOT_SUPPORTED);
|
| }
|
|
|
| // Test normal decrypt and decode case.
|
|
|