Index: chrome/browser/media/webrtc_browsertest_base.h |
diff --git a/chrome/browser/media/webrtc_browsertest_base.h b/chrome/browser/media/webrtc_browsertest_base.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b23644ddad1850fe52bc4639d4dbc77a1fb05dd2 |
--- /dev/null |
+++ b/chrome/browser/media/webrtc_browsertest_base.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
+#define CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |
+ |
+#include "chrome/test/base/in_process_browser_test.h" |
+ |
+namespace content { |
+class WebContents; |
+} |
+ |
+class MediaStreamInfoBarDelegate; |
+ |
+// Base class for WebRTC browser tests with useful primitives for interacting |
+// getUserMedia. We use inheritance here because it makes the test code look |
+// as clean as it can be. |
+class WebRtcTestBase : public InProcessBrowserTest { |
+ public: |
+ // Typical constraints. |
+ static const char kAudioVideoCallConstraints[]; |
+ static const char kAudioOnlyCallConstraints[]; |
+ static const char kVideoOnlyCallConstraints[]; |
+ |
+ static const char kFailedWithErrorPermissionDenied[]; |
+ static const char kOkGotStream[]; |
+ |
+ protected: |
+ MediaStreamInfoBarDelegate* GetUserMediaAndWaitForInfobar( |
+ content::WebContents* tab_contents, |
+ const std::string& constraints); |
+ void CloseInfobarInTab(content::WebContents* tab_contents, |
+ MediaStreamInfoBarDelegate* infobar); |
+ void GetUserMediaAndAccept(content::WebContents* tab_contents); |
+ void GetUserMediaWithSpecificConstraintsAndAccept( |
+ content::WebContents* tab_contents, const std::string& constraints); |
+ void GetUserMediaAndDeny(content::WebContents* tab_contents); |
+ void GetUserMediaWithSpecificConstraintsAndDeny( |
+ content::WebContents* tab_contents, const std::string& constraints); |
+ void GetUserMediaAndDismiss(content::WebContents* tab_contents); |
+ void GetUserMedia(content::WebContents* tab_contents, |
+ const std::string& constraints); |
+}; |
+ |
+#endif // CHROME_BROWSER_MEDIA_WEBRTC_BROWSERTEST_BASE_H_ |