dom/tests/mochitest/bugs/test_bug291377.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=291377
     5 -->
     6 <head>
     7   <title>Test for Bug 291377</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=291377">Mozilla Bug 291377</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">
    19 /** Test for Bug 291377 **/
    20 /* Do something that causes an XPConnect exception */
    21 var threw = true;
    22 try {
    23   window.location.port = -2;
    24   threw = false;
    25 } catch (e) {
    26   /* Check that we can touch various properties */
    27   isnot(e.lineNumber, undefined, "Unexpected line number"); //This line number is dependent on the implementation of the SpecialPowers API
    28   is(e.name, "NS_ERROR_MALFORMED_URI", "Unexpected exception name");
    29   isnot(e.message, "", "Should have a message");
    30   isnot(e.result, 0, "Should have a result");
    32   is(e.result, SpecialPowers.Cr.NS_ERROR_MALFORMED_URI);
    33 }
    35 is(threw, true, "Not enough arguments to a call should throw");
    36 </script>
    37 </pre>
    38 </body>
    39 </html>

mercurial