OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |