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

Unified Diff: media/webm/webm_parser_unittest.cc

Issue 8989041: Revert 115214 (caused media_unittests failure in FFmpegGlueTest, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/webm/webm_cluster_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/webm/webm_parser_unittest.cc
===================================================================
--- media/webm/webm_parser_unittest.cc (revision 115228)
+++ media/webm/webm_parser_unittest.cc (working copy)
@@ -60,13 +60,11 @@
static void CreateClusterExpectations(int timecode,
const SimpleBlockInfo* block_info,
int block_count,
- bool is_complete_cluster,
MockWebMParserClient* client) {
InSequence s;
EXPECT_CALL(*client, OnListStart(kWebMIdCluster)).WillOnce(Return(true));
- EXPECT_CALL(*client, OnUInt(kWebMIdTimecode, timecode))
- .WillOnce(Return(true));
+ EXPECT_CALL(*client, OnUInt(kWebMIdTimecode, 0)).WillOnce(Return(true));
for (int i = 0; i < block_count; i++) {
EXPECT_CALL(*client, OnSimpleBlock(block_info[i].track_num,
@@ -75,8 +73,7 @@
.WillOnce(Return(true));
}
- if (is_complete_cluster)
- EXPECT_CALL(*client, OnListEnd(kWebMIdCluster)).WillOnce(Return(true));
+ EXPECT_CALL(*client, OnListEnd(kWebMIdCluster)).WillOnce(Return(true));
}
TEST_F(WebMParserTest, EmptyCluster) {
@@ -214,7 +211,7 @@
int block_count = arraysize(kBlockInfo);
scoped_ptr<Cluster> cluster(CreateCluster(0, kBlockInfo, block_count));
- CreateClusterExpectations(0, kBlockInfo, block_count, true, &client_);
+ CreateClusterExpectations(0, kBlockInfo, block_count, &client_);
WebMListParser parser(kWebMIdCluster);
int result = parser.Parse(cluster->data(), cluster->size(), &client_);
@@ -233,7 +230,7 @@
int block_count = arraysize(kBlockInfo);
scoped_ptr<Cluster> cluster(CreateCluster(0, kBlockInfo, block_count));
- CreateClusterExpectations(0, kBlockInfo, block_count, true, &client_);
+ CreateClusterExpectations(0, kBlockInfo, block_count, &client_);
const uint8* data = cluster->data();
int size = cluster->size();
@@ -264,41 +261,4 @@
EXPECT_TRUE(parser.IsParsingComplete());
}
-TEST_F(WebMParserTest, TestReset) {
- InSequence s;
-
- const SimpleBlockInfo kBlockInfo[] = {
- { 0, 1 },
- { 1, 2 },
- { 0, 3 },
- { 0, 4 },
- { 1, 4 },
- };
- int block_count = arraysize(kBlockInfo);
-
- scoped_ptr<Cluster> cluster(CreateCluster(0, kBlockInfo, block_count));
-
- // First expect all but the last block.
- CreateClusterExpectations(0, kBlockInfo, block_count - 1, false, &client_);
-
- // Now expect all blocks.
- CreateClusterExpectations(0, kBlockInfo, block_count, true, &client_);
-
- WebMListParser parser(kWebMIdCluster);
-
- // Send slightly less than the full cluster so all but the last block is
- // parsed.
- int result = parser.Parse(cluster->data(), cluster->size() - 1, &client_);
- EXPECT_GT(result, 0);
- EXPECT_LT(result, cluster->size());
- EXPECT_FALSE(parser.IsParsingComplete());
-
- parser.Reset();
-
- // Now parse a whole cluster to verify that all the blocks will get parsed.
- result = parser.Parse(cluster->data(), cluster->size(), &client_);
- EXPECT_EQ(result, cluster->size());
- EXPECT_TRUE(parser.IsParsingComplete());
-}
-
} // namespace media
« no previous file with comments | « media/webm/webm_cluster_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698