OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 #ifndef WEBRTC_TEST_CALL_TEST_H_ | 10 #ifndef WEBRTC_TEST_CALL_TEST_H_ |
11 #define WEBRTC_TEST_CALL_TEST_H_ | 11 #define WEBRTC_TEST_CALL_TEST_H_ |
12 | 12 |
13 #include <memory> | 13 #include <memory> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/call/call.h" | 16 #include "webrtc/call/call.h" |
17 #include "webrtc/call/rtp_transport_controller_send.h" | 17 #include "webrtc/call/rtp_transport_controller_send.h" |
18 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 18 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
19 #include "webrtc/test/encoder_settings.h" | 19 #include "webrtc/test/encoder_settings.h" |
20 #include "webrtc/test/fake_audio_device.h" | 20 #include "webrtc/test/fake_audio_device.h" |
21 #include "webrtc/test/fake_decoder.h" | 21 #include "webrtc/test/fake_decoder.h" |
22 #include "webrtc/test/fake_encoder.h" | 22 #include "webrtc/test/fake_encoder.h" |
23 #include "webrtc/test/fake_videorenderer.h" | 23 #include "webrtc/test/fake_videorenderer.h" |
24 #include "webrtc/test/frame_generator_capturer.h" | 24 #include "webrtc/test/frame_generator_capturer.h" |
25 #include "webrtc/test/rtp_rtcp_observer.h" | 25 #include "webrtc/test/rtp_rtcp_observer.h" |
| 26 #include "webrtc/test/single_threaded_task_queue.h" |
26 | 27 |
27 namespace webrtc { | 28 namespace webrtc { |
28 | 29 |
29 class VoEBase; | 30 class VoEBase; |
30 | 31 |
31 namespace test { | 32 namespace test { |
32 | 33 |
33 class BaseTest; | 34 class BaseTest; |
34 | 35 |
35 class CallTest : public ::testing::Test { | 36 class CallTest : public ::testing::Test { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 void DestroyVoiceEngines(); | 156 void DestroyVoiceEngines(); |
156 | 157 |
157 VoiceEngineState voe_send_; | 158 VoiceEngineState voe_send_; |
158 VoiceEngineState voe_recv_; | 159 VoiceEngineState voe_recv_; |
159 rtc::scoped_refptr<AudioProcessing> apm_send_; | 160 rtc::scoped_refptr<AudioProcessing> apm_send_; |
160 rtc::scoped_refptr<AudioProcessing> apm_recv_; | 161 rtc::scoped_refptr<AudioProcessing> apm_recv_; |
161 | 162 |
162 // The audio devices must outlive the voice engines. | 163 // The audio devices must outlive the voice engines. |
163 std::unique_ptr<test::FakeAudioDevice> fake_send_audio_device_; | 164 std::unique_ptr<test::FakeAudioDevice> fake_send_audio_device_; |
164 std::unique_ptr<test::FakeAudioDevice> fake_recv_audio_device_; | 165 std::unique_ptr<test::FakeAudioDevice> fake_recv_audio_device_; |
| 166 |
| 167 protected: |
| 168 SingleThreadedTaskQueue task_queue_; // Should be last, to destruct first. |
165 }; | 169 }; |
166 | 170 |
167 class BaseTest : public RtpRtcpObserver { | 171 class BaseTest : public RtpRtcpObserver { |
168 public: | 172 public: |
169 BaseTest(); | 173 BaseTest(); |
170 explicit BaseTest(unsigned int timeout_ms); | 174 explicit BaseTest(unsigned int timeout_ms); |
171 virtual ~BaseTest(); | 175 virtual ~BaseTest(); |
172 | 176 |
173 virtual void PerformTest() = 0; | 177 virtual void PerformTest() = 0; |
174 virtual bool ShouldCreateReceivers() const = 0; | 178 virtual bool ShouldCreateReceivers() const = 0; |
175 | 179 |
176 virtual size_t GetNumVideoStreams() const; | 180 virtual size_t GetNumVideoStreams() const; |
177 virtual size_t GetNumAudioStreams() const; | 181 virtual size_t GetNumAudioStreams() const; |
178 virtual size_t GetNumFlexfecStreams() const; | 182 virtual size_t GetNumFlexfecStreams() const; |
179 | 183 |
180 virtual std::unique_ptr<FakeAudioDevice::Capturer> CreateCapturer(); | 184 virtual std::unique_ptr<FakeAudioDevice::Capturer> CreateCapturer(); |
181 virtual std::unique_ptr<FakeAudioDevice::Renderer> CreateRenderer(); | 185 virtual std::unique_ptr<FakeAudioDevice::Renderer> CreateRenderer(); |
182 virtual void OnFakeAudioDevicesCreated(FakeAudioDevice* send_audio_device, | 186 virtual void OnFakeAudioDevicesCreated(FakeAudioDevice* send_audio_device, |
183 FakeAudioDevice* recv_audio_device); | 187 FakeAudioDevice* recv_audio_device); |
184 | 188 |
185 virtual Call::Config GetSenderCallConfig(); | 189 virtual Call::Config GetSenderCallConfig(); |
186 virtual Call::Config GetReceiverCallConfig(); | 190 virtual Call::Config GetReceiverCallConfig(); |
187 virtual void OnRtpTransportControllerSendCreated( | 191 virtual void OnRtpTransportControllerSendCreated( |
188 RtpTransportControllerSend* controller); | 192 RtpTransportControllerSend* controller); |
189 virtual void OnCallsCreated(Call* sender_call, Call* receiver_call); | 193 virtual void OnCallsCreated(Call* sender_call, Call* receiver_call); |
190 | 194 |
191 virtual test::PacketTransport* CreateSendTransport(Call* sender_call); | 195 virtual test::PacketTransport* CreateSendTransport( |
192 virtual test::PacketTransport* CreateReceiveTransport(); | 196 SingleThreadedTaskQueue* task_queue, |
| 197 Call* sender_call); |
| 198 virtual test::PacketTransport* CreateReceiveTransport( |
| 199 SingleThreadedTaskQueue* task_queue); |
193 | 200 |
194 virtual void ModifyVideoConfigs( | 201 virtual void ModifyVideoConfigs( |
195 VideoSendStream::Config* send_config, | 202 VideoSendStream::Config* send_config, |
196 std::vector<VideoReceiveStream::Config>* receive_configs, | 203 std::vector<VideoReceiveStream::Config>* receive_configs, |
197 VideoEncoderConfig* encoder_config); | 204 VideoEncoderConfig* encoder_config); |
198 virtual void ModifyVideoCaptureStartResolution(int* width, | 205 virtual void ModifyVideoCaptureStartResolution(int* width, |
199 int* heigt, | 206 int* heigt, |
200 int* frame_rate); | 207 int* frame_rate); |
201 virtual void OnVideoStreamsCreated( | 208 virtual void OnVideoStreamsCreated( |
202 VideoSendStream* send_stream, | 209 VideoSendStream* send_stream, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 EndToEndTest(); | 241 EndToEndTest(); |
235 explicit EndToEndTest(unsigned int timeout_ms); | 242 explicit EndToEndTest(unsigned int timeout_ms); |
236 | 243 |
237 bool ShouldCreateReceivers() const override; | 244 bool ShouldCreateReceivers() const override; |
238 }; | 245 }; |
239 | 246 |
240 } // namespace test | 247 } // namespace test |
241 } // namespace webrtc | 248 } // namespace webrtc |
242 | 249 |
243 #endif // WEBRTC_TEST_CALL_TEST_H_ | 250 #endif // WEBRTC_TEST_CALL_TEST_H_ |
OLD | NEW |