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

Unified Diff: media/renderers/video_renderer_impl_unittest.cc

Issue 1246033008: media: In low delay mode, do not accumulate frames earlier than the start time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: media/renderers/video_renderer_impl_unittest.cc
diff --git a/media/renderers/video_renderer_impl_unittest.cc b/media/renderers/video_renderer_impl_unittest.cc
index ba5d80f9672bd27a92bd15805eb0afd358b481f0..794fb01988739f3302dce3ded578cbcae1663a68 100644
--- a/media/renderers/video_renderer_impl_unittest.cc
+++ b/media/renderers/video_renderer_impl_unittest.cc
@@ -46,7 +46,8 @@ MATCHER_P(HasTimestamp, ms, "") {
return arg->timestamp().InMilliseconds() == ms;
}
-class VideoRendererImplTest : public testing::TestWithParam<bool> {
+class VideoRendererImplTest
+ : public testing::TestWithParam<bool /* new_video_renderer */> {
public:
VideoRendererImplTest()
: tick_clock_(new base::SimpleTestTickClock()),
@@ -487,28 +488,29 @@ TEST_P(VideoRendererImplTest, StartPlayingFrom_RightAfter) {
}
TEST_P(VideoRendererImplTest, StartPlayingFrom_LowDelay) {
- // In low-delay mode only one frame is required to finish preroll.
+ // In low-delay mode only one frame is required to finish preroll. But frames
+ // prior to the start time will not be used.
InitializeWithLowDelay(true);
- QueueFrames("0");
+ QueueFrames("0 10");
+ EXPECT_CALL(mock_cb_, FrameReceived(HasTimestamp(10)));
// Expect some amount of have enough/nothing due to only requiring one frame.
- EXPECT_CALL(mock_cb_, FrameReceived(HasTimestamp(0)));
EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH))
.Times(AnyNumber());
EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_NOTHING))
.Times(AnyNumber());
xhwang 2015/07/21 20:30:26 When using the old rendering path, we declare HAVE
DaleCurtis 2015/07/21 21:16:50 I was planning to delete the old path this week as
- StartPlayingFrom(0);
+ StartPlayingFrom(10);
- QueueFrames("10");
+ QueueFrames("20");
SatisfyPendingRead();
renderer_->OnTimeStateChanged(true);
time_source_.StartTicking();
WaitableMessageLoopEvent event;
- EXPECT_CALL(mock_cb_, FrameReceived(HasTimestamp(10)))
+ EXPECT_CALL(mock_cb_, FrameReceived(HasTimestamp(20)))
.WillOnce(RunClosure(event.GetClosure()));
- AdvanceTimeInMs(10);
+ AdvanceTimeInMs(20);
event.RunAndWait();
Destroy();
« media/renderers/video_renderer_impl.cc ('K') | « media/renderers/video_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698