js/xpconnect/tests/mochitest/test_bug829872.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/xpconnect/tests/mochitest/test_bug829872.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=829872
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 829872</title>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +  <script type="application/javascript">
    1.15 +
    1.16 +  /** Test for Bug 829872 and Bug 968003 **/
    1.17 +  SimpleTest.waitForExplicitFinish();
    1.18 +
    1.19 +  var gLoadCount = 0;
    1.20 +  function loaded() {
    1.21 +    if (++gLoadCount == 3)
    1.22 +      go();
    1.23 +  }
    1.24 +
    1.25 +  function check(elem, desc) {
    1.26 +    is(elem.contentDocument, null, "null cross-origin contentDocument for " + desc);
    1.27 +    ok(SpecialPowers.wrap(elem).contentWindow.eval('frameElement === null;'),
    1.28 +       "null cross-origin frameElement for " + desc);
    1.29 +    if (!(elem instanceof HTMLFrameElement))
    1.30 +      is(elem.getSVGDocument(), null, "null cross-origin getSVGDocument() for " + desc);
    1.31 +  }
    1.32 +
    1.33 +  function go() {
    1.34 +    ok(true, "Starting test");
    1.35 +    check($('ifr'), "iframe element");
    1.36 +    check($('obj'), "object element");
    1.37 +    check($('framesetholder').contentDocument.getElementById('fr'), "frameset frame");
    1.38 +    SimpleTest.finish();
    1.39 +  }
    1.40 +
    1.41 +  </script>
    1.42 +</head>
    1.43 +<body>
    1.44 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=829872">Mozilla Bug 829872</a>
    1.45 +<p id="display"></p>
    1.46 +<div id="content" style="display: none">
    1.47 +
    1.48 +</div>
    1.49 +<pre id="test">
    1.50 +</pre>
    1.51 +<iframe id="ifr" onload="loaded();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe>
    1.52 +<object id="obj" onload="loaded();" data="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></object>
    1.53 +<iframe id="framesetholder" src="data:text/html,<html><head></head><frameset cols='100%'><frame id='fr' onload='parent.loaded();' src='http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html' /></frameset></html>"></iframe>
    1.54 +</body>
    1.55 +</html>

mercurial