docshell/test/navigation/file_bug1379762-2.html
author Daisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 26 Feb 2019 10:21:29 +0000
changeset 518943 383b6665578306219dd34b178353e100ca2848eb
parent 501291 db6a356eef5952d3365a6b4ec2f454e3293d4b5e
permissions -rw-r--r--
Bug 1525615: Introduce 'card' style. r=jdescottes,ladybenko Depends on D20295 Differential Revision: https://phabricator.services.mozilla.com/D20640

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Bug 1379762</title>
  </head>
  <script type="text/just-data">
    onunload = null; // enable bfcache
    ++opener.testCount;
    onpageshow = function(e) {
      opener.ok(!e.persisted, "Pageshow should not be coming from bfcache " + opener.testCount);
    }
    if (opener.testCount == 1) {
      onload = function () {
        setTimeout(function() {
          document.write(testScript);
        }, 0);
      }
    } else if (opener.testCount == 2) {
      // Do this async, just in case.
      setTimeout(function() {
        history.back();
      }, 0);
    } else if (opener.testCount == 3) {
      // Do this async, just in case.
      setTimeout(function() {
        history.forward();
      }, 0);
    } else if (opener.testCount == 4) {
      onload = function() {
        opener.nextTest();
        window.close();
      }
    }
  </script>
  <script>
    var data = document.querySelector("script[type='text/just-data']").textContent;
    // Store the string that does all out work in a global variable, so we can
    // get at it later.
    // eslint-disable-next-line no-useless-concat
    var testScript = "<script>" + data + "</" + "script>";
    document.write(testScript);
  </script>
</html>