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

Unified Diff: media/filters/video_frame_stream_unittest.cc

Issue 2701203003: media: Prefer decrypting pipeline when CDM is attached (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/video_decoder_selector_unittest.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_frame_stream_unittest.cc
diff --git a/media/filters/video_frame_stream_unittest.cc b/media/filters/video_frame_stream_unittest.cc
index 415233dea5e0821249c39b4ddd97139bb747037a..27fea03bc222029a47274b756e061db1f07d5e51 100644
--- a/media/filters/video_frame_stream_unittest.cc
+++ b/media/filters/video_frame_stream_unittest.cc
@@ -57,7 +57,6 @@ class VideoFrameStreamTest
: demuxer_stream_(new FakeDemuxerStream(kNumConfigs,
kNumBuffersInOneConfig,
GetParam().is_encrypted)),
- cdm_context_(new StrictMock<MockCdmContext>()),
is_initialized_(false),
num_decoded_frames_(0),
pending_initialize_(false),
@@ -79,7 +78,7 @@ class VideoFrameStreamTest
bytes_decoded_cb);
// TODO(xhwang): We should test the case where only certain decoder
- // supports encrypted streams. Currently this is hard to test becasue we use
+ // supports encrypted streams. Currently this is hard to test because we use
// parameterized tests which need to pass in all combinations.
if (GetParam().is_encrypted && !GetParam().has_decryptor) {
decoder1_->EnableEncryptedConfigSupport();
@@ -95,7 +94,7 @@ class VideoFrameStreamTest
video_frame_stream_.reset(new VideoFrameStream(
message_loop_.task_runner(), std::move(decoders), new MediaLog()));
- if (GetParam().has_decryptor) {
+ if (GetParam().is_encrypted && GetParam().has_decryptor) {
decryptor_.reset(new NiceMock<MockDecryptor>());
// Decryptor can only decrypt (not decrypt-and-decode) so that
@@ -106,8 +105,12 @@ class VideoFrameStreamTest
.WillRepeatedly(Invoke(this, &VideoFrameStreamTest::Decrypt));
}
- EXPECT_CALL(*cdm_context_, GetDecryptor())
- .WillRepeatedly(Return(decryptor_.get()));
+ if (GetParam().is_encrypted) {
+ cdm_context_.reset(new StrictMock<MockCdmContext>());
+
+ EXPECT_CALL(*cdm_context_, GetDecryptor())
+ .WillRepeatedly(Return(decryptor_.get()));
+ }
}
~VideoFrameStreamTest() {
« no previous file with comments | « media/filters/video_decoder_selector_unittest.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698