js/xpconnect/tests/mochitest/test_bug829872.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:a43d3ee7aadb
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=829872
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 829872</title>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="application/javascript">
12
13 /** Test for Bug 829872 and Bug 968003 **/
14 SimpleTest.waitForExplicitFinish();
15
16 var gLoadCount = 0;
17 function loaded() {
18 if (++gLoadCount == 3)
19 go();
20 }
21
22 function check(elem, desc) {
23 is(elem.contentDocument, null, "null cross-origin contentDocument for " + desc);
24 ok(SpecialPowers.wrap(elem).contentWindow.eval('frameElement === null;'),
25 "null cross-origin frameElement for " + desc);
26 if (!(elem instanceof HTMLFrameElement))
27 is(elem.getSVGDocument(), null, "null cross-origin getSVGDocument() for " + desc);
28 }
29
30 function go() {
31 ok(true, "Starting test");
32 check($('ifr'), "iframe element");
33 check($('obj'), "object element");
34 check($('framesetholder').contentDocument.getElementById('fr'), "frameset frame");
35 SimpleTest.finish();
36 }
37
38 </script>
39 </head>
40 <body>
41 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=829872">Mozilla Bug 829872</a>
42 <p id="display"></p>
43 <div id="content" style="display: none">
44
45 </div>
46 <pre id="test">
47 </pre>
48 <iframe id="ifr" onload="loaded();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe>
49 <object id="obj" onload="loaded();" data="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></object>
50 <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>
51 </body>
52 </html>

mercurial