blob: 84bfc453e447dadf046b12dbba3817b713fd6db9 [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) => {
runWithUserGesture( () => {
device.requestSession({ exclusive: true }).then( (session) => {
t.step( () => {
assert_true(session.exclusive);
}, "requestSession resolved as expected");
}, (err) => {
t.step( () => {
assert_unreached("requestSession rejected unexpectedly");
});
}).then( () => {
t.done();
});
});
}, (err) => {
t.step( () => {
assert_unreached("getDevices rejected");
});
});
}, [fakeDisplays["Pixel"]],
"requestSession for an exclusive session with a user gesture resolves");
</script>