| 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/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
| 9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
| 10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // Android bots will run the test since they ignore MANUAL, but that's what we | 71 // Android bots will run the test since they ignore MANUAL, but that's what we |
| 72 // want here since the bot runs tests sequentially on the device. | 72 // want here since the bot runs tests sequentially on the device. |
| 73 IN_PROC_BROWSER_TEST_F(WebRtcWebcamBrowserTest, | 73 IN_PROC_BROWSER_TEST_F(WebRtcWebcamBrowserTest, |
| 74 MANUAL_CanAcquireVgaOnRealWebcam) { | 74 MANUAL_CanAcquireVgaOnRealWebcam) { |
| 75 ASSERT_TRUE(embedded_test_server()->Start()); | 75 ASSERT_TRUE(embedded_test_server()->Start()); |
| 76 GURL url(embedded_test_server()->GetURL( | 76 GURL url(embedded_test_server()->GetURL( |
| 77 "/media/getusermedia-real-webcam.html")); | 77 "/media/getusermedia-real-webcam.html")); |
| 78 NavigateToURL(shell(), url); | 78 NavigateToURL(shell(), url); |
| 79 | 79 |
| 80 std::string result; | 80 std::string result; |
| 81 ASSERT_TRUE(ExecuteScriptAndExtractString(shell()->web_contents(), | 81 ASSERT_TRUE(ExecuteScriptAndExtractString( |
| 82 "hasVideoInputDeviceOnSystem()", | 82 shell(), "hasVideoInputDeviceOnSystem()", &result)); |
| 83 &result)); | |
| 84 if (result != "has-video-input-device") { | 83 if (result != "has-video-input-device") { |
| 85 VLOG(0) << "No video device; skipping test..."; | 84 VLOG(0) << "No video device; skipping test..."; |
| 86 return; | 85 return; |
| 87 } | 86 } |
| 88 | 87 |
| 89 // GetUserMedia should acquire VGA by default. | 88 // GetUserMedia should acquire VGA by default. |
| 90 ASSERT_TRUE(ExecuteScriptAndExtractString( | 89 ASSERT_TRUE(ExecuteScriptAndExtractString( |
| 91 shell()->web_contents(), | 90 shell(), "getUserMediaAndReturnVideoDimensions({video: true})", &result)); |
| 92 "getUserMediaAndReturnVideoDimensions({video: true})", | |
| 93 &result)); | |
| 94 | 91 |
| 95 if (result == "640x480" || result == "480x640") { | 92 if (result == "640x480" || result == "480x640") { |
| 96 // Don't care if the device happens to be in landscape or portrait mode | 93 // Don't care if the device happens to be in landscape or portrait mode |
| 97 // since we don't know how it is oriented in the lab :) | 94 // since we don't know how it is oriented in the lab :) |
| 98 return; | 95 return; |
| 99 } | 96 } |
| 100 FAIL() << "Expected resolution to be 640x480 or 480x640, got" << result; | 97 FAIL() << "Expected resolution to be 640x480 or 480x640, got" << result; |
| 101 } | 98 } |
| 102 | 99 |
| 103 } // namespace content | 100 } // namespace content |
| OLD | NEW |