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

Unified Diff: webrtc/api/remotevideocapturer_unittest.cc

Issue 1765423005: Change VideoRtpReceiver to create remote VideoTrack and VideoTrackSource. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed up the comments. Created 4 years, 9 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 | « webrtc/api/remotevideocapturer.cc ('k') | webrtc/api/rtpreceiver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/remotevideocapturer_unittest.cc
diff --git a/webrtc/api/remotevideocapturer_unittest.cc b/webrtc/api/remotevideocapturer_unittest.cc
deleted file mode 100644
index 6478d214c4e4ccd63a65641a35a13bc7d7b860d4..0000000000000000000000000000000000000000
--- a/webrtc/api/remotevideocapturer_unittest.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2013 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include <string>
-
-#include "webrtc/api/remotevideocapturer.h"
-#include "webrtc/base/gunit.h"
-#include "webrtc/media/engine/webrtcvideoframe.h"
-
-using cricket::CaptureState;
-using cricket::VideoCapturer;
-using cricket::VideoFormat;
-using cricket::VideoFormatPod;
-using cricket::VideoFrame;
-
-static const int kMaxWaitMs = 1000;
-static const VideoFormatPod kTestFormat =
- {640, 480, FPS_TO_INTERVAL(30), cricket::FOURCC_ANY};
-
-class RemoteVideoCapturerTest : public testing::Test,
- public sigslot::has_slots<> {
- protected:
- RemoteVideoCapturerTest()
- : captured_frame_num_(0),
- capture_state_(cricket::CS_STOPPED) {}
-
- virtual void SetUp() {
- capturer_.SignalStateChange.connect(
- this, &RemoteVideoCapturerTest::OnStateChange);
- }
-
- ~RemoteVideoCapturerTest() {
- capturer_.SignalStateChange.disconnect(this);
- }
-
- int captured_frame_num() const {
- return captured_frame_num_;
- }
-
- CaptureState capture_state() const {
- return capture_state_;
- }
-
- webrtc::RemoteVideoCapturer capturer_;
-
- private:
- void OnStateChange(VideoCapturer* capturer,
- CaptureState capture_state) {
- EXPECT_EQ(&capturer_, capturer);
- capture_state_ = capture_state;
- }
-
- int captured_frame_num_;
- CaptureState capture_state_;
-};
-
-TEST_F(RemoteVideoCapturerTest, StartStop) {
- // Start
- EXPECT_TRUE(
- capturer_.StartCapturing(VideoFormat(kTestFormat)));
- EXPECT_TRUE_WAIT((cricket::CS_RUNNING == capture_state()), kMaxWaitMs);
- EXPECT_EQ(VideoFormat(kTestFormat),
- *capturer_.GetCaptureFormat());
- EXPECT_TRUE(capturer_.IsRunning());
-
- // Stop
- capturer_.Stop();
- EXPECT_TRUE_WAIT((cricket::CS_STOPPED == capture_state()), kMaxWaitMs);
- EXPECT_TRUE(NULL == capturer_.GetCaptureFormat());
-}
-
-TEST_F(RemoteVideoCapturerTest, GetPreferredFourccs) {
- EXPECT_FALSE(capturer_.GetPreferredFourccs(NULL));
-
- std::vector<uint32_t> fourccs;
- EXPECT_TRUE(capturer_.GetPreferredFourccs(&fourccs));
- EXPECT_EQ(1u, fourccs.size());
- EXPECT_EQ(cricket::FOURCC_I420, fourccs.at(0));
-}
-
-TEST_F(RemoteVideoCapturerTest, GetBestCaptureFormat) {
- VideoFormat desired = VideoFormat(kTestFormat);
- EXPECT_FALSE(capturer_.GetBestCaptureFormat(desired, NULL));
-
- VideoFormat expected_format = VideoFormat(kTestFormat);
- expected_format.fourcc = cricket::FOURCC_I420;
- VideoFormat best_format;
- EXPECT_TRUE(capturer_.GetBestCaptureFormat(desired, &best_format));
- EXPECT_EQ(expected_format, best_format);
-}
« no previous file with comments | « webrtc/api/remotevideocapturer.cc ('k') | webrtc/api/rtpreceiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698