2008-02-11 12:27:32 -08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Hashed kid for test_postMessage_hash.html</title>
|
|
|
|
<script type="application/javascript">
|
|
|
|
function receiveMessage(evt)
|
|
|
|
{
|
|
|
|
var response = "response-message";
|
|
|
|
|
2010-03-12 13:53:36 -08:00
|
|
|
if (window.location.href !== "http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage_hash.html#hash")
|
2008-02-11 12:27:32 -08:00
|
|
|
response += " kid-at-wrong-uri(" + window.location.href + ")";
|
|
|
|
|
2010-03-12 13:53:36 -08:00
|
|
|
if (evt.origin !== "http://mochi.test:8888")
|
2008-02-26 19:48:54 -08:00
|
|
|
response += " wrong-origin(" + evt.origin + ")";
|
2008-02-11 12:27:32 -08:00
|
|
|
if (evt.source !== window.parent)
|
|
|
|
response += " wrong-source";
|
|
|
|
if (evt.data !== "from-parent")
|
|
|
|
response += " wrong-data(" + evt.data + ")";
|
2008-05-02 12:26:47 -07:00
|
|
|
if (evt.lastEventId !== "")
|
|
|
|
response += " wrong-lastEventId(" + evt.lastEventId + ")";
|
2008-02-11 12:27:32 -08:00
|
|
|
|
2010-03-12 13:53:36 -08:00
|
|
|
window.parent.postMessage(response, "http://mochi.test:8888");
|
2008-02-11 12:27:32 -08:00
|
|
|
}
|
|
|
|
|
2008-05-02 12:26:47 -07:00
|
|
|
window.addEventListener("message", receiveMessage, false);
|
2008-02-11 12:27:32 -08:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p>Kid iframe</p>
|
|
|
|
</body>
|
|
|
|
</html>
|