Index: webrtc/media/base/videobroadcaster_unittest.cc |
diff --git a/webrtc/media/base/videobroadcaster_unittest.cc b/webrtc/media/base/videobroadcaster_unittest.cc |
index e4e6d3256462b411f2cf4a0391f111ef6b0abda4..d2948bb4372546eb8bbe6fd199fdffd25f0b0bfe 100644 |
--- a/webrtc/media/base/videobroadcaster_unittest.cc |
+++ b/webrtc/media/base/videobroadcaster_unittest.cc |
@@ -131,13 +131,16 @@ TEST(VideoBroadcasterTest, SinkWantsBlackFrames) { |
FakeVideoRenderer sink2; |
VideoSinkWants wants2; |
- wants1.black_frames = false; |
+ wants2.black_frames = false; |
broadcaster.AddOrUpdateSink(&sink2, wants2); |
- cricket::WebRtcVideoFrame frame1; |
- frame1.InitToBlack(100, 200, 10000 /*ts*/); |
- // Make it not all-black |
- frame1.video_frame_buffer()->MutableDataU()[0] = 0; |
+ rtc::scoped_refptr<webrtc::I420Buffer> buffer( |
+ new rtc::RefCountedObject<webrtc::I420Buffer>(100, 200)); |
+ // Makes it not all black. |
+ buffer->InitializeData(); |
+ |
+ cricket::WebRtcVideoFrame frame1( |
+ buffer, webrtc::kVideoRotation_0, 10 /* timestamp_us */); |
broadcaster.OnFrame(frame1); |
EXPECT_TRUE(sink1.black_frame()); |
EXPECT_EQ(10000, sink1.timestamp()); |
@@ -150,10 +153,8 @@ TEST(VideoBroadcasterTest, SinkWantsBlackFrames) { |
wants2.black_frames = true; |
broadcaster.AddOrUpdateSink(&sink2, wants2); |
- cricket::WebRtcVideoFrame frame2; |
- frame2.InitToBlack(100, 200, 30000 /*ts*/); |
- // Make it not all-black |
- frame2.video_frame_buffer()->MutableDataU()[0] = 0; |
+ cricket::WebRtcVideoFrame frame2( |
+ buffer, webrtc::kVideoRotation_0, 30 /* timestamp_us */); |
broadcaster.OnFrame(frame2); |
EXPECT_FALSE(sink1.black_frame()); |
EXPECT_EQ(30000, sink1.timestamp()); |