| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 content::WebContents* to_tab) const; | 186 content::WebContents* to_tab) const; |
| 181 void ReceiveAnswer(const std::string& answer, | 187 void ReceiveAnswer(const std::string& answer, |
| 182 content::WebContents* from_tab) const; | 188 content::WebContents* from_tab) const; |
| 183 void GatherAndSendIceCandidates(content::WebContents* from_tab, | 189 void GatherAndSendIceCandidates(content::WebContents* from_tab, |
| 184 content::WebContents* to_tab) const; | 190 content::WebContents* to_tab) const; |
| 185 | 191 |
| 186 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 192 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
| 187 content::WebContents* tab_contents, | 193 content::WebContents* tab_contents, |
| 188 const std::string& constraints) const; | 194 const std::string& constraints) const; |
| 189 | 195 |
| 196 JavascriptErrorDetectingListener log_listener_; |
| 190 bool detect_errors_in_javascript_; | 197 bool detect_errors_in_javascript_; |
| 191 | 198 |
| 192 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 199 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
| 193 }; | 200 }; |
| 194 | 201 |
| 195 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 202 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
| OLD | NEW |