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

Side by Side Diff: webrtc/pc/rtcstatscollector_unittest.cc

Issue 2685093002: Switching some interfaces to use std::unique_ptr<>. (Closed)
Patch Set: Rebase onto master Created 3 years, 10 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
OLDNEW
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
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
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 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after
2320 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; 2322 rtc::scoped_refptr<FakeRTCStatsCollector> collector_;
2321 }; 2323 };
2322 2324
2323 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { 2325 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) {
2324 collector_->VerifyThreadUsageAndResultsMerging(); 2326 collector_->VerifyThreadUsageAndResultsMerging();
2325 } 2327 }
2326 2328
2327 } // namespace 2329 } // namespace
2328 2330
2329 } // namespace webrtc 2331 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698