| 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). | |
| 52 bool GetUserMediaAndAccept(content::WebContents* tab_contents) const; | 49 bool GetUserMediaAndAccept(content::WebContents* tab_contents) const; |
| 53 bool GetUserMediaWithSpecificConstraintsAndAccept( | 50 bool GetUserMediaWithSpecificConstraintsAndAccept( |
| 54 content::WebContents* tab_contents, | 51 content::WebContents* tab_contents, |
| 55 const std::string& constraints) const; | 52 const std::string& constraints) const; |
| 56 void GetUserMediaAndDeny(content::WebContents* tab_contents); | 53 void GetUserMediaAndDeny(content::WebContents* tab_contents); |
| 57 void GetUserMediaWithSpecificConstraintsAndDeny( | 54 void GetUserMediaWithSpecificConstraintsAndDeny( |
| 58 content::WebContents* tab_contents, | 55 content::WebContents* tab_contents, |
| 59 const std::string& constraints) const; | 56 const std::string& constraints) const; |
| 60 void GetUserMediaAndDismiss(content::WebContents* tab_contents) const; | 57 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; | |
| 65 void GetUserMedia(content::WebContents* tab_contents, | 58 void GetUserMedia(content::WebContents* tab_contents, |
| 66 const std::string& constraints) const; | 59 const std::string& constraints) const; |
| 67 | 60 |
| 68 // Convenience method which opens the page at url, calls GetUserMediaAndAccept | 61 // Convenience method which opens the page at url, calls GetUserMediaAndAccept |
| 69 // and returns the new tab. | 62 // and returns the new tab. |
| 70 content::WebContents* OpenPageAndGetUserMediaInNewTab(const GURL& url) const; | 63 content::WebContents* OpenPageAndGetUserMediaInNewTab(const GURL& url) const; |
| 71 | 64 |
| 72 // Convenience method which opens the page at url, calls | 65 // Convenience method which opens the page at url, calls |
| 73 // GetUserMediaAndAcceptWithSpecificConstraints and returns the new tab. | 66 // GetUserMediaAndAcceptWithSpecificConstraints and returns the new tab. |
| 74 content::WebContents* OpenPageAndGetUserMediaInNewTabWithConstraints( | 67 content::WebContents* OpenPageAndGetUserMediaInNewTabWithConstraints( |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( | 138 infobars::InfoBar* GetUserMediaAndWaitForInfoBar( |
| 146 content::WebContents* tab_contents, | 139 content::WebContents* tab_contents, |
| 147 const std::string& constraints) const; | 140 const std::string& constraints) const; |
| 148 | 141 |
| 149 bool detect_errors_in_javascript_; | 142 bool detect_errors_in_javascript_; |
| 150 | 143 |
| 151 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); | 144 DISALLOW_COPY_AND_ASSIGN(WebRtcTestBase); |
| 152 }; | 145 }; |
| 153 | 146 |
| 154 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ | 147 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
| OLD | NEW |