Index: content/browser/webrtc/webrtc_depth_capture_browsertest.cc |
diff --git a/content/browser/webrtc/webrtc_depth_capture_browsertest.cc b/content/browser/webrtc/webrtc_depth_capture_browsertest.cc |
index 4d881801d29a4f3e78e05ab06197b6e22c9b00a5..7d83bed55dd3b99a24fbdda1b435bda713711ae3 100644 |
--- a/content/browser/webrtc/webrtc_depth_capture_browsertest.cc |
+++ b/content/browser/webrtc/webrtc_depth_capture_browsertest.cc |
@@ -12,11 +12,14 @@ |
#include "content/public/test/content_browser_test_utils.h" |
#include "media/base/media_switches.h" |
#include "net/test/embedded_test_server/embedded_test_server.h" |
+#include "ui/gl/gl_switches.h" |
namespace { |
static const char kGetDepthStreamAndCallCreateImageBitmap[] = |
"getDepthStreamAndCallCreateImageBitmap"; |
+static const char kGetDepthStreamAndCallGLTexImage2D[] = |
+ "getDepthStreamAndCallGLTexImage2D"; |
void RemoveSwitchFromCommandLine(base::CommandLine* command_line, |
const std::string& switch_value) { |
@@ -74,4 +77,33 @@ IN_PROC_BROWSER_TEST_F(WebRtcDepthCaptureBrowserTest, |
"%s({video: true});", kGetDepthStreamAndCallCreateImageBitmap)); |
} |
+class WebRtcDepthCaptureWebGLBrowserTest |
+ : public WebRtcDepthCaptureBrowserTest { |
+ void SetUpCommandLine(base::CommandLine* command_line) override { |
+ WebRtcDepthCaptureBrowserTest::SetUpCommandLine(command_line); |
+ // WebGL tests require hardware GPU. |
+ command_line->AppendSwitch(switches::kUseGpuInTests); |
+ } |
+}; |
+ |
+// TODO(aleksandar.stojiljkovic): Enable the test on all the platforms when GPU |
+// process initialization crashes gets resolved. |
+// See https://crbug.com/662336 and https://crbug.com/510291 |
+#if defined(USE_OZONE) || defined(OS_WIN) || defined(MEMORY_SANITIZER) |
+#define MAYBE_GetDepthStreamAndCallGLTexImage2D \ |
+ DISABLED_GetDepthStreamAndCallGLTexImage2D |
+#else |
+#define MAYBE_GetDepthStreamAndCallGLTexImage2D \ |
+ GetDepthStreamAndCallGLTexImage2D |
+#endif |
+IN_PROC_BROWSER_TEST_F(WebRtcDepthCaptureWebGLBrowserTest, |
+ MAYBE_GetDepthStreamAndCallGLTexImage2D) { |
+ ASSERT_TRUE(embedded_test_server()->Start()); |
+ GURL url( |
+ embedded_test_server()->GetURL("/media/getusermedia-depth-capture.html")); |
+ NavigateToURL(shell(), url); |
+ ExecuteJavascriptAndWaitForOk(base::StringPrintf( |
+ "%s({video: true});", kGetDepthStreamAndCallGLTexImage2D)); |
+} |
+ |
} // namespace content |