| 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>
|
|
|