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

Unified Diff: media/filters/decrypting_video_decoder_unittest.cc

Issue 2543623003: media: Allow config change between clear and encrypted streams (Closed)
Patch Set: comments addressed Created 3 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_video_decoder.cc ('k') | media/filters/source_buffer_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7f17248d4bc6ab1f8904490f8763f269ee2d2923..0e3b16939f88198b11fecbfceb2f30512c75f98f 100644
--- a/media/filters/decrypting_video_decoder_unittest.cc
+++ b/media/filters/decrypting_video_decoder_unittest.cc
@@ -107,14 +107,14 @@ class DecryptingVideoDecoderTest : public testing::Test {
}
// Reinitialize the |decoder_| and expects it to succeed.
- void Reinitialize() {
+ void Reinitialize(const VideoDecoderConfig& new_config) {
EXPECT_CALL(*decryptor_, DeinitializeDecoder(Decryptor::kVideo));
EXPECT_CALL(*decryptor_, InitializeVideoDecoder(_, _))
.WillOnce(RunCallback<1>(true));
EXPECT_CALL(*decryptor_, RegisterNewKeyCB(Decryptor::kVideo, _))
.WillOnce(SaveArg<1>(&key_added_cb_));
- InitializeAndExpectResult(TestVideoConfig::LargeEncrypted(), true);
+ InitializeAndExpectResult(new_config, true);
}
// Decode |buffer| and expect DecodeDone to get called with |status|.
@@ -273,10 +273,17 @@ TEST_F(DecryptingVideoDecoderTest, Initialize_Failure) {
InitializeAndExpectResult(TestVideoConfig::NormalEncrypted(), false);
}
-TEST_F(DecryptingVideoDecoderTest, Reinitialize_Normal) {
+TEST_F(DecryptingVideoDecoderTest, Reinitialize_EncryptedToEncrypted) {
Initialize();
EnterNormalDecodingState();
- Reinitialize();
+ Reinitialize(TestVideoConfig::LargeEncrypted());
+}
+
+// Test reinitializing decode with a new clear config.
+TEST_F(DecryptingVideoDecoderTest, Reinitialize_EncryptedToClear) {
+ Initialize();
+ EnterNormalDecodingState();
+ Reinitialize(TestVideoConfig::Normal());
}
TEST_F(DecryptingVideoDecoderTest, Reinitialize_Failure) {
« no previous file with comments | « media/filters/decrypting_video_decoder.cc ('k') | media/filters/source_buffer_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698