dom/tests/mochitest/general/test_frameElementWrapping.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:417744cdb40a
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for same-origin and cross-origin wrapping of frameElement</title>
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
7 </head>
8 <body>
9 <p id="display"></p>
10 <div id="content" style="display: none">
11
12 </div>
13 <iframe id="ifr" src="file_frameElementWrapping.html"></iframe>
14 <pre id="test">
15 <script class="testbody" type="text/javascript">
16
17 //
18 // This test has sort of morphed over time to become less and less useful.
19 // In the past, we had special security policy for frameElement, but that's
20 // more or less gone away with compartment/proxy wrapping. So we just go
21 // through the motions to make sure that, indeed, frameElement is subject
22 // to the same-origin policy.
23 //
24
25 SimpleTest.waitForExplicitFinish();
26
27 var count = 0;
28
29 function runTest(result, message) {
30 ok(result === 'PASS', message);
31
32 if (++count === 2)
33 SimpleTest.finish();
34 else
35 $('ifr').contentWindow.location = 'http://example.org/tests/dom/tests/mochitest/general/file_frameElementWrapping.html';
36 }
37
38 window.addEventListener("message",
39 function(event) { runTest.apply(null, event.data.split(',')) },
40 false);
41
42 </script>
43 </pre>
44 </body>
45 </html>

mercurial