| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "media/webm/cluster_builder.h" | 5 #include "media/webm/cluster_builder.h" |
| 6 #include "media/webm/webm_constants.h" | 6 #include "media/webm/webm_constants.h" |
| 7 #include "media/webm/webm_parser.h" | 7 #include "media/webm/webm_parser.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 int track_num; | 39 int track_num; |
| 40 int timestamp; | 40 int timestamp; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 static void AddSimpleBlock(ClusterBuilder* cb, int track_num, | 43 static void AddSimpleBlock(ClusterBuilder* cb, int track_num, |
| 44 int64 timecode) { | 44 int64 timecode) { |
| 45 uint8 data[] = { 0x00 }; | 45 uint8 data[] = { 0x00 }; |
| 46 cb->AddSimpleBlock(track_num, timecode, 0, data, sizeof(data)); | 46 cb->AddSimpleBlock(track_num, timecode, 0, data, sizeof(data)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 static Cluster* CreateCluster(int timecode, | 49 static scoped_ptr<Cluster> CreateCluster(int timecode, |
| 50 const SimpleBlockInfo* block_info, | 50 const SimpleBlockInfo* block_info, |
| 51 int block_count) { | 51 int block_count) { |
| 52 ClusterBuilder cb; | 52 ClusterBuilder cb; |
| 53 cb.SetClusterTimecode(0); | 53 cb.SetClusterTimecode(0); |
| 54 | 54 |
| 55 for (int i = 0; i < block_count; i++) | 55 for (int i = 0; i < block_count; i++) |
| 56 AddSimpleBlock(&cb, block_info[i].track_num, block_info[i].timestamp); | 56 AddSimpleBlock(&cb, block_info[i].track_num, block_info[i].timestamp); |
| 57 | 57 |
| 58 return cb.Finish(); | 58 return cb.Finish(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 static void CreateClusterExpectations(int timecode, | 61 static void CreateClusterExpectations(int timecode, |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 InSequence s; | 346 InSequence s; |
| 347 EXPECT_CALL(client_, OnListStart(kWebMIdSegment)).WillOnce(ReturnNull()); | 347 EXPECT_CALL(client_, OnListStart(kWebMIdSegment)).WillOnce(ReturnNull()); |
| 348 | 348 |
| 349 WebMListParser parser(kWebMIdSegment, &client_); | 349 WebMListParser parser(kWebMIdSegment, &client_); |
| 350 int result = parser.Parse(kBuffer, size); | 350 int result = parser.Parse(kBuffer, size); |
| 351 EXPECT_EQ(-1, result); | 351 EXPECT_EQ(-1, result); |
| 352 EXPECT_FALSE(parser.IsParsingComplete()); | 352 EXPECT_FALSE(parser.IsParsingComplete()); |
| 353 } | 353 } |
| 354 | 354 |
| 355 } // namespace media | 355 } // namespace media |
| OLD | NEW |