mirror of
https://github.com/servo/servo.git
synced 2025-07-16 20:03:39 +01:00
24 lines
859 B
HTML
24 lines
859 B
HTML
<!DOCTYPE html>
|
|
<body>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src="resources/webxr_util.js"></script>
|
|
<canvas id="webgl-canvas"></canvas>
|
|
<script>
|
|
|
|
xr_promise_test(
|
|
"A lost webglCanvasContext should not be able to set device",
|
|
(t) => {
|
|
return XRTest.simulateDeviceConnection({ supportsImmersive:true })
|
|
.then( (controller) => { return navigator.xr.requestDevice() })
|
|
.then( (device) => {
|
|
webglCanvas = document.getElementById('webgl-canvas');
|
|
gl = webglCanvas.getContext('webgl', {compatibleXRDevice: device});
|
|
gl.getExtension('WEBGL_lose_context').loseContext();
|
|
return promise_rejects(t, 'InvalidStateError',
|
|
gl.setCompatibleXRDevice(device));
|
|
});
|
|
});
|
|
|
|
</script>
|
|
</body>
|