Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Unified Diff: chrome/browser/media/webrtc_browsertest_base.h

Issue 20247003: Introduced base class for WebRTC browser tests, cleaned up duplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « chrome/browser/media/media_stream_infobar_delegate.h ('k') | chrome/browser/media/webrtc_browsertest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698