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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
494 large_value, | 494 large_value, |
495 large_value, | 495 large_value, |
496 large_value, | 496 large_value, |
497 large_value); | 497 large_value); |
498 NavigateToURL(shell(), url); | 498 NavigateToURL(shell(), url); |
499 | 499 |
500 EXPECT_EQ("ConstraintNotSatisfiedError", | 500 EXPECT_EQ("ConstraintNotSatisfiedError", |
501 ExecuteJavascriptAndReturnResult(call)); | 501 ExecuteJavascriptAndReturnResult(call)); |
502 } | 502 } |
503 | 503 |
504 // This test will make two getUserMedia requests, first one triggers error | |
phoglund_chromium
2014/10/15 18:03:09
Nit: phrase better; what about
"This test makes tw
jansson
2014/10/16 07:08:33
Done.
| |
505 // callback while the 2nd one triggers success callback. Goal is to check that | |
506 // callbacks are still fired after an error callback has fired. | |
507 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | |
508 TwoGetUserMediaAndCheckCallbackAfterFailure) { | |
509 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | |
510 | |
511 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | |
512 NavigateToURL(shell(), url); | |
513 | |
514 int large_value = 99999; | |
515 std::string constraints1 = | |
no longer working on chromium
2014/10/15 14:31:54
nit const std::string
phoglund_chromium
2014/10/15 18:03:09
Nit: Calling it constraints1|2 is misleading, sinc
jansson
2014/10/16 07:08:33
Done.
jansson
2014/10/16 07:08:33
Done.
| |
516 GenerateGetUserMediaCall(kGetUserMediaAndExpectFailure, | |
517 large_value, | |
518 large_value, | |
519 large_value, | |
520 large_value, | |
521 large_value, | |
522 large_value); | |
523 std::string constraints2 = | |
no longer working on chromium
2014/10/15 14:31:54
ditto
jansson
2014/10/16 07:08:33
Done.
| |
524 GenerateGetUserMediaCall(kGetUserMediaAndAnalyseAndStop, | |
525 640, 640, 480, 480, 10, 30); | |
526 | |
527 ASSERT_EQ("ConstraintNotSatisfiedError", | |
528 ExecuteJavascriptAndReturnResult(constraints1)); | |
529 | |
530 ASSERT_EQ("w=640:h=480", | |
531 ExecuteJavascriptAndReturnResult(constraints2)); | |
532 } | |
533 | |
504 // This test will make a simple getUserMedia page, verify that video is playing | 534 // This test will make a simple getUserMedia page, verify that video is playing |
505 // in a simple local <video>, and for a couple of seconds, collect some | 535 // in a simple local <video>, and for a couple of seconds, collect some |
506 // performance traces from VideoCaptureController colorspace conversion and | 536 // performance traces from VideoCaptureController colorspace conversion and |
507 // potential resizing. | 537 // potential resizing. |
508 IN_PROC_BROWSER_TEST_F( | 538 IN_PROC_BROWSER_TEST_F( |
509 WebRtcGetUserMediaBrowserTest, | 539 WebRtcGetUserMediaBrowserTest, |
510 TraceVideoCaptureControllerPerformanceDuringGetUserMedia) { | 540 TraceVideoCaptureControllerPerformanceDuringGetUserMedia) { |
511 RunGetUserMediaAndCollectMeasures( | 541 RunGetUserMediaAndCollectMeasures( |
512 10, | 542 10, |
513 "VideoCaptureController::OnIncomingCapturedData", | 543 "VideoCaptureController::OnIncomingCapturedData", |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
607 {640, 640, 360, 360, 10, 30}, | 637 {640, 640, 360, 360, 10, 30}, |
608 {640, 640, 480, 480, 10, 30}, | 638 {640, 640, 480, 480, 10, 30}, |
609 {960, 960, 720, 720, 10, 30}, | 639 {960, 960, 720, 720, 10, 30}, |
610 {1280, 1280, 720, 720, 10, 30}}; | 640 {1280, 1280, 720, 720, 10, 30}}; |
611 | 641 |
612 INSTANTIATE_TEST_CASE_P(UserMedia, | 642 INSTANTIATE_TEST_CASE_P(UserMedia, |
613 WebRtcConstraintsBrowserTest, | 643 WebRtcConstraintsBrowserTest, |
614 testing::ValuesIn(kAllUserMediaSizes)); | 644 testing::ValuesIn(kAllUserMediaSizes)); |
615 | 645 |
616 } // namespace content | 646 } // namespace content |
OLD | NEW |