OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
| 6 #define CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
| 7 |
| 8 #include "chrome/test/base/in_process_browser_test.h" |
| 9 |
| 10 namespace content { |
| 11 class WebContents; |
| 12 } |
| 13 |
| 14 class MediaStreamInfoBarDelegate; |
| 15 |
| 16 // Base class for WebRTC browser tests with useful primitives for interacting |
| 17 // getUserMedia. We use inheritance here because it makes the test code look |
| 18 // as clean as it can be. |
| 19 class WebRtcTestBase : public InProcessBrowserTest { |
| 20 public: |
| 21 // Typical constraints. |
| 22 static const char kAudioVideoCallConstraints[]; |
| 23 static const char kAudioOnlyCallConstraints[]; |
| 24 static const char kVideoOnlyCallConstraints[]; |
| 25 |
| 26 static const char kFailedWithErrorPermissionDenied[]; |
| 27 static const char kOkGotStream[]; |
| 28 |
| 29 protected: |
| 30 MediaStreamInfoBarDelegate* GetUserMediaAndWaitForInfobar( |
| 31 content::WebContents* tab_contents, |
| 32 const std::string& constraints); |
| 33 void CloseInfobarInTab(content::WebContents* tab_contents, |
| 34 MediaStreamInfoBarDelegate* infobar); |
| 35 void GetUserMediaAndAccept(content::WebContents* tab_contents); |
| 36 void GetUserMediaWithSpecificConstraintsAndAccept( |
| 37 content::WebContents* tab_contents, const std::string& constraints); |
| 38 void GetUserMediaAndDeny(content::WebContents* tab_contents); |
| 39 void GetUserMediaWithSpecificConstraintsAndDeny( |
| 40 content::WebContents* tab_contents, const std::string& constraints); |
| 41 void GetUserMediaAndDismiss(content::WebContents* tab_contents); |
| 42 void GetUserMedia(content::WebContents* tab_contents, |
| 43 const std::string& constraints); |
| 44 }; |
| 45 |
| 46 #endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
OLD | NEW |