OLD | NEW |
1 <html> | 1 <html> |
2 <body onload="AccessInnerDocument()"> | 2 <body> |
| 3 Tests that node wrappers are created in the context to which they belong. |
| 4 You should see PASS below. |
| 5 <br> |
3 <div id="output"></div> | 6 <div id="output"></div> |
4 <iframe id="inner" src="resources/wrapper-context-inner.html"></iframe> | 7 <iframe id="inner" src="resources/wrapper-context-inner.html"></iframe> |
5 <script> | 8 <script> |
6 if (window.layoutTestController) { | 9 if (window.layoutTestController) { |
7 layoutTestController.waitUntilDone(); | 10 layoutTestController.dumpAsText(); |
8 layoutTestController.dumpAsText(); | 11 layoutTestController.waitUntilDone(); |
9 } | 12 } |
10 | 13 |
11 // Write to the output div. | 14 function writeOutput(s) { |
12 function WriteOutput(s) { | 15 var paragraph = document.createElement("p"); |
13 var paragraph = document.createElement("p"); | 16 paragraph.innerHTML = s; |
14 paragraph.innerHTML = s; | 17 document.getElementById("output").appendChild(paragraph); |
15 document.getElementById("output").appendChild(paragraph); | |
16 } | 18 } |
17 | 19 |
18 // Used from the inner frame to know when this frame has accessed | 20 // Used to create the document wrapper. |
19 // the document of the inner frame. | |
20 var innerDocument; | 21 var innerDocument; |
21 | 22 |
22 // Once the inner frame has loaded, access it's document and assign | 23 // Once the inner frame has loaded, run the test. |
23 // the wrapper to innerDocument. | 24 function innerHasLoaded() { |
24 function AccessInnerDocument() { | 25 writeOutput("Running..."); |
25 if (inner.loaded) { | |
26 innerDocument = inner.document; | 26 innerDocument = inner.document; |
27 } else { | 27 inner.runTest(); |
28 setTimeout(AccessInnerDocument, 100); | |
29 } | |
30 } | 28 } |
31 </script> | 29 </script> |
32 </body> | 30 </body> |
33 </html> | 31 </html> |
OLD | NEW |