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

Side by Side Diff: media/webm/webm_parser_unittest.cc

Issue 9015015: Take advantage of the new Pass() machinery on scoped_ptr{,_malloc}. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/webm/webm_cluster_parser.cc ('k') | webkit/media/active_loader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/webm/webm_cluster_parser.cc ('k') | webkit/media/active_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698