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

Unified Diff: media/filters/chunk_demuxer_unittest.cc

Issue 11313016: Add "type" in GenerateKeyRequest() and OnNeedKey(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the DCHECK where init_data_type_ is set but NeedKey from decoder passes empty "type". Created 8 years, 2 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/chunk_demuxer.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/chunk_demuxer_unittest.cc
diff --git a/media/filters/chunk_demuxer_unittest.cc b/media/filters/chunk_demuxer_unittest.cc
index eae8f69732c4341b936baf8138b1d7d428f249d2..8f4fa4e81f9832736b5eb5da741bae2fe0a8af23 100644
--- a/media/filters/chunk_demuxer_unittest.cc
+++ b/media/filters/chunk_demuxer_unittest.cc
@@ -58,6 +58,8 @@ static const char* kDefaultFirstClusterRange = "{ [0,46) }";
static const int kDefaultFirstClusterEndTimestamp = 66;
static const int kDefaultSecondClusterEndTimestamp = 132;
+static const char kWebMInitDataType[] = "video/webm";
+
base::TimeDelta kDefaultDuration() {
return base::TimeDelta::FromMilliseconds(201224);
}
@@ -732,9 +734,11 @@ class ChunkDemuxerTest : public testing::Test {
// are not supported in mocked methods. Remove this when the issue is fixed
// (http://code.google.com/p/googletest/issues/detail?id=395) or when we use
// std::string instead of scoped_array<uint8> (http://crbug.com/130689).
- MOCK_METHOD2(NeedKeyMock, void(const uint8* init_data, int init_data_size));
- void DemuxerNeedKey(scoped_array<uint8> init_data, int init_data_size) {
- NeedKeyMock(init_data.get(), init_data_size);
+ MOCK_METHOD3(NeedKeyMock, void(const std::string& type,
+ const uint8* init_data, int init_data_size));
+ void DemuxerNeedKey(const std::string& type,
+ scoped_array<uint8> init_data, int init_data_size) {
+ NeedKeyMock(type, init_data.get(), init_data_size);
}
MessageLoop message_loop_;
@@ -766,7 +770,7 @@ TEST_F(ChunkDemuxerTest, TestInit) {
if (is_audio_encrypted || is_video_encrypted) {
int need_key_count = (is_audio_encrypted ? 1 : 0) +
(is_video_encrypted ? 1 : 0);
- EXPECT_CALL(*this, NeedKeyMock(NotNull(), 16))
+ EXPECT_CALL(*this, NeedKeyMock(kWebMInitDataType, NotNull(), 16))
.Times(Exactly(need_key_count));
}
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698