js/xpconnect/tests/mochitest/file1_bug629227.html
author Bobby Holley <bobbyholley@gmail.com>
Fri, 14 Oct 2011 10:52:47 -0700
changeset 78738 51541b56d20d588edc5a6111d670ca5af3db39d5
parent 62726 js/src/xpconnect/tests/mochitest/file1_bug629227.html@19731df33d98b9b8fa12820f344eb4c80278cdf5
permissions -rw-r--r--
Bug 691411 - Move js/src/xpconnect to js/xpconnect and rename source files while we're at it. r=khuey, sr=mrbkap

<!DOCTYPE html>
<html>
  <head>
    <script>
      function doIt() {
        var doc = window.frames[0].document;
        var ok = (doc.form1 == doc.getElementById("test1"));
        window.parent.postMessage(
          JSON.stringify({ ok: ok,
                           reason: "Should be able to get named items by name" }),
                         "*");
        window.parent.postMessage("finish", "*");
      }

      window.onmessage = function(ev) {
        if (ev.data == "start") {
          doIt();
        }
      }

      document.domain = "example.org";
    </script>
  </head>
  <body>
    <iframe id="subframe"></iframe>
    <script>
      document.getElementById("subframe").src =
        "http://test2.example.org" +
        location.pathname.replace(/file1_bug629227.html/, "file2_bug629227.html");
    </script>
  </body>
</html>