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

<!doctype html>
<!--
Tests that when a screen taps causes a frame that isn't presenting to gain
focus, that the presenting frame still receives input.
-->
<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 rafCount = 0;

      function stepSetupFocusLoss() {
        onImmersiveXRFrameCallback = null;
        setTimeout(function() {
          document.getElementById('externalframe').contentWindow.focus();
        }, 1000);
      }

      window.onblur = function() {
        console.log('Blurred, setting second frame callback');
        onImmersiveXRFrameCallback = function() {
          console.log(
              'Got immersive frame while blurred. rafCount: ' + rafCount);
          if (rafCount == 3) {
            done();
          }
          rafCount++;
        }
      }
    </script>
    <iframe id="externalframe" width="1" height="1" src="about:blank" />
  </body>
</html>