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

Unified Diff: media/filters/decrypting_video_decoder_unittest.cc

Issue 935243002: Decryptors can report kNoKey to WebMediaPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android changes Created 5 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
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 11dc52ae7a0be4c7f3ca84f3c9da51fa8c9b1865..285bab67aa19519f7c484a79223c52f69a3caed8 100644
--- a/media/filters/decrypting_video_decoder_unittest.cc
+++ b/media/filters/decrypting_video_decoder_unittest.cc
@@ -57,7 +57,9 @@ class DecryptingVideoDecoderTest : public testing::Test {
message_loop_.message_loop_proxy(),
base::Bind(
&DecryptingVideoDecoderTest::RequestDecryptorNotification,
- base::Unretained(this)))),
+ base::Unretained(this)),
+ base::Bind(&DecryptingVideoDecoderTest::OnWaitingForDecryptionKey,
+ base::Unretained(this)))),
decryptor_(new StrictMock<MockDecryptor>()),
num_decrypt_and_decode_calls_(0),
num_frames_in_decryptor_(0),
@@ -179,6 +181,7 @@ class DecryptingVideoDecoderTest : public testing::Test {
void EnterWaitingForKeyState() {
EXPECT_CALL(*decryptor_, DecryptAndDecodeVideo(_, _))
.WillRepeatedly(RunCallback<1>(Decryptor::kNoKey, null_video_frame_));
+ EXPECT_CALL(*this, OnWaitingForDecryptionKey());
decoder_->Decode(encrypted_buffer_,
base::Bind(&DecryptingVideoDecoderTest::DecodeDone,
base::Unretained(this)));
@@ -227,6 +230,8 @@ class DecryptingVideoDecoderTest : public testing::Test {
MOCK_METHOD1(DecryptorSet, void(bool));
+ MOCK_METHOD0(OnWaitingForDecryptionKey, void(void));
+
base::MessageLoop message_loop_;
scoped_ptr<DecryptingVideoDecoder> decoder_;
scoped_ptr<StrictMock<MockDecryptor> > decryptor_;
@@ -263,6 +268,7 @@ TEST_F(DecryptingVideoDecoderTest, Initialize_Failure) {
.WillRepeatedly(RunCallback<1>(false));
EXPECT_CALL(*decryptor_, RegisterNewKeyCB(Decryptor::kVideo, _))
.WillRepeatedly(SaveArg<1>(&key_added_cb_));
+ EXPECT_CALL(*this, RequestDecryptorNotification(_)).Times(2);
InitializeAndExpectStatus(TestVideoConfig::NormalEncrypted(),
DECODER_ERROR_NOT_SUPPORTED);
@@ -333,7 +339,7 @@ TEST_F(DecryptingVideoDecoderTest, KeyAdded_DuringWaitingForKey) {
// Test the case where the a key is added when the decryptor is in
// kPendingDecode state.
-TEST_F(DecryptingVideoDecoderTest, KeyAdded_DruingPendingDecode) {
+TEST_F(DecryptingVideoDecoderTest, KeyAdded_DuringPendingDecode) {
Initialize();
EnterPendingDecodeState();

Powered by Google App Engine
This is Rietveld 408576698