dom/tests/mochitest/general/test_frameElementWrapping.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 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">
    12 </div>
    13 <iframe id="ifr" src="file_frameElementWrapping.html"></iframe>
    14 <pre id="test">
    15 <script class="testbody" type="text/javascript">
    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 //
    25 SimpleTest.waitForExplicitFinish();
    27 var count = 0;
    29 function runTest(result, message) {
    30     ok(result === 'PASS', message);
    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 }
    38 window.addEventListener("message",
    39                         function(event) { runTest.apply(null, event.data.split(',')) },
    40                         false);
    42 </script>
    43 </pre>
    44 </body>
    45 </html>

mercurial