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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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">
    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">
    18 SimpleTest.waitForExplicitFinish();
    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 }
    33 </script>
    34 </pre>
    35 </body>
    36 </html>

mercurial