Chromium Code Reviews| Index: media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc |
| diff --git a/media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc b/media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc |
| index bfa80217a8f53d58933c2d9104e118b73ac959a6..1def645120ab7914d6a226d6d77e915c1c719a0d 100644 |
| --- a/media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc |
| +++ b/media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc |
| @@ -48,6 +48,28 @@ TEST_F(MPEG1AudioStreamParserTest, UnalignedAppend) { |
| EXPECT_GT(last_audio_config().codec_delay(), 0); |
| } |
| +// Test parsing with small prime sized chunks to smoke out "power of |
| +// 2" field size assumptions. |
|
chcunningham
2017/02/22 00:49:04
Is this just theoretical? I'm not aware of any pow
DaleCurtis
2017/02/22 00:53:11
Yes I think it's just theoretical, but that's how
chcunningham
2017/02/22 01:13:48
Sorry, missed that. Your first segment isn't prime
DaleCurtis
2017/02/22 01:20:14
Done.
|
| +TEST_F(MPEG1AudioStreamParserTest, UnalignedAppendMP2) { |
| + const std::string expected = |
| + "NewSegment" |
| + "{ 0K }" |
| + "{ 0K }" |
|
chcunningham
2017/02/22 00:49:03
Why are the timestamps not increasing?
DaleCurtis
2017/02/22 00:53:11
Timestamps restart per append; so the small append
chcunningham
2017/02/22 01:13:48
Ah, yeah. timestampOffset gets updated at the boun
|
| + "{ 0K }" |
| + "{ 0K }" |
| + "EndOfSegment" |
| + "NewSegment" |
| + "{ 0K }" |
| + "{ 0K }" |
| + "{ 0K }" |
| + "{ 0K }" |
| + "{ 0K }" |
| + "{ 0K }" |
| + "EndOfSegment"; |
| + EXPECT_EQ(expected, ParseFile("sfx.mp2", 17)); |
| + EXPECT_GT(last_audio_config().codec_delay(), 0); |
| +} |
| + |
| // Test parsing with a larger piece size to verify that multiple buffers |
| // are passed to |new_buffer_cb_|. |
| TEST_F(MPEG1AudioStreamParserTest, UnalignedAppend512) { |