Chromium Code Reviews| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 content::WebContents* OpenPageAndAcceptUserMedia(const GURL& url) const; | 88 content::WebContents* OpenPageAndAcceptUserMedia(const GURL& url) const; |
| 89 | 89 |
| 90 // Closes the last local stream acquired by the GetUserMedia* methods. | 90 // Closes the last local stream acquired by the GetUserMedia* methods. |
| 91 void CloseLastLocalStream(content::WebContents* tab_contents) const; | 91 void CloseLastLocalStream(content::WebContents* tab_contents) const; |
| 92 | 92 |
| 93 std::string ExecuteJavascript(const std::string& javascript, | 93 std::string ExecuteJavascript(const std::string& javascript, |
| 94 content::WebContents* tab_contents) const; | 94 content::WebContents* tab_contents) const; |
| 95 | 95 |
| 96 // Sets up a peer connection in the tab and adds the current local stream | 96 // Sets up a peer connection in the tab and adds the current local stream |
| 97 // (which you can prepare by calling one of the GetUserMedia* methods above). | 97 // (which you can prepare by calling one of the GetUserMedia* methods above). |
| 98 void SetupPeerconnectionWithLocalStream(content::WebContents* tab) const; | 98 // Optionally, |certificate_keygen_algorithm| is JavaScript for an |
| 99 // |AlgorithmIdentifier| to be used as parameter to | |
| 100 // |RTCPeerConnection.generateCertificate|. The resulting certificate will be | |
| 101 // used by the peer connection, otherwise a default certificate is used. | |
| 102 void SetupPeerconnectionWithLocalStream( | |
| 103 content::WebContents* tab, | |
| 104 std::string certificate_keygen_algorithm = "") const; | |
|
phoglund_chromium
2016/04/26 11:54:20
I was sure default arguments were banned, but they
hbos_chromium
2016/04/27 11:19:03
Acknowledged.
| |
| 99 | 105 |
| 100 // Same as above but does not add the local stream. | 106 // Same as above but does not add the local stream. |
| 101 void SetupPeerconnectionWithoutLocalStream(content::WebContents* tab) const; | 107 void SetupPeerconnectionWithoutLocalStream( |
| 108 content::WebContents* tab, | |
| 109 std::string certificate_keygen_algorithm = "") const; | |
| 102 | 110 |
| 103 // Exchanges offers and answers between the peer connections in the | 111 // Exchanges offers and answers between the peer connections in the |
| 104 // respective tabs. Before calling this, you must have prepared peer | 112 // respective tabs. Before calling this, you must have prepared peer |
| 105 // connections in both tabs and configured them as you like (for instance by | 113 // connections in both tabs and configured them as you like (for instance by |
| 106 // calling SetupPeerconnectionWithLocalStream). | 114 // calling SetupPeerconnectionWithLocalStream). |
| 107 // If |video_codec| is a non-empty string, the SDP offer is modified (and SDP | 115 // If |video_codec| is a non-empty string, the SDP offer is modified (and SDP |
| 108 // answer verified) so that the specified video codec (case-sensitive name) is | 116 // answer verified) so that the specified video codec (case-sensitive name) is |
| 109 // used during the call instead of the default one. | 117 // used during the call instead of the default one. |
| 110 void NegotiateCall(content::WebContents* from_tab, | 118 void NegotiateCall(content::WebContents* from_tab, |
| 111 content::WebContents* to_tab, | 119 content::WebContents* to_tab, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 164 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
| 157 content::WebContents* tab_contents, | 165 content::WebContents* tab_contents, |
| 158 const std::string& constraints) const; | 166 const std::string& constraints) const; |
| 159 | 167 |
| 160 bool detect_errors_in_javascript_; | 168 bool detect_errors_in_javascript_; |
| 161 | 169 |
| 162 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 170 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
| 163 }; | 171 }; |
| 164 | 172 |
| 165 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 173 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
| OLD | NEW |