dom/tests/mochitest/dom-level0/test_location_framed.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/dom-level0/test_location_framed.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>MessageEvent tests</title>
     1.8 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.10 +</head>
    1.11 +<body>
    1.12 +  <p id="display"></p>
    1.13 +  <pre id="test">
    1.14 +  <script>
    1.15 +  SimpleTest.waitForExplicitFinish();
    1.16 +
    1.17 +  window.addEventListener('message', function (e) {
    1.18 +    console.log(e);
    1.19 +    console.dir(e);
    1.20 +    var loc = e.data;
    1.21 +    is(loc.hash, '', 'Unexpected hash.');
    1.22 +    is(loc.host, 'mochi.test:8888', 'Unexpected host.');
    1.23 +    is(loc.hostname, 'mochi.test', 'Unexpected hostname.');
    1.24 +    is(loc.origin, 'http://mochi.test:8888', 'Unexpected origin.');
    1.25 +    is(loc.pathname, '/tests/dom/tests/mochitest/dom-level0/framed_location.html', 'Unexpected pathname.');
    1.26 +    is(loc.port, '8888', 'Unexpected port.');
    1.27 +    is(loc.protocol, 'http:', 'Unexpected protocol.');
    1.28 +    SimpleTest.finish();
    1.29 +  });
    1.30 +  </script>
    1.31 +  <iframe src="framed_location.html"></iframe>
    1.32 +  </pre>
    1.33 +</body>
    1.34 +</html>

mercurial