Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

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

Issue 2951713002: RTCPeerConnection.addTrack and removeTrack added (behind flag) (Closed)
Patch Set: Addressed deadbeef's comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/media/webrtc/webrtc_browsertest_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 29 matching lines...) Expand all
40 static const char kAudioVideoCallConstraints720p[]; 40 static const char kAudioVideoCallConstraints720p[];
41 41
42 static const char kOkGotStream[]; 42 static const char kOkGotStream[];
43 static const char kFailedWithPermissionDeniedError[]; 43 static const char kFailedWithPermissionDeniedError[];
44 static const char kFailedWithPermissionDismissedError[]; 44 static const char kFailedWithPermissionDismissedError[];
45 45
46 static const char kUseDefaultCertKeygen[]; 46 static const char kUseDefaultCertKeygen[];
47 static const char kUseDefaultAudioCodec[]; 47 static const char kUseDefaultAudioCodec[];
48 static const char kUseDefaultVideoCodec[]; 48 static const char kUseDefaultVideoCodec[];
49 49
50 static const char kUndefined[];
51
52 enum class StreamArgumentType {
53 NO_STREAM,
54 SHARED_STREAM,
55 INDIVIDUAL_STREAMS
56 };
57
50 protected: 58 protected:
51 WebRtcTestBase(); 59 WebRtcTestBase();
52 ~WebRtcTestBase() override; 60 ~WebRtcTestBase() override;
53 61
54 // These all require that the loaded page fulfills the public interface in 62 // These all require that the loaded page fulfills the public interface in
55 // chrome/test/data/webrtc/getusermedia.js. 63 // chrome/test/data/webrtc/getusermedia.js.
56 // If an error is reported back from the getUserMedia call, these functions 64 // If an error is reported back from the getUserMedia call, these functions
57 // will return false. 65 // will return false.
58 // The ...AndAccept()/...AndDeny()/...AndDismiss() functions expect that a 66 // The ...AndAccept()/...AndDeny()/...AndDismiss() functions expect that a
59 // prompt will be shown (i.e. the current origin in the tab_contents doesn't 67 // prompt will be shown (i.e. the current origin in the tab_contents doesn't
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // Add 'usedtx=1' to the offer SDP. 199 // Add 'usedtx=1' to the offer SDP.
192 void EnableOpusDtx(content::WebContents* tab) const; 200 void EnableOpusDtx(content::WebContents* tab) const;
193 201
194 void CreateAndAddStreams(content::WebContents* tab, size_t count) const; 202 void CreateAndAddStreams(content::WebContents* tab, size_t count) const;
195 void VerifyRtpSenders(content::WebContents* tab, 203 void VerifyRtpSenders(content::WebContents* tab,
196 base::Optional<size_t> expected_num_tracks = 204 base::Optional<size_t> expected_num_tracks =
197 base::Optional<size_t>()) const; 205 base::Optional<size_t>()) const;
198 void VerifyRtpReceivers(content::WebContents* tab, 206 void VerifyRtpReceivers(content::WebContents* tab,
199 base::Optional<size_t> expected_num_tracks = 207 base::Optional<size_t> expected_num_tracks =
200 base::Optional<size_t>()) const; 208 base::Optional<size_t>()) const;
209 std::vector<std::string> CreateAndAddAudioAndVideoTrack(
210 content::WebContents* tab,
211 StreamArgumentType stream_argument_type) const;
212 void RemoveTrack(content::WebContents* tab,
213 const std::string& track_id) const;
214 bool HasLocalStreamWithTrack(content::WebContents* tab,
215 const std::string& stream_id,
216 const std::string& track_id) const;
217 bool HasRemoteStreamWithTrack(content::WebContents* tab,
218 const std::string& stream_id,
219 const std::string& track_id) const;
220 bool HasSenderWithTrack(content::WebContents* tab,
221 std::string track_id) const;
222 bool HasReceiverWithTrack(content::WebContents* tab,
223 std::string track_id) const;
224 size_t GetNegotiationNeededCount(content::WebContents* tab) const;
201 225
202 private: 226 private:
203 void CloseInfoBarInTab(content::WebContents* tab_contents, 227 void CloseInfoBarInTab(content::WebContents* tab_contents,
204 infobars::InfoBar* infobar) const; 228 infobars::InfoBar* infobar) const;
205 229
206 std::string CreateLocalOffer(content::WebContents* from_tab) const; 230 std::string CreateLocalOffer(content::WebContents* from_tab) const;
207 std::string CreateAnswer(std::string local_offer, 231 std::string CreateAnswer(std::string local_offer,
208 content::WebContents* to_tab) const; 232 content::WebContents* to_tab) const;
209 void ReceiveAnswer(const std::string& answer, 233 void ReceiveAnswer(const std::string& answer,
210 content::WebContents* from_tab) const; 234 content::WebContents* from_tab) const;
211 void GatherAndSendIceCandidates(content::WebContents* from_tab, 235 void GatherAndSendIceCandidates(content::WebContents* from_tab,
212 content::WebContents* to_tab) const; 236 content::WebContents* to_tab) const;
237 bool HasStreamWithTrack(content::WebContents* tab,
238 const char* function_name,
239 std::string stream_id,
240 std::string track_id) const;
213 241
214 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( 242 infobars::InfoBar* GetUserMediaAndWaitForInfoBar(
215 content::WebContents* tab_contents, 243 content::WebContents* tab_contents,
216 const std::string& constraints) const; 244 const std::string& constraints) const;
217 245
218 bool detect_errors_in_javascript_; 246 bool detect_errors_in_javascript_;
219 247
220 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); 248 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase);
221 }; 249 };
222 250
223 #endif // CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_BASE_H_ 251 #endif // CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_BASE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/webrtc/webrtc_browsertest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698