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

Side by Side Diff: webrtc/media/base/videobroadcaster_unittest.cc

Issue 2541863002: Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: Initialize pixel data in VideoBroadcasterTest.OnFrame test. 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 unified diff | Download patch
« no previous file with comments | « webrtc/common_video/video_frame.cc ('k') | webrtc/media/engine/fakewebrtccall.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 19 matching lines...) Expand all
30 EXPECT_FALSE(broadcaster.frame_wanted()); 30 EXPECT_FALSE(broadcaster.frame_wanted());
31 } 31 }
32 32
33 TEST(VideoBroadcasterTest, OnFrame) { 33 TEST(VideoBroadcasterTest, OnFrame) {
34 VideoBroadcaster broadcaster; 34 VideoBroadcaster broadcaster;
35 35
36 FakeVideoRenderer sink1; 36 FakeVideoRenderer sink1;
37 FakeVideoRenderer sink2; 37 FakeVideoRenderer sink2;
38 broadcaster.AddOrUpdateSink(&sink1, rtc::VideoSinkWants()); 38 broadcaster.AddOrUpdateSink(&sink1, rtc::VideoSinkWants());
39 broadcaster.AddOrUpdateSink(&sink2, rtc::VideoSinkWants()); 39 broadcaster.AddOrUpdateSink(&sink2, rtc::VideoSinkWants());
40 static int kWidth = 100;
41 static int kHeight = 50;
40 42
41 webrtc::VideoFrame frame; 43 rtc::scoped_refptr<webrtc::I420Buffer> buffer(
44 webrtc::I420Buffer::Create(kWidth, kHeight));
45 // Initialize, to avoid warnings on use of initialized values.
46 buffer->SetToBlack();
47
48 webrtc::VideoFrame frame(buffer, webrtc::kVideoRotation_0, 0);
42 49
43 broadcaster.OnFrame(frame); 50 broadcaster.OnFrame(frame);
44 EXPECT_EQ(1, sink1.num_rendered_frames()); 51 EXPECT_EQ(1, sink1.num_rendered_frames());
45 EXPECT_EQ(1, sink2.num_rendered_frames()); 52 EXPECT_EQ(1, sink2.num_rendered_frames());
46 53
47 broadcaster.RemoveSink(&sink1); 54 broadcaster.RemoveSink(&sink1);
48 broadcaster.OnFrame(frame); 55 broadcaster.OnFrame(frame);
49 EXPECT_EQ(1, sink1.num_rendered_frames()); 56 EXPECT_EQ(1, sink1.num_rendered_frames());
50 EXPECT_EQ(2, sink2.num_rendered_frames()); 57 EXPECT_EQ(2, sink2.num_rendered_frames());
51 58
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 broadcaster.AddOrUpdateSink(&sink2, wants2); 160 broadcaster.AddOrUpdateSink(&sink2, wants2);
154 161
155 webrtc::VideoFrame frame2(buffer, webrtc::kVideoRotation_0, 162 webrtc::VideoFrame frame2(buffer, webrtc::kVideoRotation_0,
156 30 /* timestamp_us */); 163 30 /* timestamp_us */);
157 broadcaster.OnFrame(frame2); 164 broadcaster.OnFrame(frame2);
158 EXPECT_FALSE(sink1.black_frame()); 165 EXPECT_FALSE(sink1.black_frame());
159 EXPECT_EQ(30, sink1.timestamp_us()); 166 EXPECT_EQ(30, sink1.timestamp_us());
160 EXPECT_TRUE(sink2.black_frame()); 167 EXPECT_TRUE(sink2.black_frame());
161 EXPECT_EQ(30, sink2.timestamp_us()); 168 EXPECT_EQ(30, sink2.timestamp_us());
162 } 169 }
OLDNEW
« no previous file with comments | « webrtc/common_video/video_frame.cc ('k') | webrtc/media/engine/fakewebrtccall.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698