blob: 94c632f51b46f57508270c8c08db93c4a52014b1 [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="file:///gen/device/vr/public/mojom/vr_service.mojom.js"></script>
<script src="../external/wpt/resources/chromium/webxr-test.js"></script>
<script src="../xr/resources/xr-test-utils.js"></script>
<canvas id="webgl-canvas"></canvas>
<script>
promise_test( (t) => {
webglCanvasSetup();
return XRTest.simulateDeviceConnection({ supportsImmersive:true })
.then( (controller) => new Promise((resolve) => {
runWithUserGesture( () => {
resolve(navigator.xr.requestSession({ mode: 'immersive-vr' })
.then( (session) => new Promise((resolve) => {
try {
let webglLayer = new XRWebGLLayer(session, gl);
reject("XRWebGLLayer should fail with invalid arguments");
} catch (err) {
assert_equals(err.name, "InvalidStateError");
resolve();
}
})));
});
}));
}, "XRWebGLLayer throws error when the session device is not the set device");
</script>