content/html/document/test/test_bug482659.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=482659
     5 -->
     6 <head>
     7   <title>Test for Bug 482659</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=482659">Mozilla Bug 482659</a>
    13 <p id="display">
    14   <iframe></iframe>
    15   <iframe src="about:blank"></iframe>
    16   <iframe></iframe>
    17   <iframe src="about:blank"></iframe>
    18 </p>
    19 <div id="content" style="display: none">
    21 </div>
    22 <pre id="test">
    23 <script type="application/javascript">
    25 /** Test for Bug 482659 **/
    26 SimpleTest.waitForExplicitFinish()
    28 function testFrame(num) {
    29   is(window.frames[num].document.baseURI, document.baseURI,
    30      "Unexpected base URI in frame " + num);
    31   is(window.frames[num].document.documentURI, "about:blank",
    32      "Unexpected document URI in frame " + num);
    33 }
    35 function appendScript(doc) {
    36   var s = doc.createElement("script");
    37   s.textContent = "document.write('executed'); document.close()";
    38   doc.body.appendChild(s);
    39 }
    41 function verifyScriptRan(num) {
    42   is(window.frames[num].document.documentElement.textContent, "executed",
    43      "write didn't happen in frame " + num);
    44 }
    46 addLoadEvent(function() {
    47 /* document.write part of test disabled due to bug 483818
    48   appendScript(window.frames[2].document);
    49   appendScript(window.frames[3].document);
    51   verifyScriptRan(2);
    52   verifyScriptRan(3);
    53 */
    54   for (var i = 0; i < 4; ++i) {
    55     testFrame(i);
    56   }
    58   SimpleTest.finish();
    59 });
    61 </script>
    62 </pre>
    63 </body>
    64 </html>

mercurial