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

Side by Side Diff: media/mp4/mp4_stream_parser_unittest.cc

Issue 10834101: Fix MP4StreamParser discard behavior when retaining 'moof'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tgt_offset -> offset Created 8 years, 4 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/mp4/mp4_stream_parser.cc ('k') | no next file » | 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) 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 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 InitializeParser(); 113 InitializeParser();
114 114
115 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); 115 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename);
116 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 116 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
117 buffer->GetDataSize(), 117 buffer->GetDataSize(),
118 append_bytes)); 118 append_bytes));
119 return true; 119 return true;
120 } 120 }
121 }; 121 };
122 122
123
124
125 TEST_F(MP4StreamParserTest, TestUnalignedAppend) { 123 TEST_F(MP4StreamParserTest, TestUnalignedAppend) {
126 // Test small, non-segment-aligned appends (small enough to exercise 124 // Test small, non-segment-aligned appends (small enough to exercise
127 // incremental append system) 125 // incremental append system)
128 ParseMP4File("bear.1280x720_dash.mp4", 512); 126 ParseMP4File("bear.1280x720_dash.mp4", 512);
129 } 127 }
130 128
129 TEST_F(MP4StreamParserTest, TestBytewiseAppend) {
130 // Ensure no incremental errors occur when parsing
131 ParseMP4File("bear.1280x720_dash.mp4", 1);
132 }
133
131 TEST_F(MP4StreamParserTest, TestMultiFragmentAppend) { 134 TEST_F(MP4StreamParserTest, TestMultiFragmentAppend) {
132 // Large size ensures multiple fragments are appended in one call (size is 135 // Large size ensures multiple fragments are appended in one call (size is
133 // larger than this particular test file) 136 // larger than this particular test file)
134 ParseMP4File("bear.1280x720_dash.mp4", 768432); 137 ParseMP4File("bear.1280x720_dash.mp4", 768432);
135 } 138 }
136 139
137 TEST_F(MP4StreamParserTest, TestReinitialization) { 140 TEST_F(MP4StreamParserTest, TestReinitialization) {
138 InitializeParser(); 141 InitializeParser();
139 142
140 scoped_refptr<DecoderBuffer> buffer = 143 scoped_refptr<DecoderBuffer> buffer =
141 ReadTestDataFile("bear.1280x720_dash.mp4"); 144 ReadTestDataFile("bear.1280x720_dash.mp4");
142 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 145 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
143 buffer->GetDataSize(), 146 buffer->GetDataSize(),
144 512)); 147 512));
145 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 148 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
146 buffer->GetDataSize(), 149 buffer->GetDataSize(),
147 512)); 150 512));
148 } 151 }
149 152
153 // TODO(strobe): Create and test media which uses CENC auxiliary info stored
154 // inside a private box
155
150 } // namespace mp4 156 } // namespace mp4
151 } // namespace media 157 } // namespace media
OLDNEW
« no previous file with comments | « media/mp4/mp4_stream_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698