Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: content/browser/media/webrtc_getusermedia_browsertest.cc

Issue 183113004: Make sure MediaStreamVideoSource support cropping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed extra spaces in content_unittests Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/content_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 TraceVideoCaptureDeviceAndroidPerformanceDuringGetUserMedia) { 370 TraceVideoCaptureDeviceAndroidPerformanceDuringGetUserMedia) {
371 RunGetUserMediaAndCollectMeasures( 371 RunGetUserMediaAndCollectMeasures(
372 10, 372 10,
373 "VideoCaptureDeviceAndroid::OnFrameAvailable", 373 "VideoCaptureDeviceAndroid::OnFrameAvailable",
374 "VideoCaptureDeviceAndroid"); 374 "VideoCaptureDeviceAndroid");
375 } 375 }
376 #endif 376 #endif
377 377
378 // This test calls getUserMedia and checks for aspect ratio behavior. 378 // This test calls getUserMedia and checks for aspect ratio behavior.
379 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, 379 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
380 TestGetUserMediaAspectRatio) { 380 TestGetUserMediaAspectRatio4To3) {
381 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 381 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
382 382
383 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); 383 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
384 384
385 std::string constraints_4_3 = GenerateGetUserMediaCall( 385 std::string constraints_4_3 = GenerateGetUserMediaCall(
386 kGetUserMediaAndAnalyseAndStop, 640, 640, 480, 480, 30, 30); 386 kGetUserMediaAndAnalyseAndStop, 640, 640, 480, 480, 30, 30);
387 std::string constraints_16_9 = GenerateGetUserMediaCall(
388 kGetUserMediaAndAnalyseAndStop, 640, 640, 360, 360, 30, 30);
389 387
390 // TODO(mcasas): add more aspect ratios, in particular 16:10 crbug.com/275594. 388 // TODO(mcasas): add more aspect ratios, in particular 16:10 crbug.com/275594.
391 389
392 NavigateToURL(shell(), url); 390 NavigateToURL(shell(), url);
393 ASSERT_TRUE(ExecuteJavascript(constraints_4_3)); 391 ASSERT_TRUE(ExecuteJavascript(constraints_4_3));
394 ExpectTitle("4:3 letterbox"); 392 ExpectTitle("4:3 letterbox");
393 }
394
395 // This test calls getUserMedia and checks for aspect ratio behavior.
396 // TODO(perkj): Enable this test as soon as crbug/349450 is fixed.
397 // Currently the render pipeline doesn't support cropping where the new cropped
398 // frame doesn't have the same top left coordinates as the original frame.
399 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
400 DISABLED_TestGetUserMediaAspectRatio16To9) {
401 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
402
403 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
404
405 std::string constraints_16_9 = GenerateGetUserMediaCall(
406 kGetUserMediaAndAnalyseAndStop, 640, 640, 360, 360, 30, 30);
395 407
396 NavigateToURL(shell(), url); 408 NavigateToURL(shell(), url);
397 ASSERT_TRUE(ExecuteJavascript(constraints_16_9)); 409 ASSERT_TRUE(ExecuteJavascript(constraints_16_9));
398 ExpectTitle("16:9 letterbox"); 410 ExpectTitle("16:9 letterbox");
399 } 411 }
400 412
401 namespace { 413 namespace {
402 414
403 struct UserMediaSizes { 415 struct UserMediaSizes {
404 int min_width; 416 int min_width;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 {640, 640, 480, 480, 30, 30}, 460 {640, 640, 480, 480, 30, 30},
449 {960, 960, 720, 720, 30, 30}, 461 {960, 960, 720, 720, 30, 30},
450 {1280, 1280, 720, 720, 30, 30}, 462 {1280, 1280, 720, 720, 30, 30},
451 {1920, 1920, 1080, 1080, 30, 30}}; 463 {1920, 1920, 1080, 1080, 30, 30}};
452 464
453 INSTANTIATE_TEST_CASE_P(UserMedia, 465 INSTANTIATE_TEST_CASE_P(UserMedia,
454 WebRtcConstraintsBrowserTest, 466 WebRtcConstraintsBrowserTest,
455 testing::ValuesIn(kAllUserMediaSizes)); 467 testing::ValuesIn(kAllUserMediaSizes));
456 468
457 } // namespace content 469 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698