test_location_getters.html (885B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>MessageEvent tests</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 7 </head> 8 <body onload="test()"> 9 <p id="display"></p> 10 <pre id="test"> 11 <script> 12 SimpleTest.waitForExplicitFinish(); 13 14 function test() 15 { 16 var loc = window.location; 17 is(loc.hash, '', 'Unexpected hash.'); 18 is(loc.host, 'mochi.test:8888', 'Unexpected host.'); 19 is(loc.hostname, 'mochi.test', 'Unexpected hostname.'); 20 is(loc.origin, 'http://mochi.test:8888', 'Unexpected origin.'); 21 is(loc.pathname, '/tests/dom/tests/mochitest/dom-level0/test_location_getters.html', 'Unexpected pathname.'); 22 is(loc.port, '8888', 'Unexpected port.'); 23 is(loc.protocol, 'http:', 'Unexpected protocol.'); 24 SimpleTest.finish(); 25 } 26 </script> 27 </pre> 28 </body> 29 </html>