chromium/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/resources/replace-or-assign-call-on-iframe.html

<!DOCTYPE HTML>
<html>
  <head>
    <title>Referer with location.replace and location.assign</title>
  </head>
  <body>
    <iframe src="/resources/blank.html" hidden></iframe>
    <script>
      window.addEventListener('message', function (e) {
        const referrer = e.data;
        window.parent.postMessage(referrer);
      });
      if (window.location.search === "?replace") {
        document.querySelector("iframe").contentWindow.location.replace("iframe-contents.sub.html?replace");
      } else if (window.location.search === "?assign") {
        document.querySelector("iframe").contentWindow.location.assign("iframe-contents.sub.html?assign");
      }
    </script>
  </body>
</html>