| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 | 10 |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 class StatsCollectorTest : public testing::Test { | 501 class StatsCollectorTest : public testing::Test { |
| 502 protected: | 502 protected: |
| 503 StatsCollectorTest() | 503 StatsCollectorTest() |
| 504 : worker_thread_(rtc::Thread::Current()), | 504 : worker_thread_(rtc::Thread::Current()), |
| 505 network_thread_(rtc::Thread::Current()), | 505 network_thread_(rtc::Thread::Current()), |
| 506 media_engine_(new cricket::FakeMediaEngine()), | 506 media_engine_(new cricket::FakeMediaEngine()), |
| 507 channel_manager_(new cricket::ChannelManager( | 507 channel_manager_(new cricket::ChannelManager( |
| 508 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), | 508 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), |
| 509 worker_thread_, | 509 worker_thread_, |
| 510 network_thread_)), | 510 network_thread_)), |
| 511 media_controller_( | 511 |
| 512 webrtc::MediaControllerInterface::Create(cricket::MediaConfig(), | 512 session_(channel_manager_.get(), cricket::MediaConfig()) { |
| 513 worker_thread_, | |
| 514 channel_manager_.get(), | |
| 515 &event_log_)), | |
| 516 session_(media_controller_.get()) { | |
| 517 // By default, we ignore session GetStats calls. | 513 // By default, we ignore session GetStats calls. |
| 518 EXPECT_CALL(session_, GetStats(_)).WillRepeatedly(ReturnNull()); | 514 EXPECT_CALL(session_, GetStats(_)).WillRepeatedly(ReturnNull()); |
| 519 // Add default returns for mock classes. | 515 // Add default returns for mock classes. |
| 520 EXPECT_CALL(session_, video_channel()).WillRepeatedly(ReturnNull()); | 516 EXPECT_CALL(session_, video_channel()).WillRepeatedly(ReturnNull()); |
| 521 EXPECT_CALL(session_, voice_channel()).WillRepeatedly(ReturnNull()); | 517 EXPECT_CALL(session_, voice_channel()).WillRepeatedly(ReturnNull()); |
| 522 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_)); | 518 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_)); |
| 523 EXPECT_CALL(pc_, sctp_data_channels()) | 519 EXPECT_CALL(pc_, sctp_data_channels()) |
| 524 .WillRepeatedly(ReturnRef(data_channels_)); | 520 .WillRepeatedly(ReturnRef(data_channels_)); |
| 525 EXPECT_CALL(pc_, GetSenders()).WillRepeatedly(Return( | 521 EXPECT_CALL(pc_, GetSenders()).WillRepeatedly(Return( |
| 526 std::vector<rtc::scoped_refptr<RtpSenderInterface>>())); | 522 std::vector<rtc::scoped_refptr<RtpSenderInterface>>())); |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 EXPECT_EQ(rtc::SrtpCryptoSuiteToName(rtc::SRTP_AES128_CM_SHA1_80), | 773 EXPECT_EQ(rtc::SrtpCryptoSuiteToName(rtc::SRTP_AES128_CM_SHA1_80), |
| 778 srtp_crypto_suite); | 774 srtp_crypto_suite); |
| 779 } | 775 } |
| 780 | 776 |
| 781 webrtc::RtcEventLogNullImpl event_log_; | 777 webrtc::RtcEventLogNullImpl event_log_; |
| 782 rtc::Thread* const worker_thread_; | 778 rtc::Thread* const worker_thread_; |
| 783 rtc::Thread* const network_thread_; | 779 rtc::Thread* const network_thread_; |
| 784 // |media_engine_| is actually owned by |channel_manager_|. | 780 // |media_engine_| is actually owned by |channel_manager_|. |
| 785 cricket::FakeMediaEngine* media_engine_; | 781 cricket::FakeMediaEngine* media_engine_; |
| 786 std::unique_ptr<cricket::ChannelManager> channel_manager_; | 782 std::unique_ptr<cricket::ChannelManager> channel_manager_; |
| 787 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; | |
| 788 MockWebRtcSession session_; | 783 MockWebRtcSession session_; |
| 789 MockPeerConnection pc_; | 784 MockPeerConnection pc_; |
| 790 FakeDataChannelProvider data_channel_provider_; | 785 FakeDataChannelProvider data_channel_provider_; |
| 791 SessionStats session_stats_; | 786 SessionStats session_stats_; |
| 792 rtc::scoped_refptr<webrtc::MediaStream> stream_; | 787 rtc::scoped_refptr<webrtc::MediaStream> stream_; |
| 793 rtc::scoped_refptr<webrtc::VideoTrack> track_; | 788 rtc::scoped_refptr<webrtc::VideoTrack> track_; |
| 794 rtc::scoped_refptr<FakeAudioTrack> audio_track_; | 789 rtc::scoped_refptr<FakeAudioTrack> audio_track_; |
| 795 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; | 790 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; |
| 796 }; | 791 }; |
| 797 | 792 |
| (...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2030 stats.UpdateStats(PeerConnectionInterface::kStatsOutputLevelStandard); | 2025 stats.UpdateStats(PeerConnectionInterface::kStatsOutputLevelStandard); |
| 2031 stats.GetStats(NULL, &reports); | 2026 stats.GetStats(NULL, &reports); |
| 2032 EXPECT_EQ(rtc::ToString(video_receiver_info.frames_decoded), | 2027 EXPECT_EQ(rtc::ToString(video_receiver_info.frames_decoded), |
| 2033 ExtractSsrcStatsValue(reports, | 2028 ExtractSsrcStatsValue(reports, |
| 2034 StatsReport::kStatsValueNameFramesDecoded)); | 2029 StatsReport::kStatsValueNameFramesDecoded)); |
| 2035 EXPECT_EQ(rtc::ToString(*video_receiver_info.qp_sum), | 2030 EXPECT_EQ(rtc::ToString(*video_receiver_info.qp_sum), |
| 2036 ExtractSsrcStatsValue(reports, StatsReport::kStatsValueNameQpSum)); | 2031 ExtractSsrcStatsValue(reports, StatsReport::kStatsValueNameQpSum)); |
| 2037 } | 2032 } |
| 2038 | 2033 |
| 2039 } // namespace webrtc | 2034 } // namespace webrtc |
| OLD | NEW |