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(content::WebContents* from_tab, | 132 void NegotiateCall( |
133 content::WebContents* to_tab) const; | 133 content::WebContents* from_tab, |
| 134 content::WebContents* to_tab, |
| 135 const std::string& video_codec = kUseDefaultVideoCodec) const; |
134 | 136 |
135 // Hangs up a negotiated call. | 137 // Hangs up a negotiated call. |
136 void HangUp(content::WebContents* from_tab) const; | 138 void HangUp(content::WebContents* from_tab) const; |
137 | 139 |
138 // 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. |
139 // 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 |
140 // (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). |
141 void DetectErrorsInJavaScript(); | 143 void DetectErrorsInJavaScript(); |
142 | 144 |
143 // 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 13 matching lines...) Expand all Loading... |
157 // Returns true if we're on win 8. | 159 // Returns true if we're on win 8. |
158 bool OnWin8() const; | 160 bool OnWin8() const; |
159 | 161 |
160 void OpenDatabase(content::WebContents* tab) const; | 162 void OpenDatabase(content::WebContents* tab) const; |
161 void CloseDatabase(content::WebContents* tab) const; | 163 void CloseDatabase(content::WebContents* tab) const; |
162 void DeleteDatabase(content::WebContents* tab) const; | 164 void DeleteDatabase(content::WebContents* tab) const; |
163 | 165 |
164 void GenerateAndCloneCertificate(content::WebContents* tab, | 166 void GenerateAndCloneCertificate(content::WebContents* tab, |
165 const std::string& keygen_algorithm) const; | 167 const std::string& keygen_algorithm) const; |
166 | 168 |
167 // Change the default video codec in the offer SDP. | |
168 void SetDefaultVideoCodec(content::WebContents* tab, | |
169 const std::string& video_codec) const; | |
170 | |
171 // Add 'usedtx=1' to the offer SDP. | |
172 void EnableOpusDtx(content::WebContents* tab) const; | |
173 | |
174 private: | 169 private: |
175 void CloseInfoBarInTab(content::WebContents* tab_contents, | 170 void CloseInfoBarInTab(content::WebContents* tab_contents, |
176 infobars::InfoBar* infobar) const; | 171 infobars::InfoBar* infobar) const; |
177 | 172 |
178 std::string CreateLocalOffer(content::WebContents* from_tab) const; | 173 std::string CreateLocalOffer( |
179 std::string CreateAnswer(std::string local_offer, | 174 content::WebContents* from_tab, |
180 content::WebContents* to_tab) const; | 175 std::string default_video_codec = kUseDefaultVideoCodec) const; |
| 176 std::string CreateAnswer( |
| 177 std::string local_offer, |
| 178 content::WebContents* to_tab, |
| 179 std::string default_video_codec = kUseDefaultVideoCodec) const; |
181 void ReceiveAnswer(const std::string& answer, | 180 void ReceiveAnswer(const std::string& answer, |
182 content::WebContents* from_tab) const; | 181 content::WebContents* from_tab) const; |
183 void GatherAndSendIceCandidates(content::WebContents* from_tab, | 182 void GatherAndSendIceCandidates(content::WebContents* from_tab, |
184 content::WebContents* to_tab) const; | 183 content::WebContents* to_tab) const; |
185 | 184 |
186 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 185 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
187 content::WebContents* tab_contents, | 186 content::WebContents* tab_contents, |
188 const std::string& constraints) const; | 187 const std::string& constraints) const; |
189 | 188 |
190 bool detect_errors_in_javascript_; | 189 bool detect_errors_in_javascript_; |
191 | 190 |
192 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 191 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
193 }; | 192 }; |
194 | 193 |
195 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 194 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
OLD | NEW |