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

Unified Diff: content/browser/webrtc_getusermedia_browsertest.cc

Issue 11428136: Added a basic WebRTC peerconnection browser test with video verification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review updates Created 8 years 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
« no previous file with comments | « content/browser/webrtc_browsertest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webrtc_getusermedia_browsertest.cc
diff --git a/content/browser/webrtc_getusermedia_browsertest.cc b/content/browser/webrtc_getusermedia_browsertest.cc
deleted file mode 100644
index 04688eb48d788b2c6fe03eeeade065723979396a..0000000000000000000000000000000000000000
--- a/content/browser/webrtc_getusermedia_browsertest.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2012 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.
-
-#include "base/utf_string_conversions.h"
-#include "content/browser/web_contents/web_contents_impl.h"
-#include "content/public/test/browser_test_utils.h"
-#include "content/shell/shell.h"
-#include "content/test/content_browser_test.h"
-#include "content/test/content_browser_test_utils.h"
-#include "net/test/test_server.h"
-
-namespace content {
-
-// Tests The WebRTC getUserMedia call.
-// Note: Requires --use-fake-device-for-media-stream (this flag is set by
-// default in content_browsertests).
-class WebrtcGetUserMediaTest: public ContentBrowserTest {
- public:
- WebrtcGetUserMediaTest() {}
- protected:
- void TestGetUserMediaWithConstraints(const std::string& constraints) {
- ASSERT_TRUE(test_server()->Start());
- GURL empty_url(test_server()->GetURL(
- "files/media/getusermedia_and_stop.html"));
- NavigateToURL(shell(), empty_url);
-
- RenderViewHost* render_view_host =
- shell()->web_contents()->GetRenderViewHost();
-
- EXPECT_TRUE(ExecuteJavaScript(render_view_host, L"",
- ASCIIToWide(constraints)));
-
- ExpectTitle("OK");
- }
-
- void ExpectTitle(const std::string& expected_title) const {
- string16 expected_title16(ASCIIToUTF16(expected_title));
- TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
- EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle());
- }
-};
-
-// These tests will all make a getUserMedia call with different constraints and
-// see that the success callback is called. If the error callback is called or
-// none of the callbacks are called the tests will simply time out and fail.
-IN_PROC_BROWSER_TEST_F(WebrtcGetUserMediaTest, GetVideoStreamAndStop) {
- TestGetUserMediaWithConstraints("getUserMedia({video: true});");
-}
-
-IN_PROC_BROWSER_TEST_F(WebrtcGetUserMediaTest, GetAudioAndVideoStreamAndStop) {
- TestGetUserMediaWithConstraints("getUserMedia({video: true, audio: true});");
-}
-
-// TODO(phoglund): enable once we have fake audio device support.
-IN_PROC_BROWSER_TEST_F(WebrtcGetUserMediaTest, DISABLED_GetAudioStreamAndStop) {
- TestGetUserMediaWithConstraints("getUserMedia({audio: true});");
-}
-
-} // namespace content
-
« no previous file with comments | « content/browser/webrtc_browsertest.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698