layout/generic/test/test_bug589623.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=589623
     5 -->
     6 <head>
     7   <title>Test for Bug 589623</title>
     8   <script src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=589623">Mozilla Bug 589623</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    15 </div>
    16 <pre id="test">
    17 <script>
    18 /** Test for Bug 589623 **/
    19 var sel = getSelection();
    20 sel.removeAllRanges();
    21 function t(m) {
    22   try {
    23     sel[m]();
    24     ok(false, "Should not be here");
    25   } catch(e) {
    26     is(e.name, "InvalidStateError", "Should be an InvalidStateError");
    27     ok(e instanceof DOMException, "Should be a DOMException");
    28     is(e.code, DOMException.INVALID_STATE_ERR, "Should be an INVALID_STATE_ERR");
    29   }
    30 }
    31 t("collapseToStart");
    32 t("collapseToEnd");
    33 </script>
    34 </pre>
    35 </body>
    36 </html>

mercurial