| <!doctype html> |
| <!-- |
| Tests that the reported device capabilities match expectations. |
| --> |
| <html> |
| <head> |
| <link rel="stylesheet" type="text/css" href="../resources/webxr_e2e.css"> |
| </head> |
| <body> |
| <canvas id="webgl-canvas"></canvas> |
| <script src="../../../../../../third_party/blink/web_tests/resources/testharness.js"></script> |
| <script src="../resources/webxr_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 |
| "vega": android_expectation, // Lenovo Mirage Solo |
| "sailfish": android_expectation, // Pixel |
| "taimen": android_expectation, // Pixel 2 XL |
| "walleye": android_expectation, // Pixel 2 |
| "VR Orientation Device": { // GVR-less Magic Window implementation |
| "isPresenting": false, |
| "capabilities": { |
| "hasPosition": false, |
| "hasExternalDisplay": false, |
| "canPresent": false, |
| "maxLayers": 0, |
| } |
| }, |
| } |
| 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> |