OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/debug/trace_event_impl.h" | 6 #include "base/debug/trace_event_impl.h" |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/test/trace_event_analyzer.h" | 9 #include "base/test/trace_event_analyzer.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 421 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
422 | 422 |
423 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 423 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
424 NavigateToURL(shell(), url); | 424 NavigateToURL(shell(), url); |
425 | 425 |
426 ExecuteJavascriptAndWaitForOk( | 426 ExecuteJavascriptAndWaitForOk( |
427 "twoGetUserMediaAndStop({video: true, audio: true});"); | 427 "twoGetUserMediaAndStop({video: true, audio: true});"); |
428 } | 428 } |
429 | 429 |
430 IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, | 430 IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, |
| 431 TwoGetUserMediaWithEqualConstraints) { |
| 432 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 433 |
| 434 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 435 NavigateToURL(shell(), url); |
| 436 |
| 437 std::string constraints1 = "{video: true, audio: true}"; |
| 438 std::string constraints2 = "{video: true, audio: true}"; |
| 439 |
| 440 std::string command = "twoGetUserMedia(" + constraints1 + ',' + |
| 441 constraints2 + ')'; |
| 442 |
| 443 EXPECT_EQ("w=640:h=480-w=640:h=480", |
| 444 ExecuteJavascriptAndReturnResult(command)); |
| 445 } |
| 446 |
| 447 IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, |
| 448 TwoGetUserMediaWithSecondVideoCropped) { |
| 449 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 450 |
| 451 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 452 NavigateToURL(shell(), url); |
| 453 |
| 454 std::string constraints1 = "{video: true}"; |
| 455 std::string constraints2 = "{video: {mandatory: {maxHeight: 360}}}"; |
| 456 |
| 457 std::string command = "twoGetUserMedia(" + constraints1 + ',' + |
| 458 constraints2 + ')'; |
| 459 |
| 460 EXPECT_EQ("w=640:h=480-w=640:h=360", |
| 461 ExecuteJavascriptAndReturnResult(command)); |
| 462 } |
| 463 |
| 464 IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, |
| 465 TwoGetUserMediaWithFirstHdSecondVga) { |
| 466 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 467 |
| 468 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 469 NavigateToURL(shell(), url); |
| 470 |
| 471 std::string constraints1 = |
| 472 "{video: {mandatory: {minWidth:1280 , minHeight: 720}}}"; |
| 473 std::string constraints2 = |
| 474 "{video: {mandatory: {maxWidth:640 , maxHeight: 480}}}"; |
| 475 |
| 476 std::string command = "twoGetUserMedia(" + constraints1 + ',' + |
| 477 constraints2 + ')'; |
| 478 |
| 479 EXPECT_EQ("w=1280:h=720-w=640:h=480", |
| 480 ExecuteJavascriptAndReturnResult(command)); |
| 481 } |
| 482 |
| 483 |
| 484 IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, |
431 GetUserMediaWithTooHighVideoConstraintsValues) { | 485 GetUserMediaWithTooHighVideoConstraintsValues) { |
432 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 486 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
433 | 487 |
434 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 488 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
435 | 489 |
436 int large_value = 99999; | 490 int large_value = 99999; |
437 std::string call = GenerateGetUserMediaCall(kGetUserMediaAndExpectFailure, | 491 std::string call = GenerateGetUserMediaCall(kGetUserMediaAndExpectFailure, |
438 large_value, | 492 large_value, |
439 large_value, | 493 large_value, |
440 large_value, | 494 large_value, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 {640, 640, 360, 360, 10, 30}, | 607 {640, 640, 360, 360, 10, 30}, |
554 {640, 640, 480, 480, 10, 30}, | 608 {640, 640, 480, 480, 10, 30}, |
555 {960, 960, 720, 720, 10, 30}, | 609 {960, 960, 720, 720, 10, 30}, |
556 {1280, 1280, 720, 720, 10, 30}}; | 610 {1280, 1280, 720, 720, 10, 30}}; |
557 | 611 |
558 INSTANTIATE_TEST_CASE_P(UserMedia, | 612 INSTANTIATE_TEST_CASE_P(UserMedia, |
559 WebRtcConstraintsBrowserTest, | 613 WebRtcConstraintsBrowserTest, |
560 testing::ValuesIn(kAllUserMediaSizes)); | 614 testing::ValuesIn(kAllUserMediaSizes)); |
561 | 615 |
562 } // namespace content | 616 } // namespace content |
OLD | NEW |