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

Unified Diff: talk/media/base/capturemanager_unittest.cc

Issue 1646463002: Revert of New rtc::VideoSinkInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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 | « talk/media/base/capturemanager.cc ('k') | talk/media/base/capturerenderadapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/base/capturemanager_unittest.cc
diff --git a/talk/media/base/capturemanager_unittest.cc b/talk/media/base/capturemanager_unittest.cc
index 4a75fc368299bdab98503aa70948fe9b2aec08d9..709ec5bb8d3b95b633357a53ed982281f4448ebb 100644
--- a/talk/media/base/capturemanager_unittest.cc
+++ b/talk/media/base/capturemanager_unittest.cc
@@ -89,6 +89,12 @@
};
// Incorrect use cases.
+TEST_F(CaptureManagerTest, InvalidCallOrder) {
+ // Capturer must be registered before any of these calls.
+ EXPECT_FALSE(capture_manager_.AddVideoRenderer(&video_capturer_,
+ &video_renderer_));
+}
+
TEST_F(CaptureManagerTest, InvalidAddingRemoving) {
EXPECT_FALSE(capture_manager_.StopVideoCapture(&video_capturer_,
cricket::VideoFormat()));
@@ -96,8 +102,7 @@
format_vga_));
EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait);
EXPECT_EQ(1, callback_count());
- // NULL argument currently allowed, and does nothing.
- capture_manager_.AddVideoSink(&video_capturer_, NULL);
+ EXPECT_FALSE(capture_manager_.AddVideoRenderer(&video_capturer_, NULL));
EXPECT_TRUE(capture_manager_.StopVideoCapture(&video_capturer_, format_vga_));
}
@@ -107,7 +112,8 @@
format_vga_));
EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait);
EXPECT_EQ(1, callback_count());
- capture_manager_.AddVideoSink(&video_capturer_, &video_renderer_);
+ EXPECT_TRUE(capture_manager_.AddVideoRenderer(&video_capturer_,
+ &video_renderer_));
EXPECT_TRUE(video_capturer_.CaptureFrame());
EXPECT_EQ(1, NumFramesRendered());
// Renderer should be fed frames with the resolution of format_vga_.
@@ -136,7 +142,8 @@
format_qvga_));
EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_,
format_vga_));
- capture_manager_.AddVideoSink(&video_capturer_, &video_renderer_);
+ EXPECT_TRUE(capture_manager_.AddVideoRenderer(&video_capturer_,
+ &video_renderer_));
EXPECT_EQ_WAIT(1, callback_count(), kMsCallbackWait);
EXPECT_TRUE(video_capturer_.CaptureFrame());
EXPECT_EQ(1, NumFramesRendered());
@@ -157,7 +164,8 @@
format_qvga_));
EXPECT_EQ_WAIT(cricket::CS_RUNNING, capture_state(), kMsCallbackWait);
EXPECT_EQ(1, callback_count());
- capture_manager_.AddVideoSink(&video_capturer_, &video_renderer_);
+ EXPECT_TRUE(capture_manager_.AddVideoRenderer(&video_capturer_,
+ &video_renderer_));
// Ensure that a frame can be captured when two start calls have been made.
EXPECT_TRUE(video_capturer_.CaptureFrame());
EXPECT_EQ(1, NumFramesRendered());
@@ -181,7 +189,8 @@
TEST_F(CaptureManagerTest, TestForceRestart) {
EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_,
format_qvga_));
- capture_manager_.AddVideoSink(&video_capturer_, &video_renderer_);
+ EXPECT_TRUE(capture_manager_.AddVideoRenderer(&video_capturer_,
+ &video_renderer_));
EXPECT_EQ_WAIT(1, callback_count(), kMsCallbackWait);
EXPECT_TRUE(video_capturer_.CaptureFrame());
EXPECT_EQ(1, NumFramesRendered());
@@ -200,7 +209,8 @@
TEST_F(CaptureManagerTest, TestRequestRestart) {
EXPECT_TRUE(capture_manager_.StartVideoCapture(&video_capturer_,
format_vga_));
- capture_manager_.AddVideoSink(&video_capturer_, &video_renderer_);
+ EXPECT_TRUE(capture_manager_.AddVideoRenderer(&video_capturer_,
+ &video_renderer_));
EXPECT_EQ_WAIT(1, callback_count(), kMsCallbackWait);
EXPECT_TRUE(video_capturer_.CaptureFrame());
EXPECT_EQ(1, NumFramesRendered());
« no previous file with comments | « talk/media/base/capturemanager.cc ('k') | talk/media/base/capturerenderadapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698