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 "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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 parse_size = default_parse_size; | 226 parse_size = default_parse_size; |
227 | 227 |
228 data += result; | 228 data += result; |
229 size -= result; | 229 size -= result; |
230 | 230 |
231 EXPECT_EQ((size == 0), parser.IsParsingComplete()); | 231 EXPECT_EQ((size == 0), parser.IsParsingComplete()); |
232 } | 232 } |
233 EXPECT_TRUE(parser.IsParsingComplete()); | 233 EXPECT_TRUE(parser.IsParsingComplete()); |
234 } | 234 } |
235 | 235 |
236 TEST_F(WebMParserTest, TestReset) { | 236 TEST_F(WebMParserTest, Reset) { |
237 InSequence s; | 237 InSequence s; |
238 scoped_ptr<Cluster> cluster(CreateCluster(kBlockCount)); | 238 scoped_ptr<Cluster> cluster(CreateCluster(kBlockCount)); |
239 | 239 |
240 // First expect all but the last block. | 240 // First expect all but the last block. |
241 CreateClusterExpectations(kBlockCount - 1, false, &client_); | 241 CreateClusterExpectations(kBlockCount - 1, false, &client_); |
242 | 242 |
243 // Now expect all blocks. | 243 // Now expect all blocks. |
244 CreateClusterExpectations(kBlockCount, true, &client_); | 244 CreateClusterExpectations(kBlockCount, true, &client_); |
245 | 245 |
246 WebMListParser parser(kWebMIdCluster, &client_); | 246 WebMListParser parser(kWebMIdCluster, &client_); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 EXPECT_CALL(client_, OnString(kWebMIdDocType, "a")).WillOnce(Return(true)); | 386 EXPECT_CALL(client_, OnString(kWebMIdDocType, "a")).WillOnce(Return(true)); |
387 EXPECT_CALL(client_, OnListEnd(kWebMIdEBMLHeader)).WillOnce(Return(true)); | 387 EXPECT_CALL(client_, OnListEnd(kWebMIdEBMLHeader)).WillOnce(Return(true)); |
388 | 388 |
389 WebMListParser parser(kWebMIdEBMLHeader, &client_); | 389 WebMListParser parser(kWebMIdEBMLHeader, &client_); |
390 int result = parser.Parse(kBuffer, size); | 390 int result = parser.Parse(kBuffer, size); |
391 EXPECT_EQ(size, result); | 391 EXPECT_EQ(size, result); |
392 EXPECT_TRUE(parser.IsParsingComplete()); | 392 EXPECT_TRUE(parser.IsParsingComplete()); |
393 } | 393 } |
394 | 394 |
395 } // namespace media | 395 } // namespace media |
OLD | NEW |