https://github.com/web-platform-tests/wpt
Raw File
Tip revision: fe38104efc1fefb450302f42f157855f579d174c authored by Lan Wei on 15 December 2018, 01:20:34 UTC
Support multiple mouse pointers inputs
Tip revision: fe38104
webGLCanvasContext_setdevice_contextlost.https.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>
back to top