webGLCanvasContext_makecompatible_contextlost.https.html (926B)
1 <!DOCTYPE html> 2 <body> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <script src="resources/webxr_util.js"></script> 6 <script src="resources/webxr_test_constants.js"></script> 7 <script> 8 9 function testContextLost(t, gl) { 10 return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE) 11 .then( (controller) => { 12 return gl.makeXRCompatible(); 13 }).then( () => { 14 gl.getExtension('WEBGL_lose_context').loseContext(); 15 return promise_rejects_dom(t, 'InvalidStateError', gl.makeXRCompatible()); 16 }); 17 } 18 19 xr_promise_test( 20 "A lost webgl context should not be able to set xr compatibility", 21 testContextLost, null, 'webgl'); 22 23 xr_promise_test( 24 "A lost webgl2 context should not be able to set xr compatibility", 25 testContextLost, null, 'webgl2'); 26 27 </script> 28 </body>