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

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

Issue 1930463002: Replace scoped_ptr with unique_ptr in webrtc/api/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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/rtpsender.h ('k') | webrtc/api/statscollector_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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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
11 #include <memory>
11 #include <string> 12 #include <string>
12 #include <utility> 13 #include <utility>
13 14
14 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
16 #include "webrtc/api/audiotrack.h" 17 #include "webrtc/api/audiotrack.h"
17 #include "webrtc/api/mediastream.h" 18 #include "webrtc/api/mediastream.h"
18 #include "webrtc/api/remoteaudiosource.h" 19 #include "webrtc/api/remoteaudiosource.h"
19 #include "webrtc/api/rtpreceiver.h" 20 #include "webrtc/api/rtpreceiver.h"
20 #include "webrtc/api/rtpsender.h" 21 #include "webrtc/api/rtpsender.h"
(...skipping 30 matching lines...) Expand all
51 void(uint32_t ssrc, 52 void(uint32_t ssrc,
52 bool enable, 53 bool enable,
53 const cricket::AudioOptions& options, 54 const cricket::AudioOptions& options,
54 cricket::AudioSource* source)); 55 cricket::AudioSource* source));
55 MOCK_METHOD2(SetAudioPlayoutVolume, void(uint32_t ssrc, double volume)); 56 MOCK_METHOD2(SetAudioPlayoutVolume, void(uint32_t ssrc, double volume));
56 MOCK_CONST_METHOD1(GetAudioRtpParameters, RtpParameters(uint32_t ssrc)); 57 MOCK_CONST_METHOD1(GetAudioRtpParameters, RtpParameters(uint32_t ssrc));
57 MOCK_METHOD2(SetAudioRtpParameters, 58 MOCK_METHOD2(SetAudioRtpParameters,
58 bool(uint32_t ssrc, const RtpParameters&)); 59 bool(uint32_t ssrc, const RtpParameters&));
59 60
60 void SetRawAudioSink(uint32_t, 61 void SetRawAudioSink(uint32_t,
61 rtc::scoped_ptr<AudioSinkInterface> sink) override { 62 std::unique_ptr<AudioSinkInterface> sink) override {
62 sink_ = std::move(sink); 63 sink_ = std::move(sink);
63 } 64 }
64 65
65 private: 66 private:
66 rtc::scoped_ptr<AudioSinkInterface> sink_; 67 std::unique_ptr<AudioSinkInterface> sink_;
67 }; 68 };
68 69
69 // Helper class to test RtpSender/RtpReceiver. 70 // Helper class to test RtpSender/RtpReceiver.
70 class MockVideoProvider : public VideoProviderInterface { 71 class MockVideoProvider : public VideoProviderInterface {
71 public: 72 public:
72 virtual ~MockVideoProvider() {} 73 virtual ~MockVideoProvider() {}
73 MOCK_METHOD2(SetSource, 74 MOCK_METHOD2(SetSource,
74 bool(uint32_t ssrc, 75 bool(uint32_t ssrc,
75 rtc::VideoSourceInterface<cricket::VideoFrame>* source)); 76 rtc::VideoSourceInterface<cricket::VideoFrame>* source));
76 MOCK_METHOD3(SetVideoPlayout, 77 MOCK_METHOD3(SetVideoPlayout,
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 .WillOnce(Return(RtpParameters())); 498 .WillOnce(Return(RtpParameters()));
498 EXPECT_CALL(video_provider_, SetVideoRtpParameters(kVideoSsrc, _)) 499 EXPECT_CALL(video_provider_, SetVideoRtpParameters(kVideoSsrc, _))
499 .WillOnce(Return(true)); 500 .WillOnce(Return(true));
500 RtpParameters params = video_rtp_sender_->GetParameters(); 501 RtpParameters params = video_rtp_sender_->GetParameters();
501 EXPECT_TRUE(video_rtp_sender_->SetParameters(params)); 502 EXPECT_TRUE(video_rtp_sender_->SetParameters(params));
502 503
503 DestroyVideoRtpSender(); 504 DestroyVideoRtpSender();
504 } 505 }
505 506
506 } // namespace webrtc 507 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/rtpsender.h ('k') | webrtc/api/statscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698