Chromium Code Reviews| 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 "content/browser/webrtc/webrtc_webcam_browsertest.h" | 5 #include "content/browser/webrtc/webrtc_webcam_browsertest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 // want here since the bot runs tests sequentially on the device. | 68 // want here since the bot runs tests sequentially on the device. |
| 69 IN_PROC_BROWSER_TEST_F(WebRtcWebcamBrowserTest, | 69 IN_PROC_BROWSER_TEST_F(WebRtcWebcamBrowserTest, |
| 70 MANUAL_CanAcquireVgaOnRealWebcam) { | 70 MANUAL_CanAcquireVgaOnRealWebcam) { |
| 71 ASSERT_TRUE(embedded_test_server()->Start()); | 71 ASSERT_TRUE(embedded_test_server()->Start()); |
| 72 GURL url(embedded_test_server()->GetURL( | 72 GURL url(embedded_test_server()->GetURL( |
| 73 "/media/getusermedia-real-webcam.html")); | 73 "/media/getusermedia-real-webcam.html")); |
| 74 NavigateToURL(shell(), url); | 74 NavigateToURL(shell(), url); |
| 75 | 75 |
| 76 std::string result; | 76 std::string result; |
| 77 ASSERT_TRUE(ExecuteScriptAndExtractString( | 77 ASSERT_TRUE(ExecuteScriptAndExtractString( |
| 78 shell(), "hasVideoInputDeviceOnSystem()", &result)); | 78 shell(), content::hasVideoInputDeviceFunction, &result)); |
|
mcasas
2016/09/06 15:34:54
No need to specify content::
Also, here you seem
lunalu1
2016/09/06 20:56:13
Done.
| |
| 79 if (result != "has-video-input-device") { | 79 if (result != "has-video-input-device") { |
| 80 VLOG(0) << "No video device; skipping test..."; | 80 VLOG(0) << "No video device; skipping test..."; |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 | 83 |
| 84 // GetUserMedia should acquire VGA by default. | 84 // GetUserMedia should acquire VGA by default. |
| 85 ASSERT_TRUE(ExecuteScriptAndExtractString( | 85 ASSERT_TRUE(ExecuteScriptAndExtractString( |
| 86 shell(), "getUserMediaAndReturnVideoDimensions({video: true})", &result)); | 86 shell(), "getUserMediaAndReturnVideoDimensions({video: true})", &result)); |
| 87 | 87 |
| 88 if (result == "640x480" || result == "480x640") { | 88 if (result == "640x480" || result == "480x640") { |
| 89 // Don't care if the device happens to be in landscape or portrait mode | 89 // Don't care if the device happens to be in landscape or portrait mode |
| 90 // since we don't know how it is oriented in the lab :) | 90 // since we don't know how it is oriented in the lab :) |
| 91 return; | 91 return; |
| 92 } | 92 } |
| 93 FAIL() << "Expected resolution to be 640x480 or 480x640, got" << result; | 93 FAIL() << "Expected resolution to be 640x480 or 480x640, got" << result; |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace content | 96 } // namespace content |
| OLD | NEW |