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

Unified Diff: media/renderers/video_renderer_impl_unittest.cc

Issue 2570013003: Fix underflow correction occurring during normal rendering. (Closed)
Patch Set: Created 4 years 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 43f907188555830300733e3985f6427a6d5e0575..53a4f5de3f12c19499c25939c2c7ae83ee3910a9 100644
--- a/media/renderers/video_renderer_impl_unittest.cc
+++ b/media/renderers/video_renderer_impl_unittest.cc
@@ -892,14 +892,14 @@ TEST_F(VideoRendererImplTest, UnderflowEvictionBeforeEOS) {
.WillOnce(RunClosure(event.GetClosure()));
renderer_->OnTimeProgressing();
time_source_.StartTicking();
+ // Jump time far enough forward that no frames are valid.
+ AdvanceTimeInMs(1000);
event.RunAndWait();
}
WaitForPendingDecode();
- // Jump time far enough forward that no frames are valid.
renderer_->OnTimeStopped();
- AdvanceTimeInMs(1000);
time_source_.StopTicking();
// Providing the end of stream packet should remove all frames and exit.
@@ -927,32 +927,30 @@ TEST_F(VideoRendererImplTest, UnderflowEvictionWhileHaveEnough) {
event.RunAndWait();
}
- null_video_sink_->set_background_render(true);
- time_source_.StartTicking();
- renderer_->OnTimeProgressing();
- WaitForPendingDecode();
- renderer_->OnTimeStopped();
-
- // Jump time far enough forward that no frames are valid.
- AdvanceTimeInMs(1000);
+ // Now wait until we have no effective frames.
+ {
+ SCOPED_TRACE("Waiting for zero effective frames.");
+ WaitableMessageLoopEvent event;
+ null_video_sink_->set_background_render(true);
+ time_source_.StartTicking();
+ AdvanceTimeInMs(1000);
+ renderer_->OnTimeProgressing();
+ EXPECT_CALL(mock_cb_, FrameReceived(_))
+ .WillOnce(RunClosure(event.GetClosure()));
+ event.RunAndWait();
+ ASSERT_EQ(renderer_->effective_frames_queued_for_testing(), 0u);
+ }
+ // When OnTimeStopped() is called it should transition to HAVE_NOTHING.
{
SCOPED_TRACE("Waiting for BUFFERING_HAVE_NOTHING");
WaitableMessageLoopEvent event;
EXPECT_CALL(mock_cb_, OnBufferingStateChange(BUFFERING_HAVE_NOTHING))
.WillOnce(RunClosure(event.GetClosure()));
- QueueFrames("120");
- SatisfyPendingDecode();
+ renderer_->OnTimeStopped();
event.RunAndWait();
}
- // This should do nothing.
- renderer_->OnTimeProgressing();
-
- // Providing the end of stream packet should remove all frames and exit.
- SatisfyPendingDecodeWithEndOfStream();
- EXPECT_CALL(mock_cb_, OnBufferingStateChange(BUFFERING_HAVE_ENOUGH));
- WaitForEnded();
Destroy();
}
« 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