OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/webm/cluster_builder.h" | 8 #include "media/webm/cluster_builder.h" |
9 #include "media/webm/webm_cluster_parser.h" | 9 #include "media/webm/webm_cluster_parser.h" |
10 #include "media/webm/webm_constants.h" | 10 #include "media/webm/webm_constants.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 | 115 |
116 static void AppendToEnd(const WebMClusterParser::BufferQueue& src, | 116 static void AppendToEnd(const WebMClusterParser::BufferQueue& src, |
117 WebMClusterParser::BufferQueue* dest) { | 117 WebMClusterParser::BufferQueue* dest) { |
118 for (WebMClusterParser::BufferQueue::const_iterator itr = src.begin(); | 118 for (WebMClusterParser::BufferQueue::const_iterator itr = src.begin(); |
119 itr != src.end(); ++itr) { | 119 itr != src.end(); ++itr) { |
120 dest->push_back(*itr); | 120 dest->push_back(*itr); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 class WebMClusterParserTest : public testing::Test { | 124 class WebMClusterParserTest : public testing::Test { |
125 public: | 125 public: |
126 WebMClusterParserTest() | 126 WebMClusterParserTest() |
127 : parser_(new WebMClusterParser(kTimecodeScale, | 127 : parser_(new WebMClusterParser(kTimecodeScale, |
128 kAudioTrackNum, | 128 kAudioTrackNum, kVideoTrackNum, |
129 kVideoTrackNum, | 129 "", "")) { |
130 std::string())) { | |
131 } | 130 } |
132 | 131 |
133 protected: | 132 protected: |
134 scoped_ptr<WebMClusterParser> parser_; | 133 scoped_ptr<WebMClusterParser> parser_; |
135 }; | 134 }; |
136 | 135 |
137 TEST_F(WebMClusterParserTest, TestReset) { | 136 TEST_F(WebMClusterParserTest, TestReset) { |
138 InSequence s; | 137 InSequence s; |
139 | 138 |
140 int block_count = arraysize(kDefaultBlockInfo); | 139 int block_count = arraysize(kDefaultBlockInfo); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 }; | 240 }; |
242 int block_count = arraysize(kBlockInfo); | 241 int block_count = arraysize(kBlockInfo); |
243 scoped_ptr<Cluster> cluster(CreateCluster(0, kBlockInfo, block_count)); | 242 scoped_ptr<Cluster> cluster(CreateCluster(0, kBlockInfo, block_count)); |
244 | 243 |
245 int result = parser_->Parse(cluster->data(), cluster->size()); | 244 int result = parser_->Parse(cluster->data(), cluster->size()); |
246 EXPECT_EQ(cluster->size(), result); | 245 EXPECT_EQ(cluster->size(), result); |
247 ASSERT_TRUE(VerifyBuffers(parser_, kBlockInfo, block_count)); | 246 ASSERT_TRUE(VerifyBuffers(parser_, kBlockInfo, block_count)); |
248 } | 247 } |
249 | 248 |
250 } // namespace media | 249 } // namespace media |
OLD | NEW |