1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/dom-level0/test_location_sandboxed.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 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 this correct? It matches WebKit, but it seems wrong: 1.25 + // https://bugs.webkit.org/show_bug.cgi?id=106488 1.26 + is(loc.origin, 'http://mochi.test:8888', 'Unexpected origin.'); 1.27 + is(loc.pathname, '/tests/dom/tests/mochitest/dom-level0/framed_location.html', 'Unexpected pathname.'); 1.28 + is(loc.port, '8888', 'Unexpected port.'); 1.29 + is(loc.protocol, 'http:', 'Unexpected protocol.'); 1.30 + SimpleTest.finish(); 1.31 + }); 1.32 + </script> 1.33 + <iframe sandbox="allow-scripts" src="framed_location.html"></iframe> 1.34 + </pre> 1.35 +</body> 1.36 +</html>