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

Unified Diff: media/filters/chunk_demuxer_unittest.cc

Issue 180153003: Implement core of compliant MediaSource coded frame processing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Aligned with April 1 spec editor's draft, tests added Created 6 years, 7 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
Index: media/filters/chunk_demuxer_unittest.cc
diff --git a/media/filters/chunk_demuxer_unittest.cc b/media/filters/chunk_demuxer_unittest.cc
index 3bca45f646b51bb66089490e565e3680dc6f5841..c0e452f24475d65209d5411ce6fbac45df32b8f5 100644
--- a/media/filters/chunk_demuxer_unittest.cc
+++ b/media/filters/chunk_demuxer_unittest.cc
@@ -134,10 +134,8 @@ static void OnSeekDone_OKExpected(bool* called, PipelineStatus status) {
static void LogFunc(const std::string& str) { DVLOG(1) << str; }
// Test parameter determines which coded frame processor is used to process
-// appended data. If true, LegacyFrameProcessor is used. Otherwise, (not yet
-// supported), a more compliant frame processor is used.
-// TODO(wolenetz): Enable usage of new frame processor based on this flag.
-// See http://crbug.com/249422.
+// appended data. If true, LegacyFrameProcessor is used. Otherwise, the new
+// FrameProcessor is used.
class ChunkDemuxerTest : public ::testing::TestWithParam<bool> {
protected:
enum CodecsIndex {
@@ -2817,12 +2815,11 @@ TEST_P(ChunkDemuxerTest, DurationChange) {
// Add data beginning at the currently set duration and expect a new duration
// to be signaled. Note that the last video block will have a higher end
// timestamp than the last audio block.
- // TODO(wolenetz): Compliant coded frame processor will emit a max of one
- // duration change per each ProcessFrames(). Remove the first expectation here
- // once compliant coded frame processor is used. See http://crbug.com/249422.
- const int kNewStreamDurationAudio = kStreamDuration + kAudioBlockDuration;
- EXPECT_CALL(host_, SetDuration(
+ if (use_legacy_frame_processor_) {
+ const int kNewStreamDurationAudio = kStreamDuration + kAudioBlockDuration;
+ EXPECT_CALL(host_, SetDuration(
base::TimeDelta::FromMilliseconds(kNewStreamDurationAudio)));
+ }
const int kNewStreamDurationVideo = kStreamDuration + kVideoBlockDuration;
EXPECT_CALL(host_, SetDuration(
base::TimeDelta::FromMilliseconds(kNewStreamDurationVideo)));
@@ -2849,12 +2846,11 @@ TEST_P(ChunkDemuxerTest, DurationChangeTimestampOffset) {
ASSERT_TRUE(SetTimestampOffset(kSourceId, kDefaultDuration()));
- // TODO(wolenetz): Compliant coded frame processor will emit a max of one
- // duration change per each ProcessFrames(). Remove the first expectation here
- // once compliant coded frame processor is used. See http://crbug.com/249422.
- EXPECT_CALL(host_, SetDuration(
- kDefaultDuration() + base::TimeDelta::FromMilliseconds(
- kAudioBlockDuration * 2)));
+ if (use_legacy_frame_processor_) {
+ EXPECT_CALL(host_, SetDuration(
+ kDefaultDuration() + base::TimeDelta::FromMilliseconds(
+ kAudioBlockDuration * 2)));
+ }
EXPECT_CALL(host_, SetDuration(
kDefaultDuration() + base::TimeDelta::FromMilliseconds(
kVideoBlockDuration * 2)));
@@ -3275,8 +3271,9 @@ TEST_P(ChunkDemuxerTest, SeekCompletesWithoutTextCues) {
CheckExpectedBuffers(video_stream, "180 210");
}
-// TODO(wolenetz): Enable testing of new frame processor based on this flag,
-// once the new processor has landed. See http://crbug.com/249422.
+// Generate two sets of tests: one using FrameProcessor, and one using
+// LegacyFrameProcessor.
+INSTANTIATE_TEST_CASE_P(NewFrameProcessor, ChunkDemuxerTest, Values(false));
INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, ChunkDemuxerTest, Values(true));
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698