docshell/test/test_bug797909.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=797909
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 797909</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 </head>
    12 <body onload="runTest()">
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=797909">Mozilla Bug 797909</a>
    14 <p id="display"></p>
    15 <div id="content" style="display: none">
    17 </div>
    18 <pre id="test">
    19 <script type="application/javascript">
    20   /** Test for Bug 797909 **/
    22   SimpleTest.waitForExplicitFinish();
    24   function runTest() {
    25     iframe = document.getElementById("ifr");
    26     try {
    27       var iframeDoc = iframe.contentWindow.document;
    28       ok(false, "Should have thrown an exception");
    29     } catch (ex) {
    30       ok(true, "Got an exception");
    31     }
    33     iframe = document.createElement("iframe");
    34     // set sandbox attribute
    35     iframe.sandbox = "allow-scripts";
    36     // and then insert into the doc
    37     document.body.appendChild(iframe);
    39     try {
    40       var iframeDoc = iframe.contentWindow.document;
    41       ok(false, "Should have thrown an exception");
    42     } catch (ex) {
    43       ok(true, "Got an exception");
    44     }
    46     iframe = document.createElement("iframe");
    47     // set sandbox attribute
    48     iframe.sandbox = "allow-same-origin";
    49     // and then insert into the doc
    50     document.body.appendChild(iframe);
    52     try {
    53       var iframeDoc = iframe.contentWindow.document;
    54       ok(true, "Shouldn't have thrown an exception");
    55     } catch (ex) {
    56       ok(false, "Got an unexpected exception");
    57     }
    59     SimpleTest.finish();
    60   }
    62 </script>
    63 </pre>
    64 <iframe id="ifr" sandbox = "allow-scripts"></iframe>
    65 </body>
    66 </html>

mercurial