dom/tests/mochitest/general/test_frameElementWrapping.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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