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

Unified Diff: media/filters/video_renderer_impl_unittest.cc

Issue 475863002: VideoRendererImpl: Delay report of BUFFERING_HAVE_NOTHING. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments Created 6 years, 4 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/filters/video_renderer_impl_unittest.cc
diff --git a/media/filters/video_renderer_impl_unittest.cc b/media/filters/video_renderer_impl_unittest.cc
index 27a2bfe9552e9746719021de04fc563ee99877c4..4f44939640ad7d172f25076d2d7b97d1b67d006e 100644
--- a/media/filters/video_renderer_impl_unittest.cc
+++ b/media/filters/video_renderer_impl_unittest.cc
@@ -43,8 +43,9 @@ MATCHER_P(HasTimestamp, ms, "") {
return arg->timestamp().InMilliseconds() == ms;
}
-// Arbitrary value. Has to be larger to cover any timestamp value used in tests.
-static const int kVideoDurationInMs = 1000;
+// Arbitrary value. Has to be larger to cover any timestamp value used in tests
+// and kTimeToDeclareHaveNothing.
+static const int kVideoDurationInMs = 10000;
class VideoRendererImplTest : public ::testing::Test {
public:
@@ -530,13 +531,17 @@ TEST_F(VideoRendererImplTest, Underflow) {
EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_ENOUGH));
StartPlaying();
- // Frames should be dropped and we should signal having nothing.
+ // 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.
{
SCOPED_TRACE("Waiting for BUFFERING_HAVE_NOTHING");
WaitableMessageLoopEvent event;
EXPECT_CALL(mock_cb_, BufferingStateChange(BUFFERING_HAVE_NOTHING))
.WillOnce(RunClosure(event.GetClosure()));
- AdvanceTimeInMs(100);
+ AdvanceTimeInMs(3000); // Must match kTimeToDeclareHaveNothing.
DaleCurtis 2014/08/14 19:47:26 Up to you, put this as an enum in the header file?
acolwell GONE FROM CHROMIUM 2014/08/14 19:51:22 I don't think it is worth it and I don't really wa
event.RunAndWait();
}
« media/filters/video_renderer_impl.cc ('K') | « media/filters/video_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698