Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: webrtc/api/statscollector_unittest.cc

Issue 2353033005: Refactoring: move ownership of RtcEventLog from Call to PeerConnection (Closed)
Patch Set: Moved the constructor Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/rtpsenderreceiver_unittest.cc ('k') | webrtc/api/webrtcsession_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 11 matching lines...) Expand all
22 #include "webrtc/api/peerconnectionfactory.h" 22 #include "webrtc/api/peerconnectionfactory.h"
23 #include "webrtc/api/test/fakedatachannelprovider.h" 23 #include "webrtc/api/test/fakedatachannelprovider.h"
24 #include "webrtc/api/test/fakevideotracksource.h" 24 #include "webrtc/api/test/fakevideotracksource.h"
25 #include "webrtc/api/test/mock_peerconnection.h" 25 #include "webrtc/api/test/mock_peerconnection.h"
26 #include "webrtc/api/test/mock_webrtcsession.h" 26 #include "webrtc/api/test/mock_webrtcsession.h"
27 #include "webrtc/api/videotrack.h" 27 #include "webrtc/api/videotrack.h"
28 #include "webrtc/base/base64.h" 28 #include "webrtc/base/base64.h"
29 #include "webrtc/base/fakesslidentity.h" 29 #include "webrtc/base/fakesslidentity.h"
30 #include "webrtc/base/gunit.h" 30 #include "webrtc/base/gunit.h"
31 #include "webrtc/base/network.h" 31 #include "webrtc/base/network.h"
32 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
32 #include "webrtc/media/base/fakemediaengine.h" 33 #include "webrtc/media/base/fakemediaengine.h"
33 #include "webrtc/media/base/test/mock_mediachannel.h" 34 #include "webrtc/media/base/test/mock_mediachannel.h"
34 #include "webrtc/p2p/base/faketransportcontroller.h" 35 #include "webrtc/p2p/base/faketransportcontroller.h"
35 #include "webrtc/pc/channelmanager.h" 36 #include "webrtc/pc/channelmanager.h"
36 #include "webrtc/test/gmock.h" 37 #include "webrtc/test/gmock.h"
37 #include "webrtc/test/gtest.h" 38 #include "webrtc/test/gtest.h"
38 39
39 using testing::_; 40 using testing::_;
40 using testing::DoAll; 41 using testing::DoAll;
41 using testing::Field; 42 using testing::Field;
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 StatsCollectorTest() 487 StatsCollectorTest()
487 : worker_thread_(rtc::Thread::Current()), 488 : worker_thread_(rtc::Thread::Current()),
488 network_thread_(rtc::Thread::Current()), 489 network_thread_(rtc::Thread::Current()),
489 media_engine_(new cricket::FakeMediaEngine()), 490 media_engine_(new cricket::FakeMediaEngine()),
490 channel_manager_(new cricket::ChannelManager(media_engine_, 491 channel_manager_(new cricket::ChannelManager(media_engine_,
491 worker_thread_, 492 worker_thread_,
492 network_thread_)), 493 network_thread_)),
493 media_controller_( 494 media_controller_(
494 webrtc::MediaControllerInterface::Create(cricket::MediaConfig(), 495 webrtc::MediaControllerInterface::Create(cricket::MediaConfig(),
495 worker_thread_, 496 worker_thread_,
496 channel_manager_.get())), 497 channel_manager_.get(),
498 &event_log_)),
497 session_(media_controller_.get()) { 499 session_(media_controller_.get()) {
498 // By default, we ignore session GetStats calls. 500 // By default, we ignore session GetStats calls.
499 EXPECT_CALL(session_, GetTransportStats(_)).WillRepeatedly(Return(false)); 501 EXPECT_CALL(session_, GetTransportStats(_)).WillRepeatedly(Return(false));
500 // Add default returns for mock classes. 502 // Add default returns for mock classes.
501 EXPECT_CALL(session_, video_channel()).WillRepeatedly(ReturnNull()); 503 EXPECT_CALL(session_, video_channel()).WillRepeatedly(ReturnNull());
502 EXPECT_CALL(session_, voice_channel()).WillRepeatedly(ReturnNull()); 504 EXPECT_CALL(session_, voice_channel()).WillRepeatedly(ReturnNull());
503 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_)); 505 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_));
504 EXPECT_CALL(pc_, sctp_data_channels()) 506 EXPECT_CALL(pc_, sctp_data_channels())
505 .WillRepeatedly(ReturnRef(data_channels_)); 507 .WillRepeatedly(ReturnRef(data_channels_));
506 } 508 }
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 EXPECT_EQ(rtc::SSLStreamAdapter::SslCipherSuiteToName( 746 EXPECT_EQ(rtc::SSLStreamAdapter::SslCipherSuiteToName(
745 internal::TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA), 747 internal::TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA),
746 dtls_cipher_suite); 748 dtls_cipher_suite);
747 std::string srtp_crypto_suite = 749 std::string srtp_crypto_suite =
748 ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports, 750 ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports,
749 StatsReport::kStatsValueNameSrtpCipher); 751 StatsReport::kStatsValueNameSrtpCipher);
750 EXPECT_EQ(rtc::SrtpCryptoSuiteToName(rtc::SRTP_AES128_CM_SHA1_80), 752 EXPECT_EQ(rtc::SrtpCryptoSuiteToName(rtc::SRTP_AES128_CM_SHA1_80),
751 srtp_crypto_suite); 753 srtp_crypto_suite);
752 } 754 }
753 755
756 webrtc::RtcEventLogNullImpl event_log_;
754 rtc::Thread* const worker_thread_; 757 rtc::Thread* const worker_thread_;
755 rtc::Thread* const network_thread_; 758 rtc::Thread* const network_thread_;
756 cricket::FakeMediaEngine* media_engine_; 759 cricket::FakeMediaEngine* media_engine_;
757 std::unique_ptr<cricket::ChannelManager> channel_manager_; 760 std::unique_ptr<cricket::ChannelManager> channel_manager_;
758 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; 761 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_;
759 MockWebRtcSession session_; 762 MockWebRtcSession session_;
760 MockPeerConnection pc_; 763 MockPeerConnection pc_;
761 FakeDataChannelProvider data_channel_provider_; 764 FakeDataChannelProvider data_channel_provider_;
762 SessionStats session_stats_; 765 SessionStats session_stats_;
763 rtc::scoped_refptr<webrtc::MediaStream> stream_; 766 rtc::scoped_refptr<webrtc::MediaStream> stream_;
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 cricket::VoiceSenderInfo new_voice_sender_info; 1885 cricket::VoiceSenderInfo new_voice_sender_info;
1883 InitVoiceSenderInfo(&new_voice_sender_info); 1886 InitVoiceSenderInfo(&new_voice_sender_info);
1884 cricket::VoiceMediaInfo new_stats_read; 1887 cricket::VoiceMediaInfo new_stats_read;
1885 reports.clear(); 1888 reports.clear();
1886 SetupAndVerifyAudioTrackStats( 1889 SetupAndVerifyAudioTrackStats(
1887 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, 1890 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName,
1888 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); 1891 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports);
1889 } 1892 }
1890 1893
1891 } // namespace webrtc 1894 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/rtpsenderreceiver_unittest.cc ('k') | webrtc/api/webrtcsession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698