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

Side by Side Diff: content/browser/webrtc/webrtc_webcam_browsertest.cc

Issue 2347473004: Revert of Removed duplicated JS hasVideoInputDeviceOnSystem() test helper (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « chrome/test/data/webrtc/media_devices.js ('k') | content/public/test/browser_test_utils.h » ('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 "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
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 if (!IsWebcamAvailableOnSystem(shell()->web_contents())) { 77 ASSERT_TRUE(ExecuteScriptAndExtractString(
78 DVLOG(0) << "No video device; skipping test..."; 78 shell(), "hasVideoInputDeviceOnSystem()", &result));
79 if (result != "has-video-input-device") {
80 VLOG(0) << "No video device; skipping test...";
79 return; 81 return;
80 } 82 }
81 83
82 // GetUserMedia should acquire VGA by default. 84 // GetUserMedia should acquire VGA by default.
83 ASSERT_TRUE(ExecuteScriptAndExtractString( 85 ASSERT_TRUE(ExecuteScriptAndExtractString(
84 shell(), "getUserMediaAndReturnVideoDimensions({video: true})", &result)); 86 shell(), "getUserMediaAndReturnVideoDimensions({video: true})", &result));
85 87
86 if (result == "640x480" || result == "480x640") { 88 if (result == "640x480" || result == "480x640") {
87 // 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
88 // 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 :)
89 return; 91 return;
90 } 92 }
91 FAIL() << "Expected resolution to be 640x480 or 480x640, got" << result; 93 FAIL() << "Expected resolution to be 640x480 or 480x640, got" << result;
92 } 94 }
93 95
94 } // namespace content 96 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/data/webrtc/media_devices.js ('k') | content/public/test/browser_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698