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

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

Issue 2476693002: WebGL & 16-bit video stream: upload to FLOAT texture. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
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..4bbc729b9d9d8be049160459aab37a0a92d9dcdc 100644
--- a/content/browser/webrtc/webrtc_depth_capture_browsertest.cc
+++ b/content/browser/webrtc/webrtc_depth_capture_browsertest.cc
@@ -12,11 +12,16 @@
#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 kDepthStreamToRGBAUint8Texture[] =
+ "depthStreamToRGBAUint8Texture";
+static const char kDepthStreamToRGBAFloatTexture[] =
+ "depthStreamToRGBAFloatTexture";
void RemoveSwitchFromCommandLine(base::CommandLine* command_line,
const std::string& switch_value) {
@@ -74,4 +79,51 @@ 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_DepthStreamToRGBAUint8Texture \
+ DISABLED_DepthStreamToRGBAUint8Texture
+#else
+#define MAYBE_DepthStreamToRGBAUint8Texture DepthStreamToRGBAUint8Texture
+#endif
+IN_PROC_BROWSER_TEST_F(WebRtcDepthCaptureWebGLBrowserTest,
+ MAYBE_DepthStreamToRGBAUint8Texture) {
+ 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});", kDepthStreamToRGBAUint8Texture));
+}
+
+// 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_DepthStreamToRGBAFloatTexture \
+ DISABLED_DepthStreamToRGBAFloatTexture
+#else
+#define MAYBE_DepthStreamToRGBAFloatTexture DepthStreamToRGBAFloatTexture
+#endif
+IN_PROC_BROWSER_TEST_F(WebRtcDepthCaptureWebGLBrowserTest,
+ MAYBE_DepthStreamToRGBAFloatTexture) {
+ 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});", kDepthStreamToRGBAFloatTexture));
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698