| 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_WEBRTC_BROWSERTEST_BASE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_BASE_H_ |
| 6 #define CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_BASE_H_ | 6 #define CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_BASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 static const char kVideoCallConstraints720p[]; | 36 static const char kVideoCallConstraints720p[]; |
| 37 static const char kVideoCallConstraints1080p[]; | 37 static const char kVideoCallConstraints1080p[]; |
| 38 static const char kAudioVideoCallConstraints360p[]; | 38 static const char kAudioVideoCallConstraints360p[]; |
| 39 static const char kAudioVideoCallConstraints720p[]; | 39 static const char kAudioVideoCallConstraints720p[]; |
| 40 | 40 |
| 41 static const char kOkGotStream[]; | 41 static const char kOkGotStream[]; |
| 42 static const char kFailedWithPermissionDeniedError[]; | 42 static const char kFailedWithPermissionDeniedError[]; |
| 43 static const char kFailedWithPermissionDismissedError[]; | 43 static const char kFailedWithPermissionDismissedError[]; |
| 44 | 44 |
| 45 static const char kUseDefaultCertKeygen[]; | 45 static const char kUseDefaultCertKeygen[]; |
| 46 static const char kUseDefaultAudioCodec[]; |
| 46 static const char kUseDefaultVideoCodec[]; | 47 static const char kUseDefaultVideoCodec[]; |
| 47 | 48 |
| 48 protected: | 49 protected: |
| 49 WebRtcTestBase(); | 50 WebRtcTestBase(); |
| 50 ~WebRtcTestBase() override; | 51 ~WebRtcTestBase() override; |
| 51 | 52 |
| 52 // These all require that the loaded page fulfills the public interface in | 53 // These all require that the loaded page fulfills the public interface in |
| 53 // chrome/test/data/webrtc/getusermedia.js. | 54 // chrome/test/data/webrtc/getusermedia.js. |
| 54 // If an error is reported back from the getUserMedia call, these functions | 55 // If an error is reported back from the getUserMedia call, these functions |
| 55 // will return false. | 56 // will return false. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 const std::string& keygen_algorithm) const; | 168 const std::string& keygen_algorithm) const; |
| 168 | 169 |
| 169 void VerifyStatsGeneratedCallback(content::WebContents* tab) const; | 170 void VerifyStatsGeneratedCallback(content::WebContents* tab) const; |
| 170 std::vector<std::string> VerifyStatsGeneratedPromise( | 171 std::vector<std::string> VerifyStatsGeneratedPromise( |
| 171 content::WebContents* tab) const; | 172 content::WebContents* tab) const; |
| 172 scoped_refptr<content::TestStatsReportDictionary> GetStatsReportDictionary( | 173 scoped_refptr<content::TestStatsReportDictionary> GetStatsReportDictionary( |
| 173 content::WebContents* tab) const; | 174 content::WebContents* tab) const; |
| 174 std::vector<std::string> GetWhitelistedStatsTypes( | 175 std::vector<std::string> GetWhitelistedStatsTypes( |
| 175 content::WebContents* tab) const; | 176 content::WebContents* tab) const; |
| 176 | 177 |
| 177 // Change the default video codec in the offer SDP. | 178 // Change the default audio/video codec in the offer SDP. |
| 179 void SetDefaultAudioCodec(content::WebContents* tab, |
| 180 const std::string& audio_codec) const; |
| 178 void SetDefaultVideoCodec(content::WebContents* tab, | 181 void SetDefaultVideoCodec(content::WebContents* tab, |
| 179 const std::string& video_codec) const; | 182 const std::string& video_codec) const; |
| 180 | 183 |
| 181 // Add 'usedtx=1' to the offer SDP. | 184 // Add 'usedtx=1' to the offer SDP. |
| 182 void EnableOpusDtx(content::WebContents* tab) const; | 185 void EnableOpusDtx(content::WebContents* tab) const; |
| 183 | 186 |
| 184 private: | 187 private: |
| 185 void CloseInfoBarInTab(content::WebContents* tab_contents, | 188 void CloseInfoBarInTab(content::WebContents* tab_contents, |
| 186 infobars::InfoBar* infobar) const; | 189 infobars::InfoBar* infobar) const; |
| 187 | 190 |
| 188 std::string CreateLocalOffer(content::WebContents* from_tab) const; | 191 std::string CreateLocalOffer(content::WebContents* from_tab) const; |
| 189 std::string CreateAnswer(std::string local_offer, | 192 std::string CreateAnswer(std::string local_offer, |
| 190 content::WebContents* to_tab) const; | 193 content::WebContents* to_tab) const; |
| 191 void ReceiveAnswer(const std::string& answer, | 194 void ReceiveAnswer(const std::string& answer, |
| 192 content::WebContents* from_tab) const; | 195 content::WebContents* from_tab) const; |
| 193 void GatherAndSendIceCandidates(content::WebContents* from_tab, | 196 void GatherAndSendIceCandidates(content::WebContents* from_tab, |
| 194 content::WebContents* to_tab) const; | 197 content::WebContents* to_tab) const; |
| 195 | 198 |
| 196 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 199 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
| 197 content::WebContents* tab_contents, | 200 content::WebContents* tab_contents, |
| 198 const std::string& constraints) const; | 201 const std::string& constraints) const; |
| 199 | 202 |
| 200 bool detect_errors_in_javascript_; | 203 bool detect_errors_in_javascript_; |
| 201 | 204 |
| 202 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 205 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
| 203 }; | 206 }; |
| 204 | 207 |
| 205 #endif // CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_BASE_H_ | 208 #endif // CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_BASE_H_ |
| OLD | NEW |