| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 291 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 292 | 292 |
| 293 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 293 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 294 NavigateToURL(shell(), url); | 294 NavigateToURL(shell(), url); |
| 295 | 295 |
| 296 ExecuteJavascriptAndWaitForOk( | 296 ExecuteJavascriptAndWaitForOk( |
| 297 base::StringPrintf("%s({video: true});", | 297 base::StringPrintf("%s({video: true});", |
| 298 kRenderDuplicatedMediastreamAndStop)); | 298 kRenderDuplicatedMediastreamAndStop)); |
| 299 } | 299 } |
| 300 | 300 |
| 301 // Flaky on Android. http://crbug.com/387895 | |
| 302 #if defined(OS_ANDROID) | |
| 303 #define MAYBE_GetAudioAndVideoStreamAndStop DISABLED_GetAudioAndVideoStreamAndSt
op | |
| 304 #else | |
| 305 #define MAYBE_GetAudioAndVideoStreamAndStop GetAudioAndVideoStreamAndStop | |
| 306 #endif | |
| 307 | |
| 308 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | 301 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| 309 MAYBE_GetAudioAndVideoStreamAndStop) { | 302 GetAudioAndVideoStreamAndStop) { |
| 310 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 303 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 311 | 304 |
| 312 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 305 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 313 NavigateToURL(shell(), url); | 306 NavigateToURL(shell(), url); |
| 314 | 307 |
| 315 ExecuteJavascriptAndWaitForOk(base::StringPrintf( | 308 ExecuteJavascriptAndWaitForOk(base::StringPrintf( |
| 316 "%s({video: true, audio: true});", kGetUserMediaAndStop)); | 309 "%s({video: true, audio: true});", kGetUserMediaAndStop)); |
| 317 } | 310 } |
| 318 | 311 |
| 319 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | 312 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, TwoGetUserMediaAndStop) { | 425 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, TwoGetUserMediaAndStop) { |
| 433 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 426 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 434 | 427 |
| 435 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 428 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 436 NavigateToURL(shell(), url); | 429 NavigateToURL(shell(), url); |
| 437 | 430 |
| 438 ExecuteJavascriptAndWaitForOk( | 431 ExecuteJavascriptAndWaitForOk( |
| 439 "twoGetUserMediaAndStop({video: true, audio: true});"); | 432 "twoGetUserMediaAndStop({video: true, audio: true});"); |
| 440 } | 433 } |
| 441 | 434 |
| 442 #if defined(OS_WIN) && !defined(NDEBUG) | |
| 443 // Flaky on Webkit Win7 Debug bot: http://crbug.com/417756 | |
| 444 #define MAYBE_TwoGetUserMediaWithEqualConstraints \ | |
| 445 DISABLED_TwoGetUserMediaWithEqualConstraints | |
| 446 #else | |
| 447 #define MAYBE_TwoGetUserMediaWithEqualConstraints \ | |
| 448 TwoGetUserMediaWithEqualConstraints | |
| 449 #endif | |
| 450 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | 435 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| 451 MAYBE_TwoGetUserMediaWithEqualConstraints) { | 436 TwoGetUserMediaWithEqualConstraints) { |
| 452 std::string constraints1 = "{video: true, audio: true}"; | 437 std::string constraints1 = "{video: true, audio: true}"; |
| 453 const std::string& constraints2 = constraints1; | 438 const std::string& constraints2 = constraints1; |
| 454 std::string expected_result = "w=640:h=480-w=640:h=480"; | 439 std::string expected_result = "w=640:h=480-w=640:h=480"; |
| 455 | 440 |
| 456 RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, | 441 RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, |
| 457 expected_result); | 442 expected_result); |
| 458 } | 443 } |
| 459 | 444 |
| 460 #if defined(OS_WIN) | |
| 461 // Flaky on Windows Debug: http://crbug.com/417756 | |
| 462 #define MAYBE_TwoGetUserMediaWithSecondVideoCropped \ | |
| 463 DISABLED_TwoGetUserMediaWithSecondVideoCropped | |
| 464 #else | |
| 465 #define MAYBE_TwoGetUserMediaWithSecondVideoCropped \ | |
| 466 TwoGetUserMediaWithSecondVideoCropped | |
| 467 #endif | |
| 468 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | 445 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| 469 MAYBE_TwoGetUserMediaWithSecondVideoCropped) { | 446 TwoGetUserMediaWithSecondVideoCropped) { |
| 470 std::string constraints1 = "{video: true}"; | 447 std::string constraints1 = "{video: true}"; |
| 471 std::string constraints2 = "{video: {mandatory: {maxHeight: 360}}}"; | 448 std::string constraints2 = "{video: {mandatory: {maxHeight: 360}}}"; |
| 472 std::string expected_result = "w=640:h=480-w=640:h=360"; | 449 std::string expected_result = "w=640:h=480-w=640:h=360"; |
| 473 RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, | 450 RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, |
| 474 expected_result); | 451 expected_result); |
| 475 } | 452 } |
| 476 | 453 |
| 477 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(NDEBUG)) | |
| 478 // Flaky on Windows and on Linux Debug: http://crbug.com/417756 | |
| 479 #define MAYBE_TwoGetUserMediaWithFirstHdSecondVga \ | |
| 480 DISABLED_TwoGetUserMediaWithFirstHdSecondVga | |
| 481 #else | |
| 482 #define MAYBE_TwoGetUserMediaWithFirstHdSecondVga \ | |
| 483 TwoGetUserMediaWithFirstHdSecondVga | |
| 484 #endif | |
| 485 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | 454 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| 486 MAYBE_TwoGetUserMediaWithFirstHdSecondVga) { | 455 TwoGetUserMediaWithFirstHdSecondVga) { |
| 487 std::string constraints1 = | 456 std::string constraints1 = |
| 488 "{video: {mandatory: {minWidth:1280 , minHeight: 720}}}"; | 457 "{video: {mandatory: {minWidth:1280 , minHeight: 720}}}"; |
| 489 std::string constraints2 = | 458 std::string constraints2 = |
| 490 "{video: {mandatory: {maxWidth:640 , maxHeight: 480}}}"; | 459 "{video: {mandatory: {maxWidth:640 , maxHeight: 480}}}"; |
| 491 std::string expected_result = "w=1280:h=720-w=640:h=480"; | 460 std::string expected_result = "w=1280:h=720-w=640:h=480"; |
| 492 RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, | 461 RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, |
| 493 expected_result); | 462 expected_result); |
| 494 } | 463 } |
| 495 | 464 |
| 496 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | 465 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 {640, 640, 360, 360, 10, 30}, | 607 {640, 640, 360, 360, 10, 30}, |
| 639 {640, 640, 480, 480, 10, 30}, | 608 {640, 640, 480, 480, 10, 30}, |
| 640 {960, 960, 720, 720, 10, 30}, | 609 {960, 960, 720, 720, 10, 30}, |
| 641 {1280, 1280, 720, 720, 10, 30}}; | 610 {1280, 1280, 720, 720, 10, 30}}; |
| 642 | 611 |
| 643 INSTANTIATE_TEST_CASE_P(UserMedia, | 612 INSTANTIATE_TEST_CASE_P(UserMedia, |
| 644 WebRtcConstraintsBrowserTest, | 613 WebRtcConstraintsBrowserTest, |
| 645 testing::ValuesIn(kAllUserMediaSizes)); | 614 testing::ValuesIn(kAllUserMediaSizes)); |
| 646 | 615 |
| 647 } // namespace content | 616 } // namespace content |
| OLD | NEW |