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

Unified Diff: media/mp4/mp4_stream_parser_unittest.cc

Issue 10651006: Add Common Encryption support to BMFF, including subsample decryption. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Satisfy mac_rel buildbot Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mp4/mp4_stream_parser.cc ('k') | media/mp4/track_run_iterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mp4/mp4_stream_parser_unittest.cc
diff --git a/media/mp4/mp4_stream_parser_unittest.cc b/media/mp4/mp4_stream_parser_unittest.cc
index db2555f7f82452449f4fbe10539c8db1f6f373b3..63e1382af2c5f8c78aec7275a07f09fda9a31a3e 100644
--- a/media/mp4/mp4_stream_parser_unittest.cc
+++ b/media/mp4/mp4_stream_parser_unittest.cc
@@ -28,21 +28,16 @@ class MP4StreamParserTest : public testing::Test {
public:
MP4StreamParserTest()
: parser_(new MP4StreamParser(false)),
- got_configs_(false) {
+ configs_received_(false) {
}
protected:
scoped_ptr<MP4StreamParser> parser_;
base::TimeDelta segment_start_;
- bool got_configs_;
+ bool configs_received_;
bool AppendData(const uint8* data, size_t length) {
- parser_->Parse(data, length);
- return true;
- }
-
- bool AppendDataInPieces(const uint8* data, size_t length) {
- return AppendDataInPieces(data, length, 7);
+ return parser_->Parse(data, length);
}
bool AppendDataInPieces(const uint8* data, size_t length, size_t piece_size) {
@@ -71,8 +66,8 @@ class MP4StreamParserTest : public testing::Test {
// TODO(strobe): Until http://crbug.com/122913 is fixed, we want to make
// sure that this callback isn't called more than once per stream. Remove
// when that bug is fixed.
- EXPECT_FALSE(got_configs_);
- got_configs_ = true;
+ EXPECT_FALSE(configs_received_);
+ configs_received_ = true;
return true;
}
@@ -83,7 +78,7 @@ class MP4StreamParserTest : public testing::Test {
DVLOG(3) << " n=" << buf - bufs.begin()
<< ", size=" << (*buf)->GetDataSize()
<< ", dur=" << (*buf)->GetDuration().InMilliseconds();
- EXPECT_LE(segment_start_, (*buf)->GetTimestamp());
+ EXPECT_GE((*buf)->GetTimestamp(), segment_start_);
}
return true;
}
@@ -108,22 +103,28 @@ class MP4StreamParserTest : public testing::Test {
base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this)));
}
- bool ParseMP4File(const std::string& filename, int append_size) {
+ bool ParseMP4File(const std::string& filename, int append_bytes) {
InitializeParser();
scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename);
EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
buffer->GetDataSize(),
- append_size));
+ append_bytes));
return true;
}
};
-TEST_F(MP4StreamParserTest, TestParseBearDASH) {
+
+
+TEST_F(MP4StreamParserTest, TestUnalignedAppend) {
+ // Test small, non-segment-aligned appends (small enough to exercise
+ // incremental append system)
ParseMP4File("bear.1280x720_dash.mp4", 512);
}
TEST_F(MP4StreamParserTest, TestMultiFragmentAppend) {
+ // Large size ensures multiple fragments are appended in one call (size is
+ // larger than this particular test file)
ParseMP4File("bear.1280x720_dash.mp4", 768432);
}
« no previous file with comments | « media/mp4/mp4_stream_parser.cc ('k') | media/mp4/track_run_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698