Commit 772b3352 authored by wolenetz's avatar wolenetz Committed by Commit bot

MSE: Test no muxed discontinuity forced by audio frame partial front trimming

This change adds frame processor tests to cover the behavior recently
landed from bad1c509 that changed "segments" appendMode's partial front
trimming logic.

BUG=408216
R=dalecurtis@chromium.org
TEST=new segments test fails before and passes after bad1c509, new sequence test passes before and after

Review URL: https://codereview.chromium.org/567403004

Cr-Commit-Position: refs/heads/master@{#294920}
parent 4c384d96
...@@ -664,6 +664,30 @@ TEST_P(FrameProcessorTest, PartialAppendWindowFilterNoDiscontinuity) { ...@@ -664,6 +664,30 @@ TEST_P(FrameProcessorTest, PartialAppendWindowFilterNoDiscontinuity) {
CheckReadsThenReadStalls(audio_.get(), "7:0 19"); CheckReadsThenReadStalls(audio_.get(), "7:0 19");
} }
TEST_P(FrameProcessorTest, PartialAppendWindowFilterNoNewMediaSegment) {
// Tests that a new media segment is not forcibly signalled for audio frame
// partial front trim, to prevent incorrect introduction of a discontinuity
// and potentially a non-keyframe video frame to be processed next after the
// discontinuity.
InSequence s;
AddTestTracks(HAS_AUDIO | HAS_VIDEO);
new_media_segment_ = true;
frame_processor_->SetSequenceMode(GetParam());
EXPECT_CALL(callbacks_, PossibleDurationIncrease(frame_duration_));
ProcessFrames("", "0K");
EXPECT_CALL(callbacks_, PossibleDurationIncrease(frame_duration_));
ProcessFrames("-5K", "");
EXPECT_CALL(callbacks_, PossibleDurationIncrease(frame_duration_* 2));
ProcessFrames("", "10");
EXPECT_EQ(base::TimeDelta(), timestamp_offset_);
EXPECT_FALSE(new_media_segment_);
CheckExpectedRangesByTimestamp(audio_.get(), "{ [0,5) }");
CheckExpectedRangesByTimestamp(video_.get(), "{ [0,20) }");
CheckReadsThenReadStalls(audio_.get(), "0:-5");
CheckReadsThenReadStalls(video_.get(), "0 10");
}
INSTANTIATE_TEST_CASE_P(SequenceMode, FrameProcessorTest, Values(true)); INSTANTIATE_TEST_CASE_P(SequenceMode, FrameProcessorTest, Values(true));
INSTANTIATE_TEST_CASE_P(SegmentsMode, FrameProcessorTest, Values(false)); INSTANTIATE_TEST_CASE_P(SegmentsMode, FrameProcessorTest, Values(false));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment