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" |
11 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
12 | 12 |
13 namespace infobars { | 13 namespace infobars { |
14 class InfoBar; | 14 class InfoBar; |
15 } | 15 } |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class WebContents; | 18 class WebContents; |
19 } | 19 } |
20 | 20 |
| 21 class JavascriptErrorDetectingListener : logging::LogMessageListener { |
| 22 public: |
| 23 void OnMessage(int severity, const char* file, int line, |
| 24 size_t message_start, const std::string& str) override; |
| 25 }; |
| 26 |
21 // Base class for WebRTC browser tests with useful primitives for interacting | 27 // Base class for WebRTC browser tests with useful primitives for interacting |
22 // getUserMedia. We use inheritance here because it makes the test code look | 28 // getUserMedia. We use inheritance here because it makes the test code look |
23 // as clean as it can be. | 29 // as clean as it can be. |
24 class WebRtcTestBase : public InProcessBrowserTest { | 30 class WebRtcTestBase : public InProcessBrowserTest { |
25 public: | 31 public: |
26 // Typical constraints. | 32 // Typical constraints. |
27 static const char kAudioVideoCallConstraints[]; | 33 static const char kAudioVideoCallConstraints[]; |
28 static const char kAudioOnlyCallConstraints[]; | 34 static const char kAudioOnlyCallConstraints[]; |
29 static const char kVideoOnlyCallConstraints[]; | 35 static const char kVideoOnlyCallConstraints[]; |
30 static const char kVideoCallConstraintsQVGA[]; | 36 static const char kVideoCallConstraintsQVGA[]; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 std::string default_video_codec = kUseDefaultVideoCodec) const; | 185 std::string default_video_codec = kUseDefaultVideoCodec) const; |
180 void ReceiveAnswer(const std::string& answer, | 186 void ReceiveAnswer(const std::string& answer, |
181 content::WebContents* from_tab) const; | 187 content::WebContents* from_tab) const; |
182 void GatherAndSendIceCandidates(content::WebContents* from_tab, | 188 void GatherAndSendIceCandidates(content::WebContents* from_tab, |
183 content::WebContents* to_tab) const; | 189 content::WebContents* to_tab) const; |
184 | 190 |
185 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 191 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
186 content::WebContents* tab_contents, | 192 content::WebContents* tab_contents, |
187 const std::string& constraints) const; | 193 const std::string& constraints) const; |
188 | 194 |
| 195 JavascriptErrorDetectingListener log_listener_; |
189 bool detect_errors_in_javascript_; | 196 bool detect_errors_in_javascript_; |
190 | 197 |
191 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 198 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
192 }; | 199 }; |
193 | 200 |
194 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 201 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
OLD | NEW |