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

Unified Diff: media/base/decoder_buffer_unittest.cc

Issue 757953002: Add SubsampleEntry constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 1 month 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 | « no previous file | media/base/decrypt_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decoder_buffer_unittest.cc
diff --git a/media/base/decoder_buffer_unittest.cc b/media/base/decoder_buffer_unittest.cc
index 20cc1fb3b3212c3f02ec18862bf093bcf5ae2a37..c868a362314644fc2b9cdf7bea7c3ee3f32bc605 100644
--- a/media/base/decoder_buffer_unittest.cc
+++ b/media/base/decoder_buffer_unittest.cc
@@ -99,9 +99,23 @@ TEST(DecoderBufferTest, ReadingWriting) {
EXPECT_FALSE(buffer->end_of_stream());
}
-TEST(DecoderBufferTest, GetDecryptConfig) {
+TEST(DecoderBufferTest, DecryptConfig) {
scoped_refptr<DecoderBuffer> buffer(new DecoderBuffer(0));
EXPECT_FALSE(buffer->decrypt_config());
+
+ const char kKeyId[] = "key id";
+ const char kIv[] = "0123456789abcdef";
+ std::vector<SubsampleEntry> subsamples;
+ subsamples.push_back(SubsampleEntry(10, 5));
+ subsamples.push_back(SubsampleEntry(15, 7));
+
+ DecryptConfig decrypt_config(kKeyId, kIv, subsamples);
+
+ buffer->set_decrypt_config(
+ make_scoped_ptr(new DecryptConfig(kKeyId, kIv, subsamples)));
+
+ EXPECT_TRUE(buffer->decrypt_config());
+ EXPECT_TRUE(buffer->decrypt_config()->Matches(decrypt_config));
}
TEST(DecoderBufferTest, IsKeyFrame) {
« no previous file with comments | « no previous file | media/base/decrypt_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698