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 |
(...skipping 24 matching lines...) Expand all Loading... |
35 static const uint32_t kVideoSsrc = 98; | 35 static const uint32_t kVideoSsrc = 98; |
36 static const uint32_t kVideoSsrc2 = 100; | 36 static const uint32_t kVideoSsrc2 = 100; |
37 static const uint32_t kAudioSsrc = 99; | 37 static const uint32_t kAudioSsrc = 99; |
38 static const uint32_t kAudioSsrc2 = 101; | 38 static const uint32_t kAudioSsrc2 = 101; |
39 | 39 |
40 namespace webrtc { | 40 namespace webrtc { |
41 | 41 |
42 // Helper class to test RtpSender/RtpReceiver. | 42 // Helper class to test RtpSender/RtpReceiver. |
43 class MockAudioProvider : public AudioProviderInterface { | 43 class MockAudioProvider : public AudioProviderInterface { |
44 public: | 44 public: |
45 ~MockAudioProvider() override {} | 45 // TODO(nisse): Valid overrides commented out, because the gmock |
| 46 // methods don't use any override declarations, and we want to avoid |
| 47 // warnings from -Winconsistent-missing-override. See |
| 48 // http://crbug.com/428099. |
| 49 ~MockAudioProvider() /* override */ {} |
46 | 50 |
47 MOCK_METHOD2(SetAudioPlayout, | 51 MOCK_METHOD2(SetAudioPlayout, |
48 void(uint32_t ssrc, | 52 void(uint32_t ssrc, |
49 bool enable)); | 53 bool enable)); |
50 MOCK_METHOD4(SetAudioSend, | 54 MOCK_METHOD4(SetAudioSend, |
51 void(uint32_t ssrc, | 55 void(uint32_t ssrc, |
52 bool enable, | 56 bool enable, |
53 const cricket::AudioOptions& options, | 57 const cricket::AudioOptions& options, |
54 cricket::AudioSource* source)); | 58 cricket::AudioSource* source)); |
55 MOCK_METHOD2(SetAudioPlayoutVolume, void(uint32_t ssrc, double volume)); | 59 MOCK_METHOD2(SetAudioPlayoutVolume, void(uint32_t ssrc, double volume)); |
56 MOCK_CONST_METHOD1(GetAudioRtpParameters, RtpParameters(uint32_t ssrc)); | 60 MOCK_CONST_METHOD1(GetAudioRtpParameters, RtpParameters(uint32_t ssrc)); |
57 MOCK_METHOD2(SetAudioRtpParameters, | 61 MOCK_METHOD2(SetAudioRtpParameters, |
58 bool(uint32_t ssrc, const RtpParameters&)); | 62 bool(uint32_t ssrc, const RtpParameters&)); |
59 | 63 |
60 void SetRawAudioSink(uint32_t, | 64 void SetRawAudioSink( |
61 rtc::scoped_ptr<AudioSinkInterface> sink) override { | 65 uint32_t, rtc::scoped_ptr<AudioSinkInterface> sink) /* override */ { |
62 sink_ = std::move(sink); | 66 sink_ = std::move(sink); |
63 } | 67 } |
64 | 68 |
65 private: | 69 private: |
66 rtc::scoped_ptr<AudioSinkInterface> sink_; | 70 rtc::scoped_ptr<AudioSinkInterface> sink_; |
67 }; | 71 }; |
68 | 72 |
69 // Helper class to test RtpSender/RtpReceiver. | 73 // Helper class to test RtpSender/RtpReceiver. |
70 class MockVideoProvider : public VideoProviderInterface { | 74 class MockVideoProvider : public VideoProviderInterface { |
71 public: | 75 public: |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 .WillOnce(Return(RtpParameters())); | 501 .WillOnce(Return(RtpParameters())); |
498 EXPECT_CALL(video_provider_, SetVideoRtpParameters(kVideoSsrc, _)) | 502 EXPECT_CALL(video_provider_, SetVideoRtpParameters(kVideoSsrc, _)) |
499 .WillOnce(Return(true)); | 503 .WillOnce(Return(true)); |
500 RtpParameters params = video_rtp_sender_->GetParameters(); | 504 RtpParameters params = video_rtp_sender_->GetParameters(); |
501 EXPECT_TRUE(video_rtp_sender_->SetParameters(params)); | 505 EXPECT_TRUE(video_rtp_sender_->SetParameters(params)); |
502 | 506 |
503 DestroyVideoRtpSender(); | 507 DestroyVideoRtpSender(); |
504 } | 508 } |
505 | 509 |
506 } // namespace webrtc | 510 } // namespace webrtc |
OLD | NEW |