Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / mochitest / test_bug396851.html
blobdc6bd25d520c1ac350d789c6bc70bbc362d15eb8
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=396851
5 -->
6 <head>
7 <title>Test for Bug 396851</title>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="text/javascript">
12 function throws(func, pattern, msg) {
13 try {
14 func();
15 ok(false, msg);
16 } catch (e) {
17 ok(pattern.test(e), `${msg}: Expect exception mathing ${pattern}`);
21 function go() {
22 var iframe = $("ifr");
23 var win = iframe.contentWindow;
24 throws(() => win.document,
25 /Permission denied/,
26 "Unprivileged code should not be able to access cross-origin document");
28 if (SpecialPowers.useRemoteSubframes) {
29 throws(() => win.document,
30 /Permission denied/,
31 "Privileged code should not be able to access cross-process document");
32 } else {
33 ok(SpecialPowers.wrap(win).document != null,
34 "Able to access the cross-origin document");
36 SimpleTest.finish();
38 </script>
39 </head>
40 <body>
41 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=396851">Mozilla Bug 396851</a>
42 <p id="display"></p>
43 <div id="content" style="display: none">
44 </div>
45 <script type="text/javascript">
46 SimpleTest.waitForExplicitFinish();
47 </script>
48 <iframe id="ifr"
49 src="http://example.org/tests/js/xpconnect/tests/mochitest/inner.html"
50 onload="go()">
51 </iframe>
52 </body>
53 </html>