| 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/debug/trace_event_impl.h" | 5 #include "base/debug/trace_event_impl.h" |
| 6 #include "base/json/json_reader.h" | 6 #include "base/json/json_reader.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/test/trace_event_analyzer.h" | 8 #include "base/test/trace_event_analyzer.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "content/browser/media/webrtc_internals.h" | 10 #include "content/browser/media/webrtc_internals.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 // potential resizing. | 354 // potential resizing. |
| 355 IN_PROC_BROWSER_TEST_F( | 355 IN_PROC_BROWSER_TEST_F( |
| 356 WebRtcGetUserMediaBrowserTest, | 356 WebRtcGetUserMediaBrowserTest, |
| 357 TraceVideoCaptureControllerPerformanceDuringGetUserMedia) { | 357 TraceVideoCaptureControllerPerformanceDuringGetUserMedia) { |
| 358 RunGetUserMediaAndCollectMeasures( | 358 RunGetUserMediaAndCollectMeasures( |
| 359 10, | 359 10, |
| 360 "VideoCaptureController::OnIncomingCapturedData", | 360 "VideoCaptureController::OnIncomingCapturedData", |
| 361 "VideoCaptureController"); | 361 "VideoCaptureController"); |
| 362 } | 362 } |
| 363 | 363 |
| 364 // This test will make a simple getUserMedia page, verify that video is playing | |
| 365 // in a simple local <video>, and for a couple of seconds, collect some | |
| 366 // performance traces. Only for Android. | |
| 367 #if defined(OS_ANDROID) | |
| 368 IN_PROC_BROWSER_TEST_F( | |
| 369 WebRtcGetUserMediaBrowserTest, | |
| 370 TraceVideoCaptureDeviceAndroidPerformanceDuringGetUserMedia) { | |
| 371 RunGetUserMediaAndCollectMeasures( | |
| 372 10, | |
| 373 "VideoCaptureDeviceAndroid::OnFrameAvailable", | |
| 374 "VideoCaptureDeviceAndroid"); | |
| 375 } | |
| 376 #endif | |
| 377 | |
| 378 // This test calls getUserMedia and checks for aspect ratio behavior. | 364 // This test calls getUserMedia and checks for aspect ratio behavior. |
| 379 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | 365 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| 380 TestGetUserMediaAspectRatio4To3) { | 366 TestGetUserMediaAspectRatio4To3) { |
| 381 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 367 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 382 | 368 |
| 383 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 369 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 384 | 370 |
| 385 std::string constraints_4_3 = GenerateGetUserMediaCall( | 371 std::string constraints_4_3 = GenerateGetUserMediaCall( |
| 386 kGetUserMediaAndAnalyseAndStop, 640, 640, 480, 480, 30, 30); | 372 kGetUserMediaAndAnalyseAndStop, 640, 640, 480, 480, 30, 30); |
| 387 | 373 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 {640, 640, 480, 480, 30, 30}, | 446 {640, 640, 480, 480, 30, 30}, |
| 461 {960, 960, 720, 720, 30, 30}, | 447 {960, 960, 720, 720, 30, 30}, |
| 462 {1280, 1280, 720, 720, 30, 30}, | 448 {1280, 1280, 720, 720, 30, 30}, |
| 463 {1920, 1920, 1080, 1080, 30, 30}}; | 449 {1920, 1920, 1080, 1080, 30, 30}}; |
| 464 | 450 |
| 465 INSTANTIATE_TEST_CASE_P(UserMedia, | 451 INSTANTIATE_TEST_CASE_P(UserMedia, |
| 466 WebRtcConstraintsBrowserTest, | 452 WebRtcConstraintsBrowserTest, |
| 467 testing::ValuesIn(kAllUserMediaSizes)); | 453 testing::ValuesIn(kAllUserMediaSizes)); |
| 468 | 454 |
| 469 } // namespace content | 455 } // namespace content |
| OLD | NEW |