dom/tests/mochitest/dom-level0/test_crossdomainprops.html

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:4c296b622e23
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for Cross domain access to properties</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 onload="runTest()">
9 <p id="display"></p>
10 <div id="content" style="display: none">
11
12 </div>
13 <iframe name="frame1" src="file_crossdomainprops_inner.html"></iframe>
14 <iframe name="frame2" src="http://example.com/tests/dom/tests/mochitest/dom-level0/file_crossdomainprops_inner.html"></iframe>
15 <pre id="test">
16 <script class="testbody" type="text/javascript">
17
18 SimpleTest.waitForExplicitFinish();
19
20 function runTest() {
21 ok(frames.frame1.myVar == 10, "access same domain inner window variable");
22 var otherDomainVar = null;
23 try {
24 otherDomainVar = frames.frame2.myVar;
25 }
26 catch (e) {
27 otherDomainVar = -1;
28 }
29 is(otherDomainVar, -1, "access other domain inner window variable");
30 SimpleTest.finish();
31 }
32
33 </script>
34 </pre>
35 </body>
36 </html>

mercurial