dom/tests/mochitest/whatwg/postMessage_hash.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/whatwg/postMessage_hash.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Hashed kid for test_postMessage_hash.html</title>
     1.8 +  <script type="application/javascript">
     1.9 +function receiveMessage(evt)
    1.10 +{
    1.11 +  var response = "response-message";
    1.12 +
    1.13 +  if (window.location.href !== "http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage_hash.html#hash")
    1.14 +    response += " kid-at-wrong-uri(" + window.location.href + ")";
    1.15 +
    1.16 +  if (evt.origin !== "http://mochi.test:8888")
    1.17 +    response += " wrong-origin(" + evt.origin + ")";
    1.18 +  if (evt.source !== window.parent)
    1.19 +    response += " wrong-source";
    1.20 +  if (evt.data !== "from-parent")
    1.21 +    response += " wrong-data(" + evt.data + ")";
    1.22 +  if (evt.lastEventId !== "")
    1.23 +    response += " wrong-lastEventId(" + evt.lastEventId + ")";
    1.24 +
    1.25 +  window.parent.postMessage(response, "http://mochi.test:8888");
    1.26 +}
    1.27 +
    1.28 +window.addEventListener("message", receiveMessage, false);
    1.29 +  </script>
    1.30 +</head>
    1.31 +<body>
    1.32 +<p>Kid iframe</p>
    1.33 +</body>
    1.34 +</html>

mercurial