| 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 10 matching lines...) Expand all Loading... |
| 21 #include "webrtc/api/test/mock_peerconnection.h" | 21 #include "webrtc/api/test/mock_peerconnection.h" |
| 22 #include "webrtc/api/test/mock_webrtcsession.h" | 22 #include "webrtc/api/test/mock_webrtcsession.h" |
| 23 #include "webrtc/base/checks.h" | 23 #include "webrtc/base/checks.h" |
| 24 #include "webrtc/base/fakeclock.h" | 24 #include "webrtc/base/fakeclock.h" |
| 25 #include "webrtc/base/gunit.h" | 25 #include "webrtc/base/gunit.h" |
| 26 #include "webrtc/base/logging.h" | 26 #include "webrtc/base/logging.h" |
| 27 #include "webrtc/base/thread_checker.h" | 27 #include "webrtc/base/thread_checker.h" |
| 28 #include "webrtc/base/timedelta.h" | 28 #include "webrtc/base/timedelta.h" |
| 29 #include "webrtc/base/timeutils.h" | 29 #include "webrtc/base/timeutils.h" |
| 30 #include "webrtc/media/base/fakemediaengine.h" | 30 #include "webrtc/media/base/fakemediaengine.h" |
| 31 #include "webrtc/system_wrappers/include/clock.h" |
| 31 | 32 |
| 32 using testing::Return; | 33 using testing::Return; |
| 33 using testing::ReturnRef; | 34 using testing::ReturnRef; |
| 34 | 35 |
| 35 namespace webrtc { | 36 namespace webrtc { |
| 36 | 37 |
| 37 namespace { | 38 namespace { |
| 38 | 39 |
| 39 const int64_t kGetStatsReportTimeoutMs = 1000; | 40 const int64_t kGetStatsReportTimeoutMs = 1000; |
| 40 | 41 |
| 41 class RTCStatsCollectorTestHelper : public SetSessionDescriptionObserver { | 42 class RTCStatsCollectorTestHelper : public SetSessionDescriptionObserver { |
| 42 public: | 43 public: |
| 43 RTCStatsCollectorTestHelper() | 44 RTCStatsCollectorTestHelper() |
| 44 : worker_thread_(rtc::Thread::Current()), | 45 : worker_thread_(rtc::Thread::Current()), |
| 45 network_thread_(rtc::Thread::Current()), | 46 network_thread_(rtc::Thread::Current()), |
| 46 channel_manager_(new cricket::ChannelManager( | 47 channel_manager_( |
| 47 new cricket::FakeMediaEngine(), | 48 new cricket::ChannelManager(new cricket::FakeMediaEngine(), |
| 48 worker_thread_, | 49 worker_thread_, |
| 49 network_thread_)), | 50 network_thread_)), |
| 50 media_controller_( | 51 media_controller_( |
| 51 MediaControllerInterface::Create(cricket::MediaConfig(), | 52 MediaControllerInterface::Create(cricket::MediaConfig(), |
| 52 worker_thread_, | 53 worker_thread_, |
| 53 channel_manager_.get())), | 54 channel_manager_.get(), |
| 55 nullptr /* event_log */)), |
| 54 session_(media_controller_.get()), | 56 session_(media_controller_.get()), |
| 55 pc_() { | 57 pc_() { |
| 56 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_)); | 58 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_)); |
| 57 EXPECT_CALL(pc_, sctp_data_channels()).WillRepeatedly( | 59 EXPECT_CALL(pc_, sctp_data_channels()).WillRepeatedly( |
| 58 ReturnRef(data_channels_)); | 60 ReturnRef(data_channels_)); |
| 59 } | 61 } |
| 60 | 62 |
| 61 rtc::ScopedFakeClock& fake_clock() { return fake_clock_; } | 63 rtc::ScopedFakeClock& fake_clock() { return fake_clock_; } |
| 62 MockWebRtcSession& session() { return session_; } | 64 MockWebRtcSession& session() { return session_; } |
| 63 MockPeerConnection& pc() { return pc_; } | 65 MockPeerConnection& pc() { return pc_; } |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; | 373 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; |
| 372 }; | 374 }; |
| 373 | 375 |
| 374 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { | 376 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { |
| 375 collector_->VerifyThreadUsageAndResultsMerging(); | 377 collector_->VerifyThreadUsageAndResultsMerging(); |
| 376 } | 378 } |
| 377 | 379 |
| 378 } // namespace | 380 } // namespace |
| 379 | 381 |
| 380 } // namespace webrtc | 382 } // namespace webrtc |
| OLD | NEW |