dom/tests/mochitest/general/test_frameElementWrapping.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/general/test_frameElementWrapping.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Test for same-origin and cross-origin wrapping of frameElement</title>
     1.8 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.10 +</head>
    1.11 +<body>
    1.12 +<p id="display"></p>
    1.13 +<div id="content" style="display: none">
    1.14 + 
    1.15 +</div>
    1.16 +<iframe id="ifr" src="file_frameElementWrapping.html"></iframe>
    1.17 +<pre id="test">
    1.18 +<script class="testbody" type="text/javascript">
    1.19 +
    1.20 +//
    1.21 +// This test has sort of morphed over time to become less and less useful.
    1.22 +// In the past, we had special security policy for frameElement, but that's
    1.23 +// more or less gone away with compartment/proxy wrapping. So we just go
    1.24 +// through the motions to make sure that, indeed, frameElement is subject
    1.25 +// to the same-origin policy.
    1.26 +//
    1.27 +
    1.28 +SimpleTest.waitForExplicitFinish();
    1.29 +
    1.30 +var count = 0;
    1.31 +
    1.32 +function runTest(result, message) {
    1.33 +    ok(result === 'PASS', message);
    1.34 +
    1.35 +    if (++count === 2)
    1.36 +        SimpleTest.finish();
    1.37 +    else
    1.38 +        $('ifr').contentWindow.location = 'http://example.org/tests/dom/tests/mochitest/general/file_frameElementWrapping.html';
    1.39 +}
    1.40 +
    1.41 +window.addEventListener("message",
    1.42 +                        function(event) { runTest.apply(null, event.data.split(',')) },
    1.43 +                        false);
    1.44 +
    1.45 +</script>
    1.46 +</pre>
    1.47 +</body>
    1.48 +</html>

mercurial