<!DOCTYPE html>
<html>
  <head>
    <!-- Prevent the browser from requesting any favicon. -->
    <link rel="icon" href="data:," />
  </head>

  <body>
    <h1>Views traversal benchmark</h1>

    <benchmark-root>loading...</benchmark-root>

    <script>
      addEventListener('DOMContentLoaded', () => {
        // DevServer has automatic bootstrap code, so if we already have <scripts> than we don't need to bootstrap
        // two scripts are from Browserstack and this script tag.
        var alreadyBootstrapped = document.querySelectorAll('script').length > 3;
        if (!alreadyBootstrapped) {
          function loadScript(url) {
            return new Promise(function (resolve, reject) {
              var script = document.createElement('script');
              script.src = url;
              script.onload = resolve;
              script.onerror = reject;
              document.body.append(script);
            });
          }
          // zone.js must be loaded and processed before Angular bundle gets executed
          loadScript('/angular/packages/zone.js/bundles/zone.umd.js').then(function () {
            loadScript(
              document.location.search.endsWith('debug') ? 'bundle.debug.min.js' : 'bundle.min.js'
            );
          });
        }
      });
    </script>
  </body>
</html>
