| 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" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 static const char kFailedWithPermissionDismissedError[]; | 39 static const char kFailedWithPermissionDismissedError[]; |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 WebRtcTestBase(); | 42 WebRtcTestBase(); |
| 43 ~WebRtcTestBase() override; | 43 ~WebRtcTestBase() override; |
| 44 | 44 |
| 45 // These all require that the loaded page fulfills the public interface in | 45 // These all require that the loaded page fulfills the public interface in |
| 46 // chrome/test/data/webrtc/getusermedia.js. | 46 // chrome/test/data/webrtc/getusermedia.js. |
| 47 // If an error is reported back from the getUserMedia call, these functions | 47 // If an error is reported back from the getUserMedia call, these functions |
| 48 // will return false. | 48 // will return false. |
| 49 // The ...AndAccept()/...AndDeny()/...AndDismiss() functions expect that a |
| 50 // prompt will be shown (i.e. the current origin in the tab_contents doesn't |
| 51 // have a saved permission). |
| 49 bool GetUserMediaAndAccept(content::WebContents* tab_contents) const; | 52 bool GetUserMediaAndAccept(content::WebContents* tab_contents) const; |
| 50 bool GetUserMediaWithSpecificConstraintsAndAccept( | 53 bool GetUserMediaWithSpecificConstraintsAndAccept( |
| 51 content::WebContents* tab_contents, | 54 content::WebContents* tab_contents, |
| 52 const std::string& constraints) const; | 55 const std::string& constraints) const; |
| 53 void GetUserMediaAndDeny(content::WebContents* tab_contents); | 56 void GetUserMediaAndDeny(content::WebContents* tab_contents); |
| 54 void GetUserMediaWithSpecificConstraintsAndDeny( | 57 void GetUserMediaWithSpecificConstraintsAndDeny( |
| 55 content::WebContents* tab_contents, | 58 content::WebContents* tab_contents, |
| 56 const std::string& constraints) const; | 59 const std::string& constraints) const; |
| 57 void GetUserMediaAndDismiss(content::WebContents* tab_contents) const; | 60 void GetUserMediaAndDismiss(content::WebContents* tab_contents) const; |
| 61 void GetUserMediaAndExpectAutoAcceptWithoutPrompt( |
| 62 content::WebContents* tab_contents) const; |
| 63 void GetUserMediaAndExpectAutoDenyWithoutPrompt( |
| 64 content::WebContents* tab_contents) const; |
| 58 void GetUserMedia(content::WebContents* tab_contents, | 65 void GetUserMedia(content::WebContents* tab_contents, |
| 59 const std::string& constraints) const; | 66 const std::string& constraints) const; |
| 60 | 67 |
| 61 // Convenience method which opens the page at url, calls GetUserMediaAndAccept | 68 // Convenience method which opens the page at url, calls GetUserMediaAndAccept |
| 62 // and returns the new tab. | 69 // and returns the new tab. |
| 63 content::WebContents* OpenPageAndGetUserMediaInNewTab(const GURL& url) const; | 70 content::WebContents* OpenPageAndGetUserMediaInNewTab(const GURL& url) const; |
| 64 | 71 |
| 65 // Convenience method which opens the page at url, calls | 72 // Convenience method which opens the page at url, calls |
| 66 // GetUserMediaAndAcceptWithSpecificConstraints and returns the new tab. | 73 // GetUserMediaAndAcceptWithSpecificConstraints and returns the new tab. |
| 67 content::WebContents* OpenPageAndGetUserMediaInNewTabWithConstraints( | 74 content::WebContents* OpenPageAndGetUserMediaInNewTabWithConstraints( |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 145 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
| 139 content::WebContents* tab_contents, | 146 content::WebContents* tab_contents, |
| 140 const std::string& constraints) const; | 147 const std::string& constraints) const; |
| 141 | 148 |
| 142 bool detect_errors_in_javascript_; | 149 bool detect_errors_in_javascript_; |
| 143 | 150 |
| 144 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 151 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
| 145 }; | 152 }; |
| 146 | 153 |
| 147 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 154 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
| OLD | NEW |