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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Android bots will run the test since they ignore MANUAL, but that's what we | 67 // Android bots will run the test since they ignore MANUAL, but that's what we |
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 if (!IsWebcamAvailableOnSystem(shell()->web_contents())) { |
78 shell(), "hasVideoInputDeviceOnSystem()", &result)); | 78 DVLOG(0) << "No video device; skipping test..."; |
79 if (result != "has-video-input-device") { | |
80 VLOG(0) << "No video device; skipping test..."; | |
81 return; | 79 return; |
82 } | 80 } |
83 | 81 |
84 // GetUserMedia should acquire VGA by default. | 82 // GetUserMedia should acquire VGA by default. |
85 ASSERT_TRUE(ExecuteScriptAndExtractString( | 83 ASSERT_TRUE(ExecuteScriptAndExtractString( |
86 shell(), "getUserMediaAndReturnVideoDimensions({video: true})", &result)); | 84 shell(), "getUserMediaAndReturnVideoDimensions({video: true})", &result)); |
87 | 85 |
88 if (result == "640x480" || result == "480x640") { | 86 if (result == "640x480" || result == "480x640") { |
89 // Don't care if the device happens to be in landscape or portrait mode | 87 // 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 :) | 88 // since we don't know how it is oriented in the lab :) |
91 return; | 89 return; |
92 } | 90 } |
93 FAIL() << "Expected resolution to be 640x480 or 480x640, got" << result; | 91 FAIL() << "Expected resolution to be 640x480 or 480x640, got" << result; |
94 } | 92 } |
95 | 93 |
96 } // namespace content | 94 } // namespace content |
OLD | NEW |