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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "media/base/decrypt_config.h" | 9 #include "media/base/decrypt_config.h" |
10 #include "media/webm/cluster_builder.h" | 10 #include "media/webm/cluster_builder.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 WebMTracksParser::TextTracks(), | 209 WebMTracksParser::TextTracks(), |
210 std::set<int64>(), | 210 std::set<int64>(), |
211 std::string(), | 211 std::string(), |
212 std::string(), | 212 std::string(), |
213 LogCB())) {} | 213 LogCB())) {} |
214 | 214 |
215 protected: | 215 protected: |
216 scoped_ptr<WebMClusterParser> parser_; | 216 scoped_ptr<WebMClusterParser> parser_; |
217 }; | 217 }; |
218 | 218 |
219 TEST_F(WebMClusterParserTest, TestReset) { | 219 TEST_F(WebMClusterParserTest, Reset) { |
220 InSequence s; | 220 InSequence s; |
221 | 221 |
222 int block_count = arraysize(kDefaultBlockInfo); | 222 int block_count = arraysize(kDefaultBlockInfo); |
223 scoped_ptr<Cluster> cluster(CreateCluster(0, kDefaultBlockInfo, block_count)); | 223 scoped_ptr<Cluster> cluster(CreateCluster(0, kDefaultBlockInfo, block_count)); |
224 | 224 |
225 // Send slightly less than the full cluster so all but the last block is | 225 // Send slightly less than the full cluster so all but the last block is |
226 // parsed. | 226 // parsed. |
227 int result = parser_->Parse(cluster->data(), cluster->size() - 1); | 227 int result = parser_->Parse(cluster->data(), cluster->size() - 1); |
228 EXPECT_GT(result, 0); | 228 EXPECT_GT(result, 0); |
229 EXPECT_LT(result, cluster->size()); | 229 EXPECT_LT(result, cluster->size()); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 WebMTracksParser::TextTracks(), | 524 WebMTracksParser::TextTracks(), |
525 std::set<int64>(), | 525 std::set<int64>(), |
526 std::string(), | 526 std::string(), |
527 "video_key_id", | 527 "video_key_id", |
528 LogCB())); | 528 LogCB())); |
529 int result = parser_->Parse(cluster->data(), cluster->size()); | 529 int result = parser_->Parse(cluster->data(), cluster->size()); |
530 EXPECT_EQ(-1, result); | 530 EXPECT_EQ(-1, result); |
531 } | 531 } |
532 | 532 |
533 } // namespace media | 533 } // namespace media |
OLD | NEW |