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

Unified Diff: chrome/test/data/android/webvr_instrumentation/html/test_device_capabilities_match_expectations.html

Issue 2794383002: Add WebVR device capability e2e test (Closed)
Patch Set: Address nits Created 3 years, 8 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 | « chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/android/webvr_instrumentation/html/test_device_capabilities_match_expectations.html
diff --git a/chrome/test/data/android/webvr_instrumentation/html/test_device_capabilities_match_expectations.html b/chrome/test/data/android/webvr_instrumentation/html/test_device_capabilities_match_expectations.html
new file mode 100644
index 0000000000000000000000000000000000000000..772de82f29512a0023ac5606041029ccc354992f
--- /dev/null
+++ b/chrome/test/data/android/webvr_instrumentation/html/test_device_capabilities_match_expectations.html
@@ -0,0 +1,53 @@
+<!doctype html>
+<!--
+Tests that the reported device capabilities match expectations.
+-->
+<html>
+ <head>
+ <link rel="stylesheet" type="text/css" href="../resources/webvr_e2e.css">
+ </head>
+ <body>
+ <canvas id="webgl-canvas"></canvas>
+ <script src="../../../../../../third_party/WebKit/LayoutTests/resources/testharness.js"></script>
+ <script src="../resources/webvr_e2e.js"></script>
+ <script src="../resources/webvr_boilerplate.js"></script>
+ <script>
+ // All the current test devices have the same expectations, but that will
+ // change with additional device support, especially desktop.
+ var android_expectation = {
+ "isPresenting": false,
+ "capabilities": {
+ "hasPosition": false,
+ "hasExternalDisplay": false,
+ "canPresent": true,
+ "maxLayers": 1,
+ },
+ }
+ var expectations = {
+ "angler": android_expectation, // Nexus 6P
+ "bullhead": android_expectation, // Nexus 5X
+ "hammerhead": android_expectation, // Nexus 5
+ "marlin": android_expectation, // Pixel XL
+ "sailfish": android_expectation, // Pixel
+ }
+ var t = async_test("Device capabilities match expectations");
+ function stepCheckDeviceCapabilities(device) {
+ if (!(device in expectations)) {
+ t.step_func_done( () => {
+ assert_unreached("Given device " + device + " not in expectations");
+ })();
+ return;
+ }
+ let expectation = expectations[device];
+ t.step_func_done( () => {
+ assert_equals(vrDisplay["isPresenting"], expectation["isPresenting"]);
+ for (var capability in expectation["capabilities"]) {
+ assert_equals(vrDisplay["capabilities"][capability],
+ expectation["capabilities"][capability],
+ capability);
+ }
+ })();
+ }
+ </script>
+ </body>
+</html>
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698