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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <title>MessageEvent tests</title>
michael@0 5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 7 </head>
michael@0 8 <body>
michael@0 9 <p id="display"></p>
michael@0 10 <pre id="test">
michael@0 11 <script>
michael@0 12 SimpleTest.waitForExplicitFinish();
michael@0 13
michael@0 14 window.addEventListener('message', function (e) {
michael@0 15 console.log(e);
michael@0 16 console.dir(e);
michael@0 17 var loc = e.data;
michael@0 18 is(loc.hash, '', 'Unexpected hash.');
michael@0 19 is(loc.host, 'mochi.test:8888', 'Unexpected host.');
michael@0 20 is(loc.hostname, 'mochi.test', 'Unexpected hostname.');
michael@0 21 // Is this correct? It matches WebKit, but it seems wrong:
michael@0 22 // https://bugs.webkit.org/show_bug.cgi?id=106488
michael@0 23 is(loc.origin, 'http://mochi.test:8888', 'Unexpected origin.');
michael@0 24 is(loc.pathname, '/tests/dom/tests/mochitest/dom-level0/framed_location.html', 'Unexpected pathname.');
michael@0 25 is(loc.port, '8888', 'Unexpected port.');
michael@0 26 is(loc.protocol, 'http:', 'Unexpected protocol.');
michael@0 27 SimpleTest.finish();
michael@0 28 });
michael@0 29 </script>
michael@0 30 <iframe sandbox="allow-scripts" src="framed_location.html"></iframe>
michael@0 31 </pre>
michael@0 32 </body>
michael@0 33 </html>

mercurial