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 4f446b44aa090629de4d61c280fa55d23b27e399..2a37b64d6a1c89c42e5de207074f49767b4a7951 100644 |
--- a/media/filters/decrypting_audio_decoder_unittest.cc |
+++ b/media/filters/decrypting_audio_decoder_unittest.cc |
@@ -78,7 +78,6 @@ class DecryptingAudioDecoderTest : public testing::Test { |
decoded_frame_list_() {} |
virtual ~DecryptingAudioDecoderTest() { |
- EXPECT_CALL(*this, RequestCdmNotification(_)).Times(testing::AnyNumber()); |
Destroy(); |
} |
@@ -97,32 +96,18 @@ class DecryptingAudioDecoderTest : public testing::Test { |
kNoTimestamp()); |
decoded_frame_list_.push_back(decoded_frame_); |
- decoder_->Initialize( |
- config, base::Bind(&DecryptingAudioDecoderTest::RequestCdmNotification, |
- base::Unretained(this)), |
- NewExpectedBoolCB(success), |
- base::Bind(&DecryptingAudioDecoderTest::FrameReady, |
- base::Unretained(this))); |
+ decoder_->Initialize(config, cdm_context_.get(), NewExpectedBoolCB(success), |
+ base::Bind(&DecryptingAudioDecoderTest::FrameReady, |
+ base::Unretained(this))); |
message_loop_.RunUntilIdle(); |
} |
- enum CdmType { NO_CDM, CDM_WITHOUT_DECRYPTOR, CDM_WITH_DECRYPTOR }; |
+ enum CdmType { CDM_WITHOUT_DECRYPTOR, CDM_WITH_DECRYPTOR }; |
void SetCdmType(CdmType cdm_type) { |
- const bool has_cdm = cdm_type != NO_CDM; |
const bool has_decryptor = cdm_type == CDM_WITH_DECRYPTOR; |
- |
- EXPECT_CALL(*this, RequestCdmNotification(_)) |
- .WillOnce(RunCallback<0>(has_cdm ? cdm_context_.get() : nullptr, |
- base::Bind(&DecryptingAudioDecoderTest::CdmSet, |
- base::Unretained(this)))); |
- |
- if (has_cdm) { |
- EXPECT_CALL(*cdm_context_, GetDecryptor()) |
- .WillRepeatedly(Return(has_decryptor ? decryptor_.get() : nullptr)); |
- } |
- |
- EXPECT_CALL(*this, CdmSet(has_decryptor)); |
+ EXPECT_CALL(*cdm_context_, GetDecryptor()) |
+ .WillRepeatedly(Return(has_decryptor ? decryptor_.get() : nullptr)); |
} |
void Initialize() { |
@@ -149,7 +134,7 @@ class DecryptingAudioDecoderTest : public testing::Test { |
.WillOnce(RunCallback<1>(true)); |
EXPECT_CALL(*decryptor_, RegisterNewKeyCB(Decryptor::kAudio, _)) |
.WillOnce(SaveArg<1>(&key_added_cb_)); |
- decoder_->Initialize(new_config, SetCdmReadyCB(), NewExpectedBoolCB(true), |
+ decoder_->Initialize(new_config, nullptr, NewExpectedBoolCB(true), |
base::Bind(&DecryptingAudioDecoderTest::FrameReady, |
base::Unretained(this))); |
} |
@@ -265,13 +250,9 @@ class DecryptingAudioDecoderTest : public testing::Test { |
message_loop_.RunUntilIdle(); |
} |
- MOCK_METHOD1(RequestCdmNotification, void(const CdmReadyCB&)); |
- |
MOCK_METHOD1(FrameReady, void(const scoped_refptr<AudioBuffer>&)); |
MOCK_METHOD1(DecodeDone, void(AudioDecoder::Status)); |
- MOCK_METHOD1(CdmSet, void(bool)); |
- |
MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); |
base::MessageLoop message_loop_; |
@@ -330,14 +311,6 @@ TEST_F(DecryptingAudioDecoderTest, Initialize_UnsupportedAudioConfig) { |
InitializeAndExpectResult(config, false); |
} |
-TEST_F(DecryptingAudioDecoderTest, Initialize_NoCdm) { |
- SetCdmType(NO_CDM); |
- AudioDecoderConfig config(kCodecVorbis, kSampleFormatPlanarF32, |
- CHANNEL_LAYOUT_STEREO, kSampleRate, |
- EmptyExtraData(), true); |
- InitializeAndExpectResult(config, false); |
-} |
- |
TEST_F(DecryptingAudioDecoderTest, Initialize_CdmWithoutDecryptor) { |
SetCdmType(CDM_WITHOUT_DECRYPTOR); |
AudioDecoderConfig config(kCodecVorbis, kSampleFormatPlanarF32, |