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

Unified Diff: content/browser/webrtc/webrtc_image_capture_browsertest.cc

Issue 2341643006: ImageCapture browser tests: use IsWebcamAvailableOnSystem() (Closed)
Patch Set: Rebase to https://crrev.com/2334223012 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/webrtc/webrtc_webcam_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webrtc/webrtc_image_capture_browsertest.cc
diff --git a/content/browser/webrtc/webrtc_image_capture_browsertest.cc b/content/browser/webrtc/webrtc_image_capture_browsertest.cc
index 11311804e077cd975acc98fc4c9b77407ddf3622..82b6a15a28667de32200c80003763e317d2ab9dd 100644
--- a/content/browser/webrtc/webrtc_image_capture_browsertest.cc
+++ b/content/browser/webrtc/webrtc_image_capture_browsertest.cc
@@ -9,6 +9,7 @@
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/test_utils.h"
+#include "content/shell/browser/shell.h"
#include "media/base/media_switches.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
@@ -78,6 +79,11 @@ IN_PROC_BROWSER_TEST_P(WebRtcImageCaptureBrowserTest,
GURL url(embedded_test_server()->GetURL(kImageCaptureHtmlFile));
NavigateToURL(shell(), url);
+ if (!IsWebcamAvailableOnSystem(shell()->web_contents())) {
+ DVLOG(0) << "No video device; skipping test...";
+ return;
+ }
+
std::string result;
ASSERT_TRUE(ExecuteScriptAndExtractString(
shell(), "testCreateAndGetCapabilities()", &result));
@@ -98,6 +104,11 @@ IN_PROC_BROWSER_TEST_P(WebRtcImageCaptureBrowserTest,
GURL url(embedded_test_server()->GetURL(kImageCaptureHtmlFile));
NavigateToURL(shell(), url);
+ if (!IsWebcamAvailableOnSystem(shell()->web_contents())) {
+ DVLOG(0) << "No video device; skipping test...";
+ return;
+ }
+
std::string result;
ASSERT_TRUE(ExecuteScriptAndExtractString(shell(), "testCreateAndTakePhoto()",
&result));
« no previous file with comments | « no previous file | content/browser/webrtc/webrtc_webcam_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698