dom/bindings/test/test_queryInterface.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
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=827546
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 827546</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   <script type="application/javascript">
    13   /** Test for Bug 827546 **/
    15   var notEditable = document.createElement("div");
    16   var thrown;
    17   try {
    18     thrown = false;
    19     SpecialPowers.do_QueryInterface(notEditable, "nsIDOMNSEditableElement");
    20   } catch (e) {
    21     thrown = true;
    22   }
    23   ok(thrown,
    24      "QI to nsIDOMNSEditableElement on a non-editable element should fail");
    26   var editable = document.createElement("input");
    27   ok(SpecialPowers.do_QueryInterface(editable, "nsIDOMNSEditableElement"),
    28      "Editable element needs to support QI to nsIDOMNSEditableElement");
    30   </script>
    31 </head>
    32 <body>
    33 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=827546">Mozilla Bug 827546</a>
    34 <p id="display"></p>
    35 <div id="content" style="display: none">
    37 </div>
    38 <pre id="test">
    39 </pre>
    40 </body>
    41 </html>

mercurial