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

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

Issue 2052633002: Extend the ToRenderFrameHost magic to FrameTreeNode* and Shell* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix induced script bug. Created 4 years, 6 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/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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698