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

Unified Diff: media/renderers/video_renderer_impl_unittest.cc

Issue 1005303004: media: VideoRenderImpl: display last available frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use std:min(time before next frame, 10ms) 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 d9cad51ea65b0f64c584220226bd2b98d4ee62d0..54ca695c1c199de79676236fd21faa9d133e207a 100644
--- a/media/renderers/video_renderer_impl_unittest.cc
+++ b/media/renderers/video_renderer_impl_unittest.cc
@@ -472,20 +472,31 @@ TEST_F(VideoRendererImplTest, VideoDecoder_InitFailure) {
TEST_F(VideoRendererImplTest, Underflow) {
Initialize();
QueueFrames("0 10 20 30");
- EXPECT_CALL(mock_cb_, Display(HasTimestamp(0)));
- EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH));
- StartPlayingFrom(0);
+
+ {
+ WaitableMessageLoopEvent event;
+ EXPECT_CALL(mock_cb_, Display(HasTimestamp(0)))
+ .Times(1)
+ .WillOnce(RunClosure(event.GetClosure()));
+ EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH));
+ StartPlayingFrom(0);
+ event.RunAndWait();
+ }
// Advance time slightly. Frames should be dropped and we should NOT signal
// having nothing.
AdvanceTimeInMs(100);
- // Advance time more. Now we should signal having nothing.
+ // Advance time more. Now we should signal having nothing. And put
+ // the last frame up for display.
{
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.
event.RunAndWait();
}
« 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