| 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) const; |
| 134 content::WebContents* to_tab, | |
| 135 const std::string& video_codec = kUseDefaultVideoCodec) const; | |
| 136 | 134 |
| 137 // Hangs up a negotiated call. | 135 // Hangs up a negotiated call. |
| 138 void HangUp(content::WebContents* from_tab) const; | 136 void HangUp(content::WebContents* from_tab) const; |
| 139 | 137 |
| 140 // Call this to enable monitoring of javascript errors for this test method. | 138 // 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 | 139 // 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). | 140 // (i.e. with --test-launcher-developer-mode or --test-launcher-jobs=1). |
| 143 void DetectErrorsInJavaScript(); | 141 void DetectErrorsInJavaScript(); |
| 144 | 142 |
| 145 // Methods for detecting if video is playing (the loaded page must have | 143 // Methods for detecting if video is playing (the loaded page must have |
| (...skipping 15 matching lines...) Expand all Loading... |
| 161 | 159 |
| 162 void OpenDatabase(content::WebContents* tab) const; | 160 void OpenDatabase(content::WebContents* tab) const; |
| 163 void CloseDatabase(content::WebContents* tab) const; | 161 void CloseDatabase(content::WebContents* tab) const; |
| 164 void DeleteDatabase(content::WebContents* tab) const; | 162 void DeleteDatabase(content::WebContents* tab) const; |
| 165 | 163 |
| 166 void GenerateAndCloneCertificate(content::WebContents* tab, | 164 void GenerateAndCloneCertificate(content::WebContents* tab, |
| 167 const std::string& keygen_algorithm) const; | 165 const std::string& keygen_algorithm) const; |
| 168 | 166 |
| 169 void VerifyStatsGenerated(content::WebContents* tab) const; | 167 void VerifyStatsGenerated(content::WebContents* tab) const; |
| 170 | 168 |
| 169 // Change the default video codec in the offer SDP. |
| 170 void SetDefaultVideoCodec(content::WebContents* tab, |
| 171 const std::string& video_codec) const; |
| 172 |
| 173 // Add 'usedtx=1' to the offer SDP. |
| 174 void EnableOpusDtx(content::WebContents* tab) const; |
| 175 |
| 171 private: | 176 private: |
| 172 void CloseInfoBarInTab(content::WebContents* tab_contents, | 177 void CloseInfoBarInTab(content::WebContents* tab_contents, |
| 173 infobars::InfoBar* infobar) const; | 178 infobars::InfoBar* infobar) const; |
| 174 | 179 |
| 175 std::string CreateLocalOffer( | 180 std::string CreateLocalOffer(content::WebContents* from_tab) const; |
| 176 content::WebContents* from_tab, | 181 std::string CreateAnswer(std::string local_offer, |
| 177 std::string default_video_codec = kUseDefaultVideoCodec) const; | 182 content::WebContents* to_tab) const; |
| 178 std::string CreateAnswer( | |
| 179 std::string local_offer, | |
| 180 content::WebContents* to_tab, | |
| 181 std::string default_video_codec = kUseDefaultVideoCodec) const; | |
| 182 void ReceiveAnswer(const std::string& answer, | 183 void ReceiveAnswer(const std::string& answer, |
| 183 content::WebContents* from_tab) const; | 184 content::WebContents* from_tab) const; |
| 184 void GatherAndSendIceCandidates(content::WebContents* from_tab, | 185 void GatherAndSendIceCandidates(content::WebContents* from_tab, |
| 185 content::WebContents* to_tab) const; | 186 content::WebContents* to_tab) const; |
| 186 | 187 |
| 187 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 188 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
| 188 content::WebContents* tab_contents, | 189 content::WebContents* tab_contents, |
| 189 const std::string& constraints) const; | 190 const std::string& constraints) const; |
| 190 | 191 |
| 191 bool detect_errors_in_javascript_; | 192 bool detect_errors_in_javascript_; |
| 192 | 193 |
| 193 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 194 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
| 194 }; | 195 }; |
| 195 | 196 |
| 196 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 197 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
| OLD | NEW |