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

Side by Side Diff: media/filters/frame_processor_unittest.cc

Issue 1355673004: MSE: Maintain continuity in sequence appendMode across ResetParserState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « media/filters/frame_processor.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 ProcessFrames("", "10"); 733 ProcessFrames("", "10");
734 734
735 EXPECT_EQ(base::TimeDelta(), timestamp_offset_); 735 EXPECT_EQ(base::TimeDelta(), timestamp_offset_);
736 EXPECT_FALSE(new_media_segment_); 736 EXPECT_FALSE(new_media_segment_);
737 CheckExpectedRangesByTimestamp(audio_.get(), "{ [0,5) }"); 737 CheckExpectedRangesByTimestamp(audio_.get(), "{ [0,5) }");
738 CheckExpectedRangesByTimestamp(video_.get(), "{ [0,20) }"); 738 CheckExpectedRangesByTimestamp(video_.get(), "{ [0,20) }");
739 CheckReadsThenReadStalls(audio_.get(), "0:-5"); 739 CheckReadsThenReadStalls(audio_.get(), "0:-5");
740 CheckReadsThenReadStalls(video_.get(), "0 10"); 740 CheckReadsThenReadStalls(video_.get(), "0 10");
741 } 741 }
742 742
743 TEST_F(FrameProcessorTest, AudioOnly_SequenceModeContinuityAcrossReset) {
744 InSequence s;
745 AddTestTracks(HAS_AUDIO);
746 new_media_segment_ = true;
747 frame_processor_->SetSequenceMode(true);
748 EXPECT_CALL(callbacks_, PossibleDurationIncrease(frame_duration_));
749 ProcessFrames("0K", "");
750 frame_processor_->Reset();
751 EXPECT_CALL(callbacks_, PossibleDurationIncrease(frame_duration_ * 2));
752 ProcessFrames("100K", "");
753
754 EXPECT_EQ(frame_duration_ * -9, timestamp_offset_);
755 EXPECT_FALSE(new_media_segment_);
756 CheckExpectedRangesByTimestamp(audio_.get(), "{ [0,20) }");
757 CheckReadsThenReadStalls(audio_.get(), "0 10:100");
758 }
759
743 INSTANTIATE_TEST_CASE_P(SequenceMode, FrameProcessorTest, Values(true)); 760 INSTANTIATE_TEST_CASE_P(SequenceMode, FrameProcessorTest, Values(true));
744 INSTANTIATE_TEST_CASE_P(SegmentsMode, FrameProcessorTest, Values(false)); 761 INSTANTIATE_TEST_CASE_P(SegmentsMode, FrameProcessorTest, Values(false));
745 762
746 } // namespace media 763 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/frame_processor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698