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

branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
equal deleted inserted replaced
-1:000000000000 0:4beece8399ec
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>MessageEvent tests</title>
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
7 </head>
8 <body>
9 <p id="display"></p>
10 <pre id="test">
11 <script>
12 SimpleTest.waitForExplicitFinish();
13
14 window.addEventListener('message', function (e) {
15 console.log(e);
16 console.dir(e);
17 var loc = e.data;
18 is(loc.hash, '', 'Unexpected hash.');
19 is(loc.host, 'mochi.test:8888', 'Unexpected host.');
20 is(loc.hostname, 'mochi.test', 'Unexpected hostname.');
21 is(loc.origin, 'http://mochi.test:8888', 'Unexpected origin.');
22 is(loc.pathname, '/tests/dom/tests/mochitest/dom-level0/framed_location.html', 'Unexpected pathname.');
23 is(loc.port, '8888', 'Unexpected port.');
24 is(loc.protocol, 'http:', 'Unexpected protocol.');
25 SimpleTest.finish();
26 });
27 </script>
28 <iframe src="framed_location.html"></iframe>
29 </pre>
30 </body>
31 </html>

mercurial