| 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 "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| 11 | 11 |
| 12 namespace infobars { |
| 12 class InfoBar; | 13 class InfoBar; |
| 14 } |
| 13 | 15 |
| 14 namespace content { | 16 namespace content { |
| 15 class WebContents; | 17 class WebContents; |
| 16 } | 18 } |
| 17 | 19 |
| 18 // Base class for WebRTC browser tests with useful primitives for interacting | 20 // Base class for WebRTC browser tests with useful primitives for interacting |
| 19 // getUserMedia. We use inheritance here because it makes the test code look | 21 // getUserMedia. We use inheritance here because it makes the test code look |
| 20 // as clean as it can be. | 22 // as clean as it can be. |
| 21 class WebRtcTestBase : public InProcessBrowserTest { | 23 class WebRtcTestBase : public InProcessBrowserTest { |
| 22 protected: | 24 protected: |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 99 |
| 98 // Returns the stream size as a string on the format <width>x<height>. | 100 // Returns the stream size as a string on the format <width>x<height>. |
| 99 std::string GetStreamSize(content::WebContents* tab_contents, | 101 std::string GetStreamSize(content::WebContents* tab_contents, |
| 100 const std::string& video_element) const; | 102 const std::string& video_element) const; |
| 101 | 103 |
| 102 // Methods to check what devices we have on the system. | 104 // Methods to check what devices we have on the system. |
| 103 bool HasWebcamAvailableOnSystem(content::WebContents* tab_contents) const; | 105 bool HasWebcamAvailableOnSystem(content::WebContents* tab_contents) const; |
| 104 | 106 |
| 105 private: | 107 private: |
| 106 void CloseInfoBarInTab(content::WebContents* tab_contents, | 108 void CloseInfoBarInTab(content::WebContents* tab_contents, |
| 107 InfoBar* infobar) const; | 109 infobars::InfoBar* infobar) const; |
| 108 InfoBar* GetUserMediaAndWaitForInfoBar(content::WebContents* tab_contents, | 110 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
| 109 const std::string& constraints) const; | 111 content::WebContents* tab_contents, |
| 112 const std::string& constraints) const; |
| 110 | 113 |
| 111 bool detect_errors_in_javascript_; | 114 bool detect_errors_in_javascript_; |
| 112 | 115 |
| 113 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 116 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
| 114 }; | 117 }; |
| 115 | 118 |
| 116 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 119 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
| OLD | NEW |