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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( | 280 channel_manager_(new cricket::ChannelManager( |
281 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), | 281 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), |
282 worker_thread_, | 282 worker_thread_, |
283 network_thread_)), | 283 network_thread_)), |
284 media_controller_( | 284 session_(channel_manager_.get(), cricket::MediaConfig()), |
285 MediaControllerInterface::Create(cricket::MediaConfig(), | |
286 worker_thread_, | |
287 channel_manager_.get(), | |
288 &event_log_)), | |
289 session_(media_controller_.get()), | |
290 pc_() { | 285 pc_() { |
291 // Default return values for mocks. | 286 // Default return values for mocks. |
292 EXPECT_CALL(pc_, local_streams()).WillRepeatedly(Return(nullptr)); | 287 EXPECT_CALL(pc_, local_streams()).WillRepeatedly(Return(nullptr)); |
293 EXPECT_CALL(pc_, remote_streams()).WillRepeatedly(Return(nullptr)); | 288 EXPECT_CALL(pc_, remote_streams()).WillRepeatedly(Return(nullptr)); |
294 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_)); | 289 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_)); |
295 EXPECT_CALL(pc_, GetSenders()).WillRepeatedly(Return( | 290 EXPECT_CALL(pc_, GetSenders()).WillRepeatedly(Return( |
296 std::vector<rtc::scoped_refptr<RtpSenderInterface>>())); | 291 std::vector<rtc::scoped_refptr<RtpSenderInterface>>())); |
297 EXPECT_CALL(pc_, GetReceivers()).WillRepeatedly(Return( | 292 EXPECT_CALL(pc_, GetReceivers()).WillRepeatedly(Return( |
298 std::vector<rtc::scoped_refptr<RtpReceiverInterface>>())); | 293 std::vector<rtc::scoped_refptr<RtpReceiverInterface>>())); |
299 EXPECT_CALL(pc_, sctp_data_channels()).WillRepeatedly( | 294 EXPECT_CALL(pc_, sctp_data_channels()).WillRepeatedly( |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 481 |
487 private: | 482 private: |
488 rtc::ScopedFakeClock fake_clock_; | 483 rtc::ScopedFakeClock fake_clock_; |
489 RtcEventLogNullImpl event_log_; | 484 RtcEventLogNullImpl event_log_; |
490 rtc::Thread* const worker_thread_; | 485 rtc::Thread* const worker_thread_; |
491 rtc::Thread* const network_thread_; | 486 rtc::Thread* const network_thread_; |
492 rtc::Thread* const signaling_thread_; | 487 rtc::Thread* const signaling_thread_; |
493 // |media_engine_| is actually owned by |channel_manager_|. | 488 // |media_engine_| is actually owned by |channel_manager_|. |
494 cricket::FakeMediaEngine* media_engine_; | 489 cricket::FakeMediaEngine* media_engine_; |
495 std::unique_ptr<cricket::ChannelManager> channel_manager_; | 490 std::unique_ptr<cricket::ChannelManager> channel_manager_; |
496 std::unique_ptr<MediaControllerInterface> media_controller_; | |
497 MockWebRtcSession session_; | 491 MockWebRtcSession session_; |
498 MockPeerConnection pc_; | 492 MockPeerConnection pc_; |
499 | 493 |
500 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; | 494 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; |
501 std::unique_ptr<cricket::VoiceChannel> voice_channel_; | 495 std::unique_ptr<cricket::VoiceChannel> voice_channel_; |
502 std::unique_ptr<cricket::VideoChannel> video_channel_; | 496 std::unique_ptr<cricket::VideoChannel> video_channel_; |
503 std::unique_ptr<cricket::VoiceMediaInfo> voice_media_info_; | 497 std::unique_ptr<cricket::VoiceMediaInfo> voice_media_info_; |
504 std::unique_ptr<cricket::VideoMediaInfo> video_media_info_; | 498 std::unique_ptr<cricket::VideoMediaInfo> video_media_info_; |
505 std::vector<rtc::scoped_refptr<RtpSenderInterface>> rtp_senders_; | 499 std::vector<rtc::scoped_refptr<RtpSenderInterface>> rtp_senders_; |
506 std::vector<rtc::scoped_refptr<RtpReceiverInterface>> rtp_receivers_; | 500 std::vector<rtc::scoped_refptr<RtpReceiverInterface>> rtp_receivers_; |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2319 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; | 2313 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; |
2320 }; | 2314 }; |
2321 | 2315 |
2322 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { | 2316 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { |
2323 collector_->VerifyThreadUsageAndResultsMerging(); | 2317 collector_->VerifyThreadUsageAndResultsMerging(); |
2324 } | 2318 } |
2325 | 2319 |
2326 } // namespace | 2320 } // namespace |
2327 | 2321 |
2328 } // namespace webrtc | 2322 } // namespace webrtc |
OLD | NEW |