image/test/mochitest/test_bug614392.html

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=614392
     5 -->
     6 <head>
     7   <title>Test for Bug 614392</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=614392">Mozilla Bug 614392</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    15   <img src="damon.jpg">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    19 /** Test for Bug 614392**/
    21 SimpleTest.waitForExplicitFinish();
    23 window.onload = function() {
    24   var img = SpecialPowers.wrap(document.getElementsByTagName("img")[0]);
    25   var container = img
    26       .QueryInterface(SpecialPowers.Ci.nsIImageLoadingContent)
    27       .getRequest(SpecialPowers.Ci.nsIImageLoadingContent.CURRENT_REQUEST)
    28       .image;
    30   container.animationMode =
    31       SpecialPowers.Ci.imgIContainer.kDontAnimMode;
    33   is(container.animationMode,
    34      SpecialPowers.Ci.imgIContainer.kDontAnimMode,
    35      "yay, our animationMode tweak took effect (and we didn't crash!)");
    37   SimpleTest.finish();
    38 }
    40 </script>
    41 </pre>
    42 </body>
    43 </html>

mercurial