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

Side by Side Diff: content/public/test/browser_test_utils.cc

Issue 2341643006: ImageCapture browser tests: use IsWebcamAvailableOnSystem() (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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/public/test/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <tuple> 8 #include <tuple>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // Queries for video input devices on the current system using the getSources 411 // Queries for video input devices on the current system using the getSources
412 // API. 412 // API.
413 // 413 //
414 // This does not guarantee that a getUserMedia with video will succeed, as the 414 // This does not guarantee that a getUserMedia with video will succeed, as the
415 // camera could be busy for instance. 415 // camera could be busy for instance.
416 // 416 //
417 // Returns has-video-input-device to the test if there is a webcam available, 417 // Returns has-video-input-device to the test if there is a webcam available,
418 // no-video-input-devices otherwise. 418 // no-video-input-devices otherwise.
419 const char kHasVideoInputDeviceOnSystem[] = 419 const char kHasVideoInputDeviceOnSystem[] =
420 "(function() {" 420 "(function() {"
421 "navigator.mediaDevices.enumerateDevices()" 421 " navigator.mediaDevices.enumerateDevices()"
lunalu1 2016/09/16 16:56:22 We can revert these changes now since these have b
mcasas 2016/09/19 22:42:17 Done: PS2 doesn't touch this file anymore.
422 ".then(function(devices) {" 422 " .then((devices) => {"
423 "devices.forEach(function(device) {" 423 " devices.forEach(function(device) {"
424 "if (device.kind == 'video') {" 424 " if (device.kind == 'videoinput') {"
425 "returnToTest('has-video-input-device');" 425 " window.domAutomationController.send('has-video-input-device');"
426 "return;" 426 " return;"
427 "}" 427 " }"
428 "});" 428 " });"
429 "returnToTest('no-video-input-devices');" 429 " window.domAutomationController.send('no-video-input-devices');"
430 "});" 430 " });"
431 "})()"; 431 "})()";
432 432
433 const char kHasVideoInputDevice[] = "has-video-input-device"; 433 const char kHasVideoInputDevice[] = "has-video-input-device";
434 434
435 } // namespace 435 } // namespace
436 436
437 bool NavigateIframeToURL(WebContents* web_contents, 437 bool NavigateIframeToURL(WebContents* web_contents,
438 std::string iframe_id, 438 std::string iframe_id,
439 const GURL& url) { 439 const GURL& url) {
440 std::string script = base::StringPrintf( 440 std::string script = base::StringPrintf(
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 1720
1721 bool TestNavigationManager::ShouldMonitorNavigation(NavigationHandle* handle) { 1721 bool TestNavigationManager::ShouldMonitorNavigation(NavigationHandle* handle) {
1722 if (handle_ || handle->GetURL() != url_) 1722 if (handle_ || handle->GetURL() != url_)
1723 return false; 1723 return false;
1724 if (handled_navigation_) 1724 if (handled_navigation_)
1725 return false; 1725 return false;
1726 return true; 1726 return true;
1727 } 1727 }
1728 1728
1729 } // namespace content 1729 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/webrtc/webrtc_webcam_browsertest.cc ('k') | content/test/data/media/image_capture_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698