chromium/chrome/test/data/xr/e2e_test_files/html/test_webxr_capabilities.html

<!doctype html>
<!--
Tests that the provided WebXR device has the expected capabilities
-->
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="../resources/webxr_e2e.css">
  </head>
  <body>
    <canvas id="webgl-canvas"></canvas>
    <script src="../../../../../../third_party/blink/web_tests/resources/testharness.js"></script>
    <script src="../resources/webxr_e2e.js"></script>
    <script src="../resources/webxr_boilerplate.js"></script>
    <script>
      function stepCheckCapabilities() {
        var supportsNonImmersive;
        var supportsImmersive;
        console.log('Checking inline session support');
        navigator.xr.isSessionSupported('inline').then((supported) => {
          console.log('Got inline support: ' + supported);
          supportsNonImmersive = supported;
        }).then( () => {
          console.log('Checking immersive support');
          navigator.xr.isSessionSupported('immersive-vr').then((supported) => {
            console.log('Got immersive support: ' + supported);
            supportsImmersive = supported;
          }).then(() => {
            assert_true(supportsNonImmersive,
                'Device supports non-immersive sessions');
            assert_true(supportsImmersive,
                'Device supports immersive sessions');
            done();
          });
        });
      }
    </script>
  </body>
</html>