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

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

Issue 271653002: Rewrote WebRTC browser tests to not use peerconnection_server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit fixes Created 6 years, 7 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 | Annotate | Revision Log
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 "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 content::WebContents* OpenTestPageAndGetUserMediaInNewTab( 67 content::WebContents* OpenTestPageAndGetUserMediaInNewTab(
68 const std::string& test_page) const; 68 const std::string& test_page) const;
69 69
70 // Opens the page at |url| where getUserMedia has been invoked through other 70 // Opens the page at |url| where getUserMedia has been invoked through other
71 // means and accepts the user media request. 71 // means and accepts the user media request.
72 content::WebContents* OpenPageAndAcceptUserMedia(const GURL& url) const; 72 content::WebContents* OpenPageAndAcceptUserMedia(const GURL& url) const;
73 73
74 // Closes the last local stream acquired by the GetUserMedia* methods. 74 // Closes the last local stream acquired by the GetUserMedia* methods.
75 void CloseLastLocalStream(content::WebContents* tab_contents) const; 75 void CloseLastLocalStream(content::WebContents* tab_contents) const;
76 76
77 void ConnectToPeerConnectionServer(const std::string& peer_name,
78 content::WebContents* tab_contents) const;
79 std::string ExecuteJavascript(const std::string& javascript, 77 std::string ExecuteJavascript(const std::string& javascript,
80 content::WebContents* tab_contents) const; 78 content::WebContents* tab_contents) const;
81 79
82 void EstablishCall(content::WebContents* from_tab, 80 // Sets up a peer connection in the tab and adds the current local stream
81 // (which you can prepare by calling one of the GetUserMedia* methods above).
82 void SetupPeerconnectionWithLocalStream(content::WebContents* tab) const;
83
84 // Exchanges offers and answers between the peer connections in the
85 // respective tabs. Before calling this, you must have prepared peer
86 // connections in both tabs and configured them as you like (for instance by
87 // calling SetupPeerconnectionWithLocalStream).
88 void NegotiateCall(content::WebContents* from_tab,
83 content::WebContents* to_tab) const; 89 content::WebContents* to_tab) const;
84 90
91 // Hangs up a negotiated call.
85 void HangUp(content::WebContents* from_tab) const; 92 void HangUp(content::WebContents* from_tab) const;
86 93
87 void WaitUntilHangupVerified(content::WebContents* tab_contents) const;
88
89 // Call this to enable monitoring of javascript errors for this test method. 94 // Call this to enable monitoring of javascript errors for this test method.
90 // This will only work if the tests are run sequentially by the test runner 95 // This will only work if the tests are run sequentially by the test runner
91 // (i.e. with --test-launcher-developer-mode or --test-launcher-jobs=1). 96 // (i.e. with --test-launcher-developer-mode or --test-launcher-jobs=1).
92 void DetectErrorsInJavaScript(); 97 void DetectErrorsInJavaScript();
93 98
94 // Methods for detecting if video is playing (the loaded page must have 99 // Methods for detecting if video is playing (the loaded page must have
95 // chrome/test/data/webrtc/video_detector.js and its dependencies loaded to 100 // chrome/test/data/webrtc/video_detector.js and its dependencies loaded to
96 // make that work). Looks at a 320x240 area of the target video tag. 101 // make that work). Looks at a 320x240 area of the target video tag.
97 void StartDetectingVideo(content::WebContents* tab_contents, 102 void StartDetectingVideo(content::WebContents* tab_contents,
98 const std::string& video_element) const; 103 const std::string& video_element) const;
99 void WaitForVideoToPlay(content::WebContents* tab_contents) const; 104 void WaitForVideoToPlay(content::WebContents* tab_contents) const;
100 105
101 // Returns the stream size as a string on the format <width>x<height>. 106 // Returns the stream size as a string on the format <width>x<height>.
102 std::string GetStreamSize(content::WebContents* tab_contents, 107 std::string GetStreamSize(content::WebContents* tab_contents,
103 const std::string& video_element) const; 108 const std::string& video_element) const;
104 109
105 // Methods to check what devices we have on the system. 110 // Methods to check what devices we have on the system.
106 bool HasWebcamAvailableOnSystem(content::WebContents* tab_contents) const; 111 bool HasWebcamAvailableOnSystem(content::WebContents* tab_contents) const;
107 112
108 private: 113 private:
109 void CloseInfoBarInTab(content::WebContents* tab_contents, 114 void CloseInfoBarInTab(content::WebContents* tab_contents,
110 infobars::InfoBar* infobar) const; 115 infobars::InfoBar* infobar) const;
116
117 std::string CreateLocalOffer(content::WebContents* from_tab) const;
118 std::string CreateAnswer(std::string local_offer,
119 content::WebContents* to_tab) const;
120 void ReceiveAnswer(std::string answer, content::WebContents* from_tab) const;
121 void GatherAndSendIceCandidates(content::WebContents* from_tab,
122 content::WebContents* to_tab) const;
123
111 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( 124 infobars::InfoBar* GetUserMediaAndWaitForInfoBar(
112 content::WebContents* tab_contents, 125 content::WebContents* tab_contents,
113 const std::string& constraints) const; 126 const std::string& constraints) const;
114 127
115 bool detect_errors_in_javascript_; 128 bool detect_errors_in_javascript_;
116 129
117 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); 130 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase);
118 }; 131 };
119 132
120 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ 133 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_
OLDNEW
« no previous file with comments | « chrome/browser/media/chrome_webrtc_video_quality_browsertest.cc ('k') | chrome/browser/media/webrtc_browsertest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698