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. | |
74 explicit MockWebRtcSession(webrtc::MediaControllerInterface* media_controller) | 70 explicit MockWebRtcSession(webrtc::MediaControllerInterface* media_controller) |
75 : WebRtcSession(media_controller, | 71 : WebRtcSession(media_controller, |
76 rtc::Thread::Current(), | 72 rtc::Thread::Current(), |
77 rtc::Thread::Current(), | 73 rtc::Thread::Current(), |
78 nullptr) {} | 74 nullptr) {} |
79 MOCK_METHOD0(voice_channel, cricket::VoiceChannel*()); | 75 MOCK_METHOD0(voice_channel, cricket::VoiceChannel*()); |
80 MOCK_METHOD0(video_channel, cricket::VideoChannel*()); | 76 MOCK_METHOD0(video_channel, cricket::VideoChannel*()); |
81 // Libjingle uses "local" for a outgoing track, and "remote" for a incoming | 77 // Libjingle uses "local" for a outgoing track, and "remote" for a incoming |
82 // track. | 78 // track. |
83 MOCK_METHOD2(GetLocalTrackIdBySsrc, bool(uint32_t, std::string*)); | 79 MOCK_METHOD2(GetLocalTrackIdBySsrc, bool(uint32_t, std::string*)); |
84 MOCK_METHOD2(GetRemoteTrackIdBySsrc, bool(uint32_t, std::string*)); | 80 MOCK_METHOD2(GetRemoteTrackIdBySsrc, bool(uint32_t, std::string*)); |
85 MOCK_METHOD1(GetTransportStats, bool(SessionStats*)); | 81 MOCK_METHOD1(GetTransportStats, bool(SessionStats*)); |
86 MOCK_METHOD2(GetLocalCertificate, | 82 MOCK_METHOD2(GetLocalCertificate, |
87 bool(const std::string& transport_name, | 83 bool(const std::string& transport_name, |
88 rtc::scoped_refptr<rtc::RTCCertificate>* certificate)); | 84 rtc::scoped_refptr<rtc::RTCCertificate>* certificate)); |
89 | 85 |
90 // Workaround for gmock's inability to cope with move-only return values. | 86 // Workaround for gmock's inability to cope with move-only return values. |
91 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate( | 87 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate( |
92 const std::string& transport_name) /* override */ { | 88 const std::string& transport_name) override { |
93 return std::unique_ptr<rtc::SSLCertificate>( | 89 return std::unique_ptr<rtc::SSLCertificate>( |
94 GetRemoteSSLCertificate_ReturnsRawPointer(transport_name)); | 90 GetRemoteSSLCertificate_ReturnsRawPointer(transport_name)); |
95 } | 91 } |
96 MOCK_METHOD1(GetRemoteSSLCertificate_ReturnsRawPointer, | 92 MOCK_METHOD1(GetRemoteSSLCertificate_ReturnsRawPointer, |
97 rtc::SSLCertificate*(const std::string& transport_name)); | 93 rtc::SSLCertificate*(const std::string& transport_name)); |
98 }; | 94 }; |
99 | 95 |
100 // The factory isn't really used; it just satisfies the base PeerConnection. | 96 // The factory isn't really used; it just satisfies the base PeerConnection. |
101 class FakePeerConnectionFactory | 97 class FakePeerConnectionFactory |
102 : public rtc::RefCountedObject<PeerConnectionFactory> {}; | 98 : public rtc::RefCountedObject<PeerConnectionFactory> {}; |
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1750 cricket::VoiceSenderInfo new_voice_sender_info; | 1746 cricket::VoiceSenderInfo new_voice_sender_info; |
1751 InitVoiceSenderInfo(&new_voice_sender_info); | 1747 InitVoiceSenderInfo(&new_voice_sender_info); |
1752 cricket::VoiceMediaInfo new_stats_read; | 1748 cricket::VoiceMediaInfo new_stats_read; |
1753 reports.clear(); | 1749 reports.clear(); |
1754 SetupAndVerifyAudioTrackStats( | 1750 SetupAndVerifyAudioTrackStats( |
1755 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, | 1751 new_audio_track.get(), stream_.get(), &stats, &voice_channel, kVcName, |
1756 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); | 1752 media_channel, &new_voice_sender_info, NULL, &new_stats_read, &reports); |
1757 } | 1753 } |
1758 | 1754 |
1759 } // namespace webrtc | 1755 } // namespace webrtc |
OLD | NEW |