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

Unified Diff: media/renderers/video_renderer_impl_unittest.cc

Issue 1034233002: Move underflow threshold limits out of the video renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@frame_time
Patch Set: Wait for frame duration. Created 5 years, 9 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
« no previous file with comments | « media/renderers/video_renderer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c1a029f236eb9d98a80a6886d2a8953005058b71..df5c9d3639ed7e554747554b05a6a83fa656c061 100644
--- a/media/renderers/video_renderer_impl_unittest.cc
+++ b/media/renderers/video_renderer_impl_unittest.cc
@@ -498,21 +498,27 @@ TEST_F(VideoRendererImplTest, Underflow) {
Mock::VerifyAndClearExpectations(&mock_cb_);
}
- // Advance time slightly. Frames should be dropped and we should NOT signal
- // having nothing.
- AdvanceTimeInMs(100);
+ // Advance time slightly, but enough to exceed the duration of the last frame.
+ // Frames should be dropped and we should NOT signal having nothing.
+ {
+ SCOPED_TRACE("Waiting for frame drops");
+ WaitableMessageLoopEvent event;
+ EXPECT_CALL(mock_cb_, Display(HasTimestamp(10))).Times(0);
+ EXPECT_CALL(mock_cb_, Display(HasTimestamp(20))).Times(0);
+ EXPECT_CALL(mock_cb_, Display(HasTimestamp(30)))
+ .WillOnce(RunClosure(event.GetClosure()));
+ AdvanceTimeInMs(31);
+ event.RunAndWait();
+ Mock::VerifyAndClearExpectations(&mock_cb_);
+ }
- // Advance time more. Now we should signal having nothing. And put
- // the last frame up for display.
+ // Advance time more, such that a new frame should have been displayed by now.
{
SCOPED_TRACE("Waiting for BUFFERING_HAVE_NOTHING");
WaitableMessageLoopEvent event;
EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_NOTHING))
.WillOnce(RunClosure(event.GetClosure()));
- EXPECT_CALL(mock_cb_, Display(HasTimestamp(10))).Times(0);
- EXPECT_CALL(mock_cb_, Display(HasTimestamp(20))).Times(0);
- EXPECT_CALL(mock_cb_, Display(HasTimestamp(30))).Times(1);
- AdvanceTimeInMs(3000); // Must match kTimeToDeclareHaveNothing.
+ AdvanceWallclockTimeInMs(9);
event.RunAndWait();
Mock::VerifyAndClearExpectations(&mock_cb_);
}
« no previous file with comments | « media/renderers/video_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698