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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 void SetupPeerconnectionWithLocalStream(content::WebContents* tab) const; |
99 | 99 |
100 // Same as above but does not add the local stream. | 100 // Same as above but does not add the local stream. |
101 void SetupPeerconnectionWithoutLocalStream(content::WebContents* tab) const; | 101 void SetupPeerconnectionWithoutLocalStream(content::WebContents* tab) const; |
102 | 102 |
103 // Exchanges offers and answers between the peer connections in the | 103 // Exchanges offers and answers between the peer connections in the |
104 // respective tabs. Before calling this, you must have prepared peer | 104 // respective tabs. Before calling this, you must have prepared peer |
105 // connections in both tabs and configured them as you like (for instance by | 105 // connections in both tabs and configured them as you like (for instance by |
106 // calling SetupPeerconnectionWithLocalStream). | 106 // calling SetupPeerconnectionWithLocalStream). |
| 107 // 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 |
| 109 // used during the call instead of the default one. |
107 void NegotiateCall(content::WebContents* from_tab, | 110 void NegotiateCall(content::WebContents* from_tab, |
108 content::WebContents* to_tab) const; | 111 content::WebContents* to_tab, |
| 112 const std::string& video_codec = "") const; |
109 | 113 |
110 // Hangs up a negotiated call. | 114 // Hangs up a negotiated call. |
111 void HangUp(content::WebContents* from_tab) const; | 115 void HangUp(content::WebContents* from_tab) const; |
112 | 116 |
113 // Call this to enable monitoring of javascript errors for this test method. | 117 // Call this to enable monitoring of javascript errors for this test method. |
114 // This will only work if the tests are run sequentially by the test runner | 118 // This will only work if the tests are run sequentially by the test runner |
115 // (i.e. with --test-launcher-developer-mode or --test-launcher-jobs=1). | 119 // (i.e. with --test-launcher-developer-mode or --test-launcher-jobs=1). |
116 void DetectErrorsInJavaScript(); | 120 void DetectErrorsInJavaScript(); |
117 | 121 |
118 // Methods for detecting if video is playing (the loaded page must have | 122 // Methods for detecting if video is playing (the loaded page must have |
(...skipping 13 matching lines...) Expand all Loading... |
132 // Returns true if we're on WinXP, that lovely operating system of bliss. | 136 // Returns true if we're on WinXP, that lovely operating system of bliss. |
133 bool OnWinXp() const; | 137 bool OnWinXp() const; |
134 | 138 |
135 // Returns true if we're on win 8. | 139 // Returns true if we're on win 8. |
136 bool OnWin8() const; | 140 bool OnWin8() const; |
137 | 141 |
138 private: | 142 private: |
139 void CloseInfoBarInTab(content::WebContents* tab_contents, | 143 void CloseInfoBarInTab(content::WebContents* tab_contents, |
140 infobars::InfoBar* infobar) const; | 144 infobars::InfoBar* infobar) const; |
141 | 145 |
142 std::string CreateLocalOffer(content::WebContents* from_tab) const; | 146 std::string CreateLocalOffer(content::WebContents* from_tab, |
| 147 std::string default_video_codec = "") const; |
143 std::string CreateAnswer(std::string local_offer, | 148 std::string CreateAnswer(std::string local_offer, |
144 content::WebContents* to_tab) const; | 149 content::WebContents* to_tab, |
| 150 std::string default_video_codec = "") const; |
145 void ReceiveAnswer(const std::string& answer, | 151 void ReceiveAnswer(const std::string& answer, |
146 content::WebContents* from_tab) const; | 152 content::WebContents* from_tab) const; |
147 void GatherAndSendIceCandidates(content::WebContents* from_tab, | 153 void GatherAndSendIceCandidates(content::WebContents* from_tab, |
148 content::WebContents* to_tab) const; | 154 content::WebContents* to_tab) const; |
149 | 155 |
150 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 156 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
151 content::WebContents* tab_contents, | 157 content::WebContents* tab_contents, |
152 const std::string& constraints) const; | 158 const std::string& constraints) const; |
153 | 159 |
154 bool detect_errors_in_javascript_; | 160 bool detect_errors_in_javascript_; |
155 | 161 |
156 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 162 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
157 }; | 163 }; |
158 | 164 |
159 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 165 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
OLD | NEW |