blob: 9e48a21d6bd70bd43c944ca12931a2f2cc54d86c [file] [log] [blame]
<!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( (device) => {
device.requestSession({ exclusive: true }).then(() => {
assert_unreached("requestSession resolved unexpectedly");
}).catch((e) => {
assert_equals(e.name, "InvalidStateError");
t.done();
});
}, (err) => {
t.step( () => {
assert_unreached("getDevices rejected");
});
});
}, [fakeDisplays["Pixel"]],
"requestSession with an exclusive session outside of a user gesture rejects");
</script>