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

Unified Diff: media/filters/decrypting_audio_decoder_unittest.cc

Issue 1666653002: media: Remove SetCdmReadyCB and CdmReadyCB (part 1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and fix compile errors Created 4 years, 10 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/decrypting_audio_decoder.cc ('k') | media/filters/decrypting_video_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « media/filters/decrypting_audio_decoder.cc ('k') | media/filters/decrypting_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698