content/base/test/test_bug421602.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=421602
     5 -->
     6 <head>
     7   <title>Test for Bug 421602</title>
     8   <script type="text/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=421602">Mozilla Bug 421602</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script class="testbody" type="text/javascript">
    20 /** Test for Bug 421602 **/
    21 SimpleTest.waitForExplicitFinish();
    23 var img1loaded = false;
    24 var img1errored = false;
    26 // Our test image
    27 function loadTestImage() {
    28   var img1 = new Image();
    29   img1.onload = function() {
    30     img1loaded = true;
    31     finishTest();
    32   }
    33   img1.onerror = function() {
    34     img1errored = true;
    35     finishTest();
    36   }
    37   img1.src = window.location.href + "?image1=true";
    38 }
    39 loadTestImage();
    41 // Probably overkill to gc() more than once, but let's be safe
    42 SpecialPowers.gc(); SpecialPowers.gc(); SpecialPowers.gc();
    44 function finishTest() {
    45   is(img1errored, true, "Image 1 should error");
    46   is(img1loaded, false, "Image 1 should not load");
    47   SimpleTest.finish();
    48 }
    49 </script>
    50 </pre>
    51 </body>
    52 </html>

mercurial