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

<!doctype html>
<!--
WebXR page with the ability to request permissions.
-->
<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>
      var lastPermissionRequestSucceeded = false;
      var storedValue = null;
      function requestPermission(permissionObject, storeValue) {
        navigator.getUserMedia(permissionObject,
        (val) => {
          console.log(
              'Permission request succeeded with val ' + val +
              '. Previous permission request successful: ' +
              lastPermissionRequestSucceeded);
          lastPermissionRequestSucceeded = true;
          if (storeValue) {
            storedValue = val;
          }
          finishJavaScriptStep();
        },
        () => {
          console.log(
              'Permission request failed. Previous permission request ' +
              'successful: ' + lastPermissionRequestSucceeded);
          lastPermissionRequestSucceeded = false;
          finishJavaScriptStep();
        });
      }
    </script>
  </body>
</html>