dom/tests/mochitest/whatwg/postMessage_idn_helper.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/whatwg/postMessage_idn_helper.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,41 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>postMessage IDN test page</title>
     1.8 +  <script type="application/javascript">
     1.9 +    function receiveMessage(evt)
    1.10 +    {
    1.11 +      var response = "idn-response";
    1.12 +
    1.13 +      if (!(evt instanceof MessageEvent))
    1.14 +        response += " not-a-MessageEvent";
    1.15 +      if (evt.origin !== "http://mochi.test:8888")
    1.16 +        response += " wrong-sender-origin(" + evt.origin + ")";
    1.17 +      if (evt.data !== "idn-message")
    1.18 +        response += " wrong-data(" + evt.data + ")";
    1.19 +      if (evt.lastEventId !== "")
    1.20 +        response += " wrong-lastEventId(" + evt.lastEventId + ")";
    1.21 +      if (evt.source !== window.parent)
    1.22 +        response += " wrong-source";
    1.23 +      if (evt.target !== window)
    1.24 +        response += " wrong-target";
    1.25 +      if (evt.type !== "message")
    1.26 +        response += " wrong-type(" + evt.type + ")";
    1.27 +
    1.28 +      evt.source.postMessage(response, evt.origin);
    1.29 +    }
    1.30 +    window.addEventListener("message", receiveMessage, false);
    1.31 +
    1.32 +    function setup()
    1.33 +    {
    1.34 +      var target = document.getElementById("location");
    1.35 +      target.textContent = location.hostname + ":" + (location.port || 80);
    1.36 +    }
    1.37 +
    1.38 +    window.addEventListener("load", setup, false);
    1.39 +  </script>
    1.40 +</head>
    1.41 +<body>
    1.42 +<h1 id="location">No location!</h1>
    1.43 +</body>
    1.44 +</html>

mercurial