OLD | NEW |
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // Error return values | 60 // Error return values |
61 const char kNotFound[] = "NOT FOUND"; | 61 const char kNotFound[] = "NOT FOUND"; |
62 | 62 |
63 // Constant names for track identification. | 63 // Constant names for track identification. |
64 const char kLocalTrackId[] = "local_track_id"; | 64 const char kLocalTrackId[] = "local_track_id"; |
65 const char kRemoteTrackId[] = "remote_track_id"; | 65 const char kRemoteTrackId[] = "remote_track_id"; |
66 const uint32_t kSsrcOfTrack = 1234; | 66 const uint32_t kSsrcOfTrack = 1234; |
67 | 67 |
68 class MockWebRtcSession : public webrtc::WebRtcSession { | 68 class MockWebRtcSession : public webrtc::WebRtcSession { |
69 public: | 69 public: |
| 70 // TODO(nisse): Valid overrides commented out, because the gmock |
| 71 // methods don't use any override declarations, and we want to avoid |
| 72 // warnings from -Winconsistent-missing-override. See |
| 73 // http://crbug.com/428099. |
70 explicit MockWebRtcSession(webrtc::MediaControllerInterface* media_controller) | 74 explicit MockWebRtcSession(webrtc::MediaControllerInterface* media_controller) |
71 : WebRtcSession(media_controller, | 75 : WebRtcSession(media_controller, |
72 rtc::Thread::Current(), | 76 rtc::Thread::Current(), |
73 rtc::Thread::Current(), | 77 rtc::Thread::Current(), |
74 nullptr) {} | 78 nullptr) {} |
75 MOCK_METHOD0(voice_channel, cricket::VoiceChannel*()); | 79 MOCK_METHOD0(voice_channel, cricket::VoiceChannel*()); |
76 MOCK_METHOD0(video_channel, cricket::VideoChannel*()); | 80 MOCK_METHOD0(video_channel, cricket::VideoChannel*()); |
77 // Libjingle uses "local" for a outgoing track, and "remote" for a incoming | 81 // Libjingle uses "local" for a outgoing track, and "remote" for a incoming |
78 // track. | 82 // track. |
79 MOCK_METHOD2(GetLocalTrackIdBySsrc, bool(uint32_t, std::string*)); | 83 MOCK_METHOD2(GetLocalTrackIdBySsrc, bool(uint32_t, std::string*)); |
80 MOCK_METHOD2(GetRemoteTrackIdBySsrc, bool(uint32_t, std::string*)); | 84 MOCK_METHOD2(GetRemoteTrackIdBySsrc, bool(uint32_t, std::string*)); |
81 MOCK_METHOD1(GetTransportStats, bool(SessionStats*)); | 85 MOCK_METHOD1(GetTransportStats, bool(SessionStats*)); |
82 MOCK_METHOD2(GetLocalCertificate, | 86 MOCK_METHOD2(GetLocalCertificate, |
83 bool(const std::string& transport_name, | 87 bool(const std::string& transport_name, |
84 rtc::scoped_refptr<rtc::RTCCertificate>* certificate)); | 88 rtc::scoped_refptr<rtc::RTCCertificate>* certificate)); |
85 | 89 |
86 // Workaround for gmock's inability to cope with move-only return values. | 90 // Workaround for gmock's inability to cope with move-only return values. |
87 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate( | 91 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate( |
88 const std::string& transport_name) override { | 92 const std::string& transport_name) /* override */ { |
89 return std::unique_ptr<rtc::SSLCertificate>( | 93 return std::unique_ptr<rtc::SSLCertificate>( |
90 GetRemoteSSLCertificate_ReturnsRawPointer(transport_name)); | 94 GetRemoteSSLCertificate_ReturnsRawPointer(transport_name)); |
91 } | 95 } |
92 MOCK_METHOD1(GetRemoteSSLCertificate_ReturnsRawPointer, | 96 MOCK_METHOD1(GetRemoteSSLCertificate_ReturnsRawPointer, |
93 rtc::SSLCertificate*(const std::string& transport_name)); | 97 rtc::SSLCertificate*(const std::string& transport_name)); |
94 }; | 98 }; |
95 | 99 |
96 // The factory isn't really used; it just satisfies the base PeerConnection. | 100 // The factory isn't really used; it just satisfies the base PeerConnection. |
97 class FakePeerConnectionFactory | 101 class FakePeerConnectionFactory |
98 : public rtc::RefCountedObject<PeerConnectionFactory> {}; | 102 : public rtc::RefCountedObject<PeerConnectionFactory> {}; |
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 cricket::VoiceSenderInfo new_voice_sender_info; | 1750 cricket::VoiceSenderInfo new_voice_sender_info; |
1747 InitVoiceSenderInfo(&new_voice_sender_info); | 1751 InitVoiceSenderInfo(&new_voice_sender_info); |
1748 cricket::VoiceMediaInfo new_stats_read; | 1752 cricket::VoiceMediaInfo new_stats_read; |
1749 reports.clear(); | 1753 reports.clear(); |
1750 SetupAndVerifyAudioTrackStats( | 1754 SetupAndVerifyAudioTrackStats( |
1751 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, | 1755 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, |
1752 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); | 1756 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); |
1753 } | 1757 } |
1754 | 1758 |
1755 } // namespace webrtc | 1759 } // namespace webrtc |
OLD | NEW |