<html>
  <head>
    <script>
      function saveAndCheckRandomNumber() {
        if (!sessionStorage.lastRandom) {
          sessionStorage.lastRandom = randomNumber;
        } else {
          window.passed = sessionStorage.lastRandom != randomNumber;
        }
      }
    </script>
    <script type="text/javascript" src="resources/cache-simulator.cgi?uniqueId=1&Cache-control=no-store,no-cache,private,must-revalidate,max-age=0"></script>
    <script type="text/javascript" src="resources/cache-simulator.cgi?uniqueId=2&Cache-control=no-store,no-cache,private,must-revalidate,max-age=0" onload="saveAndCheckRandomNumber();"></script>
  </head>
  <body>
    <script type="text/javascript">
      if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
      }
      if (document.referrer != document.location.toString()) {
        console.log('Reloading');
        document.location.reload();
      } else {
        if (window.passed === true) {
          document.body.innerText = "PASS";
        } else if (window.passed === false) {
          document.body.innerText = "FAIL";
        } else {
          document.body.innerText = "ERROR";
        }
        delete sessionStorage.lastRandom;
        if (window.testRunner) {
          testRunner.notifyDone();
        }
      }
    </script>
  </body>
</html>
