OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
6 #define CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 6 #define CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 content::WebContents* tab, | 122 content::WebContents* tab, |
123 const std::string& certificate) const; | 123 const std::string& certificate) const; |
124 | 124 |
125 // Exchanges offers and answers between the peer connections in the | 125 // Exchanges offers and answers between the peer connections in the |
126 // respective tabs. Before calling this, you must have prepared peer | 126 // respective tabs. Before calling this, you must have prepared peer |
127 // connections in both tabs and configured them as you like (for instance by | 127 // connections in both tabs and configured them as you like (for instance by |
128 // calling SetupPeerconnectionWithLocalStream). | 128 // calling SetupPeerconnectionWithLocalStream). |
129 // If |video_codec| is not |kUseDefaultVideoCodec|, the SDP offer is modified | 129 // If |video_codec| is not |kUseDefaultVideoCodec|, the SDP offer is modified |
130 // (and SDP answer verified) so that the specified video codec (case-sensitive | 130 // (and SDP answer verified) so that the specified video codec (case-sensitive |
131 // name) is used during the call instead of the default one. | 131 // name) is used during the call instead of the default one. |
132 void NegotiateCall( | 132 void NegotiateCall(content::WebContents* from_tab, |
133 content::WebContents* from_tab, | 133 content::WebContents* to_tab, |
134 content::WebContents* to_tab, | 134 const std::string& video_codec = kUseDefaultVideoCodec, |
135 const std::string& video_codec = kUseDefaultVideoCodec) const; | 135 bool opus_dtx = false) const; |
136 | 136 |
137 // Hangs up a negotiated call. | 137 // Hangs up a negotiated call. |
138 void HangUp(content::WebContents* from_tab) const; | 138 void HangUp(content::WebContents* from_tab) const; |
139 | 139 |
140 // Call this to enable monitoring of javascript errors for this test method. | 140 // Call this to enable monitoring of javascript errors for this test method. |
141 // This will only work if the tests are run sequentially by the test runner | 141 // This will only work if the tests are run sequentially by the test runner |
142 // (i.e. with --test-launcher-developer-mode or --test-launcher-jobs=1). | 142 // (i.e. with --test-launcher-developer-mode or --test-launcher-jobs=1). |
143 void DetectErrorsInJavaScript(); | 143 void DetectErrorsInJavaScript(); |
144 | 144 |
145 // Methods for detecting if video is playing (the loaded page must have | 145 // Methods for detecting if video is playing (the loaded page must have |
(...skipping 19 matching lines...) Expand all Loading... |
165 | 165 |
166 void GenerateAndCloneCertificate(content::WebContents* tab, | 166 void GenerateAndCloneCertificate(content::WebContents* tab, |
167 const std::string& keygen_algorithm) const; | 167 const std::string& keygen_algorithm) const; |
168 | 168 |
169 private: | 169 private: |
170 void CloseInfoBarInTab(content::WebContents* tab_contents, | 170 void CloseInfoBarInTab(content::WebContents* tab_contents, |
171 infobars::InfoBar* infobar) const; | 171 infobars::InfoBar* infobar) const; |
172 | 172 |
173 std::string CreateLocalOffer( | 173 std::string CreateLocalOffer( |
174 content::WebContents* from_tab, | 174 content::WebContents* from_tab, |
175 std::string default_video_codec = kUseDefaultVideoCodec) const; | 175 std::string default_video_codec = kUseDefaultVideoCodec, |
| 176 bool opus_dtx = false) const; |
176 std::string CreateAnswer( | 177 std::string CreateAnswer( |
177 std::string local_offer, | 178 std::string local_offer, |
178 content::WebContents* to_tab, | 179 content::WebContents* to_tab, |
179 std::string default_video_codec = kUseDefaultVideoCodec) const; | 180 std::string default_video_codec = kUseDefaultVideoCodec, |
| 181 bool opus_dtx = false) const; |
180 void ReceiveAnswer(const std::string& answer, | 182 void ReceiveAnswer(const std::string& answer, |
181 content::WebContents* from_tab) const; | 183 content::WebContents* from_tab) const; |
182 void GatherAndSendIceCandidates(content::WebContents* from_tab, | 184 void GatherAndSendIceCandidates(content::WebContents* from_tab, |
183 content::WebContents* to_tab) const; | 185 content::WebContents* to_tab) const; |
184 | 186 |
185 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 187 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
186 content::WebContents* tab_contents, | 188 content::WebContents* tab_contents, |
187 const std::string& constraints) const; | 189 const std::string& constraints) const; |
188 | 190 |
189 bool detect_errors_in_javascript_; | 191 bool detect_errors_in_javascript_; |
190 | 192 |
191 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 193 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
192 }; | 194 }; |
193 | 195 |
194 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 196 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
OLD | NEW |