OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 |
11 #ifdef HAVE_WEBRTC_VIDEO | 11 #ifdef HAVE_WEBRTC_VIDEO |
12 | 12 |
13 #include <stdio.h> | 13 #include <stdio.h> |
| 14 |
| 15 #include <memory> |
14 #include <vector> | 16 #include <vector> |
| 17 |
15 #include "webrtc/base/gunit.h" | 18 #include "webrtc/base/gunit.h" |
16 #include "webrtc/base/logging.h" | 19 #include "webrtc/base/logging.h" |
17 #include "webrtc/base/stringutils.h" | 20 #include "webrtc/base/stringutils.h" |
18 #include "webrtc/base/thread.h" | 21 #include "webrtc/base/thread.h" |
19 #include "webrtc/media/base/testutils.h" | 22 #include "webrtc/media/base/testutils.h" |
20 #include "webrtc/media/base/videocommon.h" | 23 #include "webrtc/media/base/videocommon.h" |
21 #include "webrtc/media/engine/fakewebrtcvcmfactory.h" | 24 #include "webrtc/media/engine/fakewebrtcvcmfactory.h" |
22 #include "webrtc/media/engine/webrtcvideocapturer.h" | 25 #include "webrtc/media/engine/webrtcvideocapturer.h" |
23 | 26 |
24 using cricket::VideoFormat; | 27 using cricket::VideoFormat; |
(...skipping 14 matching lines...) Expand all Loading... |
39 webrtc::VideoCaptureCapability vga; | 42 webrtc::VideoCaptureCapability vga; |
40 vga.width = 640; | 43 vga.width = 640; |
41 vga.height = 480; | 44 vga.height = 480; |
42 vga.maxFPS = 30; | 45 vga.maxFPS = 30; |
43 vga.rawType = webrtc::kVideoI420; | 46 vga.rawType = webrtc::kVideoI420; |
44 factory_->device_info.AddCapability(kTestDeviceId, vga); | 47 factory_->device_info.AddCapability(kTestDeviceId, vga); |
45 } | 48 } |
46 | 49 |
47 protected: | 50 protected: |
48 FakeWebRtcVcmFactory* factory_; // owned by capturer_ | 51 FakeWebRtcVcmFactory* factory_; // owned by capturer_ |
49 rtc::scoped_ptr<cricket::WebRtcVideoCapturer> capturer_; | 52 std::unique_ptr<cricket::WebRtcVideoCapturer> capturer_; |
50 cricket::VideoCapturerListener listener_; | 53 cricket::VideoCapturerListener listener_; |
51 }; | 54 }; |
52 | 55 |
53 TEST_F(WebRtcVideoCapturerTest, TestNotOpened) { | 56 TEST_F(WebRtcVideoCapturerTest, TestNotOpened) { |
54 EXPECT_EQ("", capturer_->GetId()); | 57 EXPECT_EQ("", capturer_->GetId()); |
55 EXPECT_TRUE(capturer_->GetSupportedFormats()->empty()); | 58 EXPECT_TRUE(capturer_->GetSupportedFormats()->empty()); |
56 EXPECT_TRUE(capturer_->GetCaptureFormat() == NULL); | 59 EXPECT_TRUE(capturer_->GetCaptureFormat() == NULL); |
57 EXPECT_FALSE(capturer_->IsRunning()); | 60 EXPECT_FALSE(capturer_->IsRunning()); |
58 } | 61 } |
59 | 62 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 129 } |
127 | 130 |
128 TEST_F(WebRtcVideoCapturerTest, TestCaptureWithoutInit) { | 131 TEST_F(WebRtcVideoCapturerTest, TestCaptureWithoutInit) { |
129 cricket::VideoFormat format; | 132 cricket::VideoFormat format; |
130 EXPECT_EQ(cricket::CS_NO_DEVICE, capturer_->Start(format)); | 133 EXPECT_EQ(cricket::CS_NO_DEVICE, capturer_->Start(format)); |
131 EXPECT_TRUE(capturer_->GetCaptureFormat() == NULL); | 134 EXPECT_TRUE(capturer_->GetCaptureFormat() == NULL); |
132 EXPECT_FALSE(capturer_->IsRunning()); | 135 EXPECT_FALSE(capturer_->IsRunning()); |
133 } | 136 } |
134 | 137 |
135 #endif // HAVE_WEBRTC_VIDEO | 138 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |