test_document_location_set_via_xray.html (1403B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=905493 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 905493</title> 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=905493">Mozilla Bug 905493</a> 14 <p id="display"></p> 15 <div id="content" style="display: none"> 16 <iframe id="t" src="http://example.org/tests/dom/bindings/test/file_document_location_set_via_xray.html"></iframe> 17 </div> 18 <pre id="test"> 19 <script type="application/javascript"> 20 21 /** Test for Bug 905493 */ 22 23 function test() { 24 var doc = document.getElementById("t").contentWindow.document; 25 ok(!("x" in doc), "Should have an Xray here"); 26 is(doc.x, undefined, "Really should have an Xray here"); 27 is(doc.wrappedJSObject.x, 5, "And wrapping the right thing"); 28 document.getElementById("t").onload = function() { 29 ok(true, "Load happened"); 30 SimpleTest.finish(); 31 }; 32 try { 33 // Test the forwarding location setter 34 doc.location = "chrome://mochikit/content/tests/SimpleTest/test.css"; 35 } catch (e) { 36 // Load failed 37 ok(false, "Load failed"); 38 SimpleTest.finish(); 39 } 40 } 41 42 SimpleTest.waitForExplicitFinish(); 43 addLoadEvent(test); 44 45 </script> 46 </pre> 47 </body> 48 </html>