Index: webrtc/api/remotevideocapturer_unittest.cc |
diff --git a/webrtc/api/remotevideocapturer_unittest.cc b/webrtc/api/remotevideocapturer_unittest.cc |
index bc5e0754490dc5862846ea3f8a9d69c1d59ec85e..5d9672dbe99c5e83f1eeadbcc7610c54be258ff3 100644 |
--- a/webrtc/api/remotevideocapturer_unittest.cc |
+++ b/webrtc/api/remotevideocapturer_unittest.cc |
@@ -34,10 +34,13 @@ |
virtual void SetUp() { |
capturer_.SignalStateChange.connect( |
this, &RemoteVideoCapturerTest::OnStateChange); |
+ capturer_.SignalVideoFrame.connect( |
+ this, &RemoteVideoCapturerTest::OnVideoFrame); |
} |
~RemoteVideoCapturerTest() { |
capturer_.SignalStateChange.disconnect(this); |
+ capturer_.SignalVideoFrame.disconnect(this); |
} |
int captured_frame_num() const { |
@@ -55,6 +58,11 @@ |
CaptureState capture_state) { |
EXPECT_EQ(&capturer_, capturer); |
capture_state_ = capture_state; |
+ } |
+ |
+ void OnVideoFrame(VideoCapturer* capturer, const VideoFrame* frame) { |
+ EXPECT_EQ(&capturer_, capturer); |
+ ++captured_frame_num_; |
} |
int captured_frame_num_; |
@@ -95,3 +103,13 @@ |
EXPECT_TRUE(capturer_.GetBestCaptureFormat(desired, &best_format)); |
EXPECT_EQ(expected_format, best_format); |
} |
+ |
+TEST_F(RemoteVideoCapturerTest, InputFrame) { |
+ EXPECT_EQ(0, captured_frame_num()); |
+ |
+ cricket::WebRtcVideoFrame test_frame; |
+ capturer_.SignalVideoFrame(&capturer_, &test_frame); |
+ EXPECT_EQ(1, captured_frame_num()); |
+ capturer_.SignalVideoFrame(&capturer_, &test_frame); |
+ EXPECT_EQ(2, captured_frame_num()); |
+} |