|
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 type="application/javascript" 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 { |
|
25 var doc = document.getElementById("t").contentWindow.document; |
|
26 ok(!("x" in doc), "Should have an Xray here"); |
|
27 is(doc.x, undefined, "Really should have an Xray here"); |
|
28 is(doc.wrappedJSObject.x, 5, "And wrapping the right thing"); |
|
29 document.getElementById("t").onload = function() { |
|
30 ok(true, "Load happened"); |
|
31 SimpleTest.finish(); |
|
32 }; |
|
33 try { |
|
34 // Test the forwarding location setter |
|
35 doc.location = "chrome://mochikit/content/tests/SimpleTest/test.css"; |
|
36 } catch (e) { |
|
37 // Load failed |
|
38 ok(false, "Load failed"); |
|
39 SimpleTest.finish(); |
|
40 } |
|
41 } |
|
42 |
|
43 SimpleTest.waitForExplicitFinish(); |
|
44 addLoadEvent(test); |
|
45 |
|
46 </script> |
|
47 </pre> |
|
48 </body> |
|
49 </html> |