Chromium Code Reviews| 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 7f3aceaec818bb69ff739a392fd3dcdf9bc57804..0bb9490cb0015ea03b8efefeba4fefc811dea0fd 100644 |
| --- a/content/browser/media/webrtc_getusermedia_browsertest.cc |
| +++ b/content/browser/media/webrtc_getusermedia_browsertest.cc |
| @@ -428,6 +428,59 @@ IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, TwoGetUserMediaAndStop) { |
| } |
| IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, |
| + TwoGetUserMediaWithEqualConstraints) { |
| + ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| + |
| + GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| + NavigateToURL(shell(), url); |
| + |
| + std::string constraints1 = "{video: true, audio: true}"; |
|
tommi (sloooow) - chröme
2014/05/09 11:16:13
nit: why not just |constraints|? (why do you need
perkj_chrome
2014/05/13 11:05:56
Refactored.
|
| + std::string constraints2 = "{video: true, audio: true}"; |
| + |
| + std::string command = "twoGetUserMedia(" + constraints1 + ',' + |
| + constraints2 + ')'; |
| + |
| + EXPECT_EQ("w=640:h=480-w=640:h=480", |
| + ExecuteJavascriptAndReturnResult(command)); |
| +} |
| + |
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, |
| + TwoGetUserMediaWithSecondVideoCropped) { |
| + ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| + |
| + GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| + NavigateToURL(shell(), url); |
| + |
| + std::string constraints1 = "{video: true}"; |
| + std::string constraints2 = "{video: {mandatory: {maxHeight: 360}}}"; |
| + |
| + std::string command = "twoGetUserMedia(" + constraints1 + ',' + |
| + constraints2 + ')'; |
| + |
| + EXPECT_EQ("w=640:h=480-w=640:h=360", |
| + ExecuteJavascriptAndReturnResult(command)); |
| +} |
| + |
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, |
| + TwoGetUserMediaWithFirstHdSecondVga) { |
| + ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| + |
| + GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| + NavigateToURL(shell(), url); |
| + |
| + std::string constraints1 = |
| + "{video: {mandatory: {minWidth:1280 , minHeight: 720}}}"; |
| + std::string constraints2 = |
| + "{video: {mandatory: {maxWidth:640 , maxHeight: 480}}}"; |
| + |
| + std::string command = "twoGetUserMedia(" + constraints1 + ',' + |
|
tommi (sloooow) - chröme
2014/05/09 11:16:13
suggestion: make a method, std::string TwoGetUserM
perkj_chrome
2014/05/13 11:05:56
I went for Miguels request below.
|
| + constraints2 + ')'; |
| + |
| + EXPECT_EQ("w=1280:h=720-w=640:h=480", |
| + ExecuteJavascriptAndReturnResult(command)); |
| +} |
|
mcasas
2014/05/09 07:46:24
These three tests share code. What about a method
perkj_chrome
2014/05/13 11:05:56
Done.
|
| + |
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, |
| GetUserMediaWithTooHighVideoConstraintsValues) { |
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |