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

Unified Diff: content/browser/media/webrtc_getusermedia_browsertest.cc

Issue 653533004: Content browser test that checks gum callback is fired after failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed according to comments Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/webrtc_getusermedia_browsertest.cc
diff --git a/content/browser/media/webrtc_getusermedia_browsertest.cc b/content/browser/media/webrtc_getusermedia_browsertest.cc
index 8eb7d79748b1797e21898ddc4884394013d7339c..f0bc828f57b0027f3c854cdff7126fbdd138bd42 100644
--- a/content/browser/media/webrtc_getusermedia_browsertest.cc
+++ b/content/browser/media/webrtc_getusermedia_browsertest.cc
@@ -501,6 +501,36 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
ExecuteJavascriptAndReturnResult(call));
}
+// This test makes two getUserMedia requests, one with impossible constraints
+// that should trigger an error, and one with valid constraints. The test
+// verifies getUserMedia can succeed after being given impossible constraints.
+IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
+ TwoGetUserMediaAndCheckCallbackAfterFailure) {
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+
+ GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
+ NavigateToURL(shell(), url);
+
+ int large_value = 99999;
+ const std::string gum_with_impossible_constraints =
+ GenerateGetUserMediaCall(kGetUserMediaAndExpectFailure,
+ large_value,
+ large_value,
+ large_value,
+ large_value,
+ large_value,
+ large_value);
+ const std::string gum_with_vga_constraints =
+ GenerateGetUserMediaCall(kGetUserMediaAndAnalyseAndStop,
+ 640, 640, 480, 480, 10, 30);
+
+ ASSERT_EQ("ConstraintNotSatisfiedError",
+ ExecuteJavascriptAndReturnResult(gum_with_impossible_constraints));
+
+ ASSERT_EQ("w=640:h=480",
+ ExecuteJavascriptAndReturnResult(gum_with_vga_constraints));
+}
+
// This test will make a simple getUserMedia page, verify that video is playing
// in a simple local <video>, and for a couple of seconds, collect some
// performance traces from VideoCaptureController colorspace conversion and
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698