| <!DOCTYPE html> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script src="../vr/resources/fake-vr-displays.js"></script> |
| <script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script> |
| <script src="file:///gen/device/vr/vr_service.mojom.js"></script> |
| <script src="../vr/resources/mock-vr-service.js"></script> |
| <script src="../vr/resources/test-constants.js"></script> |
| <canvas id="webgl-canvas"></canvas> |
| <script src="../vr/resources/presentation-setup.js"></script> |
| <script> |
| let fakeDisplays = fakeVRDisplays(); |
| vr_test( (t) => { |
| return navigator.xr.requestDevice().then( (magicWindowOnlyDevice) => { |
| runWithUserGesture( () => { |
| |
| magicWindowOnlyDevice.requestSession({ exclusive: true }).then(() => { |
| assert_unreached("requestSession resolved unexpectedly"); |
| }, (e) => { |
| assert_equals(e.name, "NotSupportedError"); |
| t.done(); |
| }); |
| |
| }); |
| }, (err) => { |
| t.step( () => { |
| assert_unreached("requestDevice rejected"); |
| }); |
| }); |
| }, [fakeDisplays["FakeMagicWindowOnly"]], |
| "requesting an exclusive session on an unsupported device rejects"); |
| |
| </script> |