Chromium Code Reviews

Side by Side Diff: chrome/browser/media/webrtc_browsertest_base.h

Issue 2190533002: Adds a WebRTC browser_test with opus dtx enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Last comments by Minyue. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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...)
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 13 matching lines...)
159 // Returns true if we're on win 8. 157 // Returns true if we're on win 8.
160 bool OnWin8() const; 158 bool OnWin8() const;
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
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
169 private: 174 private:
170 void CloseInfoBarInTab(content::WebContents* tab_contents, 175 void CloseInfoBarInTab(content::WebContents* tab_contents,
171 infobars::InfoBar* infobar) const; 176 infobars::InfoBar* infobar) const;
172 177
173 std::string CreateLocalOffer( 178 std::string CreateLocalOffer(content::WebContents* from_tab) const;
174 content::WebContents* from_tab, 179 std::string CreateAnswer(std::string local_offer,
175 std::string default_video_codec = kUseDefaultVideoCodec) const; 180 content::WebContents* to_tab) const;
176 std::string CreateAnswer(
177 std::string local_offer,
178 content::WebContents* to_tab,
179 std::string default_video_codec = kUseDefaultVideoCodec) const;
180 void ReceiveAnswer(const std::string& answer, 181 void ReceiveAnswer(const std::string& answer,
181 content::WebContents* from_tab) const; 182 content::WebContents* from_tab) const;
182 void GatherAndSendIceCandidates(content::WebContents* from_tab, 183 void GatherAndSendIceCandidates(content::WebContents* from_tab,
183 content::WebContents* to_tab) const; 184 content::WebContents* to_tab) const;
184 185
185 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( 186 infobars::InfoBar* GetUserMediaAndWaitForInfoBar(
186 content::WebContents* tab_contents, 187 content::WebContents* tab_contents,
187 const std::string& constraints) const; 188 const std::string& constraints) const;
188 189
189 bool detect_errors_in_javascript_; 190 bool detect_errors_in_javascript_;
190 191
191 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); 192 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase);
192 }; 193 };
193 194
194 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ 195 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc_browsertest.cc ('k') | chrome/browser/media/webrtc_browsertest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine