OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 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 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 return receiver; | 270 return receiver; |
271 } | 271 } |
272 | 272 |
273 class RTCStatsCollectorTestHelper : public SetSessionDescriptionObserver { | 273 class RTCStatsCollectorTestHelper : public SetSessionDescriptionObserver { |
274 public: | 274 public: |
275 RTCStatsCollectorTestHelper() | 275 RTCStatsCollectorTestHelper() |
276 : worker_thread_(rtc::Thread::Current()), | 276 : worker_thread_(rtc::Thread::Current()), |
277 network_thread_(rtc::Thread::Current()), | 277 network_thread_(rtc::Thread::Current()), |
278 signaling_thread_(rtc::Thread::Current()), | 278 signaling_thread_(rtc::Thread::Current()), |
279 media_engine_(new cricket::FakeMediaEngine()), | 279 media_engine_(new cricket::FakeMediaEngine()), |
280 channel_manager_(new cricket::ChannelManager(media_engine_, | 280 channel_manager_(new cricket::ChannelManager( |
281 worker_thread_, | 281 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), |
282 network_thread_)), | 282 worker_thread_, |
| 283 network_thread_)), |
283 media_controller_( | 284 media_controller_( |
284 MediaControllerInterface::Create(cricket::MediaConfig(), | 285 MediaControllerInterface::Create(cricket::MediaConfig(), |
285 worker_thread_, | 286 worker_thread_, |
286 channel_manager_.get(), | 287 channel_manager_.get(), |
287 &event_log_)), | 288 &event_log_)), |
288 session_(media_controller_.get()), | 289 session_(media_controller_.get()), |
289 pc_() { | 290 pc_() { |
290 // Default return values for mocks. | 291 // Default return values for mocks. |
291 EXPECT_CALL(pc_, local_streams()).WillRepeatedly(Return(nullptr)); | 292 EXPECT_CALL(pc_, local_streams()).WillRepeatedly(Return(nullptr)); |
292 EXPECT_CALL(pc_, remote_streams()).WillRepeatedly(Return(nullptr)); | 293 EXPECT_CALL(pc_, remote_streams()).WillRepeatedly(Return(nullptr)); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 EXPECT_CALL(*video_media_channel, GetStats(_)) | 483 EXPECT_CALL(*video_media_channel, GetStats(_)) |
483 .WillOnce(DoAll(SetArgPointee<0>(*video_media_info_), Return(true))); | 484 .WillOnce(DoAll(SetArgPointee<0>(*video_media_info_), Return(true))); |
484 } | 485 } |
485 | 486 |
486 private: | 487 private: |
487 rtc::ScopedFakeClock fake_clock_; | 488 rtc::ScopedFakeClock fake_clock_; |
488 RtcEventLogNullImpl event_log_; | 489 RtcEventLogNullImpl event_log_; |
489 rtc::Thread* const worker_thread_; | 490 rtc::Thread* const worker_thread_; |
490 rtc::Thread* const network_thread_; | 491 rtc::Thread* const network_thread_; |
491 rtc::Thread* const signaling_thread_; | 492 rtc::Thread* const signaling_thread_; |
| 493 // |media_engine_| is actually owned by |channel_manager_|. |
492 cricket::FakeMediaEngine* media_engine_; | 494 cricket::FakeMediaEngine* media_engine_; |
493 std::unique_ptr<cricket::ChannelManager> channel_manager_; | 495 std::unique_ptr<cricket::ChannelManager> channel_manager_; |
494 std::unique_ptr<MediaControllerInterface> media_controller_; | 496 std::unique_ptr<MediaControllerInterface> media_controller_; |
495 MockWebRtcSession session_; | 497 MockWebRtcSession session_; |
496 MockPeerConnection pc_; | 498 MockPeerConnection pc_; |
497 | 499 |
498 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; | 500 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; |
499 std::unique_ptr<cricket::VoiceChannel> voice_channel_; | 501 std::unique_ptr<cricket::VoiceChannel> voice_channel_; |
500 std::unique_ptr<cricket::VideoChannel> video_channel_; | 502 std::unique_ptr<cricket::VideoChannel> video_channel_; |
501 std::unique_ptr<cricket::VoiceMediaInfo> voice_media_info_; | 503 std::unique_ptr<cricket::VoiceMediaInfo> voice_media_info_; |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; | 2267 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; |
2266 }; | 2268 }; |
2267 | 2269 |
2268 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { | 2270 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { |
2269 collector_->VerifyThreadUsageAndResultsMerging(); | 2271 collector_->VerifyThreadUsageAndResultsMerging(); |
2270 } | 2272 } |
2271 | 2273 |
2272 } // namespace | 2274 } // namespace |
2273 | 2275 |
2274 } // namespace webrtc | 2276 } // namespace webrtc |
OLD | NEW |