layout/inspector/tests/test_bug462787.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=462787
     5 -->
     6 <head>
     7   <title>Test for Bug 462787</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=462787">Mozilla Bug 462787</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    20 /** Test for Bug 462787 **/
    22 function do_test() {
    23   const INVALID_POINTER = SpecialPowers.Cr.NS_ERROR_INVALID_POINTER;
    25   var utils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"]
    26                              .getService(SpecialPowers.Ci.inIDOMUtils);
    27   try {
    28     utils.getCSSStyleRules(null); 
    29     ok(false, "expected an exception"); 
    30   }
    31   catch(e) {
    32     e = SpecialPowers.wrap(e);
    33     is(e.result, INVALID_POINTER, "got the expected exception");
    34   }
    36   try {
    37     utils.getRuleLine(null); 
    38     ok(false, "expected an exception"); 
    39   }
    40   catch(e) {
    41     e = SpecialPowers.wrap(e);
    42     is(e.result, INVALID_POINTER, "got the expected exception");
    43   }
    45   try {
    46     utils.isIgnorableWhitespace(null);
    47     ok(false, "expected an exception");
    48   }
    49   catch(e) {
    50     e = SpecialPowers.wrap(e);
    51     is(e.result, INVALID_POINTER, "got the expected exception");
    52   }
    54   try {
    55     utils.getParentForNode(null, true); 
    56     ok(false, "expected an exception");
    57   }
    58   catch(e) {
    59     e = SpecialPowers.wrap(e);
    60     is(e.result, INVALID_POINTER, "got the expected exception");
    61   }
    63   try {
    64     utils.getBindingURLs(null); 
    65     ok(false, "expected an exception"); 
    66   }
    67   catch(e) {
    68     e = SpecialPowers.wrap(e);
    69     is(e.result, INVALID_POINTER, "got the expected exception");
    70   }
    72   try {
    73     utils.getContentState(null); 
    74     ok(false, "expected an exception"); 
    75   }
    76   catch(e) {
    77     e = SpecialPowers.wrap(e);
    78     is(e.result, INVALID_POINTER, "got the expected exception");
    79   }
    81   try {
    82     utils.setContentState(null, false); 
    83     ok(false, "expected an exception"); 
    84   }
    85   catch(e) {
    86     e = SpecialPowers.wrap(e);
    87     is(e.result, INVALID_POINTER, "got the expected exception");
    88   }
    90   SimpleTest.finish();
    91 }
    93 SimpleTest.waitForExplicitFinish();
    94 addLoadEvent(do_test);
    97 </script>
    98 </pre>
    99 </body>
   100 </html>

mercurial