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

Unified Diff: media/base/null_video_sink_unittest.cc

Issue 1928083002: Ignore sink start attempts when no frames are present. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2717
Patch Set: Created 4 years, 8 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/base/null_video_sink.cc ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/null_video_sink_unittest.cc
diff --git a/media/base/null_video_sink_unittest.cc b/media/base/null_video_sink_unittest.cc
index 996edc0fe8d154329574280f6a1d78ec122d69ab..147f518c9daa2279977e13110b37179efc13325c 100644
--- a/media/base/null_video_sink_unittest.cc
+++ b/media/base/null_video_sink_unittest.cc
@@ -96,11 +96,12 @@ TEST_F(NullVideoSinkTest, BasicFunctionality) {
{
SCOPED_TRACE("Waiting for second render call.");
WaitableMessageLoopEvent event;
+ scoped_refptr<VideoFrame> test_frame_2 = CreateFrame(kInterval);
EXPECT_CALL(*this, Render(_, _, true))
.WillOnce(Return(test_frame))
- .WillOnce(Return(nullptr));
+ .WillOnce(Return(test_frame_2));
EXPECT_CALL(*this, FrameReceived(test_frame)).Times(0);
- EXPECT_CALL(*this, FrameReceived(scoped_refptr<VideoFrame>()))
+ EXPECT_CALL(*this, FrameReceived(test_frame_2))
.WillOnce(RunClosure(event.GetClosure()));
event.RunAndWait();
}
@@ -120,10 +121,11 @@ TEST_F(NullVideoSinkTest, ClocklessFunctionality) {
scoped_ptr<NullVideoSink> sink = ConstructSink(true, interval);
scoped_refptr<VideoFrame> test_frame = CreateFrame(base::TimeDelta());
+ scoped_refptr<VideoFrame> test_frame_2 = CreateFrame(interval);
sink->Start(this);
EXPECT_CALL(*this, FrameReceived(test_frame)).Times(1);
- EXPECT_CALL(*this, FrameReceived(scoped_refptr<VideoFrame>())).Times(1);
+ EXPECT_CALL(*this, FrameReceived(test_frame_2)).Times(1);
const int kTestRuns = 6;
const base::TimeTicks now = base::TimeTicks::Now();
@@ -139,7 +141,8 @@ TEST_F(NullVideoSinkTest, ClocklessFunctionality) {
} else {
EXPECT_CALL(*this, Render(current_time + i * interval,
current_time + (i + 1) * interval, false))
- .WillOnce(DoAll(RunClosure(event.GetClosure()), Return(nullptr)));
+ .WillOnce(
+ DoAll(RunClosure(event.GetClosure()), Return(test_frame_2)));
}
}
event.RunAndWait();
« no previous file with comments | « media/base/null_video_sink.cc ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698