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

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

Issue 195363002: VideoCapturerDelegate: Retrieve supported/in-use format(s) for constraint negotiation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: perkj@s comments 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
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/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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 373 }
374 374
375 // This test calls getUserMedia and checks for aspect ratio behavior. 375 // This test calls getUserMedia and checks for aspect ratio behavior.
376 IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, 376 IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
377 TestGetUserMediaAspectRatio4To3) { 377 TestGetUserMediaAspectRatio4To3) {
378 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 378 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
379 379
380 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); 380 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
381 381
382 std::string constraints_4_3 = GenerateGetUserMediaCall( 382 std::string constraints_4_3 = GenerateGetUserMediaCall(
383 kGetUserMediaAndAnalyseAndStop, 640, 640, 480, 480, 30, 30); 383 kGetUserMediaAndAnalyseAndStop, 640, 640, 480, 480, 30, 10);
384 384
385 // TODO(mcasas): add more aspect ratios, in particular 16:10 crbug.com/275594. 385 // TODO(mcasas): add more aspect ratios, in particular 16:10 crbug.com/275594.
386 386
387 NavigateToURL(shell(), url); 387 NavigateToURL(shell(), url);
388 ASSERT_EQ("4:3 letterbox", 388 ASSERT_EQ("4:3 letterbox",
389 ExecuteJavascriptAndReturnResult(constraints_4_3)); 389 ExecuteJavascriptAndReturnResult(constraints_4_3));
390 } 390 }
391 391
392 // This test calls getUserMedia and checks for aspect ratio behavior. 392 // This test calls getUserMedia and checks for aspect ratio behavior.
393 // TODO(perkj): Enable this test as soon as crbug/349450 is fixed. 393 // TODO(perkj): Enable this test as soon as crbug/349450 is fixed.
394 // Currently the render pipeline doesn't support cropping where the new cropped 394 // Currently the render pipeline doesn't support cropping where the new cropped
395 // frame doesn't have the same top left coordinates as the original frame. 395 // frame doesn't have the same top left coordinates as the original frame.
396 IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, 396 IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
397 DISABLED_TestGetUserMediaAspectRatio16To9) { 397 DISABLED_TestGetUserMediaAspectRatio16To9) {
398 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 398 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
399 399
400 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); 400 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
401 401
402 std::string constraints_16_9 = GenerateGetUserMediaCall( 402 std::string constraints_16_9 = GenerateGetUserMediaCall(
403 kGetUserMediaAndAnalyseAndStop, 640, 640, 360, 360, 30, 30); 403 kGetUserMediaAndAnalyseAndStop, 640, 640, 360, 360, 30, 10);
404 404
405 NavigateToURL(shell(), url); 405 NavigateToURL(shell(), url);
406 ASSERT_EQ("16:9 letterbox", 406 ASSERT_EQ("16:9 letterbox",
407 ExecuteJavascriptAndReturnResult(constraints_16_9)); 407 ExecuteJavascriptAndReturnResult(constraints_16_9));
408 } 408 }
409 409
410 namespace { 410 namespace {
411 411
412 struct UserMediaSizes { 412 struct UserMediaSizes {
413 int min_width; 413 int min_width;
(...skipping 29 matching lines...) Expand all
443 user_media().min_height, 443 user_media().min_height,
444 user_media().max_height, 444 user_media().max_height,
445 user_media().min_frame_rate, 445 user_media().min_frame_rate,
446 user_media().max_frame_rate); 446 user_media().max_frame_rate);
447 DVLOG(1) << "Calling getUserMedia: " << call; 447 DVLOG(1) << "Calling getUserMedia: " << call;
448 NavigateToURL(shell(), url); 448 NavigateToURL(shell(), url);
449 ExecuteJavascriptAndWaitForOk(call); 449 ExecuteJavascriptAndWaitForOk(call);
450 } 450 }
451 451
452 static const UserMediaSizes kAllUserMediaSizes[] = { 452 static const UserMediaSizes kAllUserMediaSizes[] = {
453 {320, 320, 180, 180, 30, 30}, 453 {320, 320, 180, 180, 30, 10},
454 {320, 320, 240, 240, 30, 30}, 454 {320, 320, 240, 240, 30, 10},
455 {640, 640, 360, 360, 30, 30}, 455 {640, 640, 360, 360, 30, 10},
456 {640, 640, 480, 480, 30, 30}, 456 {640, 640, 480, 480, 30, 10},
457 {960, 960, 720, 720, 30, 30}, 457 {960, 960, 720, 720, 30, 10},
458 {1280, 1280, 720, 720, 30, 30}, 458 {1280, 1280, 720, 720, 30, 10},
459 {1920, 1920, 1080, 1080, 30, 30}}; 459 {1920, 1920, 1080, 1080, 30, 10}};
460 460
461 INSTANTIATE_TEST_CASE_P(UserMedia, 461 INSTANTIATE_TEST_CASE_P(UserMedia,
462 WebRtcConstraintsBrowserTest, 462 WebRtcConstraintsBrowserTest,
463 testing::ValuesIn(kAllUserMediaSizes)); 463 testing::ValuesIn(kAllUserMediaSizes));
464 464
465 } // namespace content 465 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698