@ 261106.15
current
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>Emscripten Browser Test Harness</title>
  <style>
    html, body {
      margin: 0;
      padding: 0;
      height: 100%;
    }
    body {
      display: flex;
      flex-direction: column;
    }
    .topbar {
      background-color: #79f;
    }
    .full {
      border: none;
      width: 100%;
      flex: 1;
    }
  </style>
  <script>
    var counter = 0;
    async function check() {
      try {
        const rsp = await fetch('/check');
        const responseText = await rsp.text();

        const COMMAND_PREFIX = 'COMMAND:';
        if (responseText.startsWith(COMMAND_PREFIX)) {
          var url = responseText.substr(COMMAND_PREFIX.length);
          iframe.src = url;
          document.getElementById('count').textContent = counter++;
        }
        // Polling for the next test to start: we just keep asking if we
        // should load a new page, since the iframe doesn't currently have
        // a way to tell us it completed (even if it did, we'd need to poll
        // the server to know when the next test page is ready to load).
        // (A timeout value of 100msecs has been seen to stall test
        //  browser.test_audio_worklet_worker on Chrome)
        setTimeout(check, 200);
      } catch {
        document.body.innerHTML = 'Tests complete. View log in console.';
        // Attempt to close the main window.  This works on chrome
        // but fails on firefox with: `Scripts may not close windows that
        // were not opened by script.`
        window.close();
      }
    }
    document.addEventListener('DOMContentLoaded', check);
  </script>
</head>
<body>
  <span class="topbar">Running test <span id="count"></span>...</span>
  <iframe class="full" id="iframe" allowfullscreen="true"></iframe>
</body>
</html>