|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=707564 |
|
5 --> |
|
6 <head> |
|
7 <meta charset="utf-8"> |
|
8 <title>Test for Bug 707564</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=707564">Mozilla Bug 707564</a> |
|
14 <p id="display"></p> |
|
15 <div id="content" style="display: none"> |
|
16 <iframe id="t1" src="http://example.org/tests/dom/bindings/test/file_bug707564.html"></iframe> |
|
17 <iframe id="t2" src="http://example.org/tests/dom/bindings/test/file_bug707564.html"></iframe> |
|
18 </div> |
|
19 <pre id="test"> |
|
20 <script type="application/javascript"> |
|
21 |
|
22 /** Test for Bug 775543 **/ |
|
23 function test() |
|
24 { |
|
25 var nav = document.getElementById("t1").contentWindow.navigator; |
|
26 ise(nav.foopy, undefined, "We should have an Xray now"); |
|
27 is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object"); |
|
28 var props = Object.getOwnPropertyNames(nav); |
|
29 isnot(props.indexOf("mozApps"), -1, |
|
30 "Should enumerate a mozApps property on navigator xray"); |
|
31 |
|
32 var nav = document.getElementById("t2").contentWindow.navigator; |
|
33 ise(nav.foopy, undefined, "We should have an Xray now again"); |
|
34 is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object again"); |
|
35 var found = false; |
|
36 for (var name in nav) { |
|
37 if (name == "mozApps") { |
|
38 found = true; |
|
39 } |
|
40 } |
|
41 ok(found, "Should enumerate a mozApps property on navigator xray via for...in"); |
|
42 |
|
43 SimpleTest.finish(); |
|
44 } |
|
45 |
|
46 addLoadEvent(test); |
|
47 |
|
48 SimpleTest.waitForExplicitFinish(); |
|
49 </script> |
|
50 </pre> |
|
51 </body> |
|
52 </html> |