dom/tests/mochitest/sessionstorage/test_sessionStorageFromChrome.xhtml

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 <html xmlns="http://www.w3.org/1999/xhtml">
     2 <head>
     3 <title>sessionStorage basic test</title>
     5 <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     6 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     8 <script type="text/javascript">
    10 function startTest()
    11 {
    12   // Check that we do not crash when we access the sessionStorage object from
    13   // chrome and that we throw.  See bug 404453.
    14   var exceptionCaught = false;
    15   try {
    16     sessionStorage;
    17   }
    18   catch (e) {
    19     is(e.result, Components.results.NS_ERROR_NOT_AVAILABLE,
    20        "Testing that we get the expected exception.");
    21     exceptionCaught = true;
    22   }
    23   is(exceptionCaught, true, "Testing that an exception was thrown.");
    25   SimpleTest.finish();
    26 }
    28 </script>
    30 </head>
    32 <body onload="startTest();">
    33 </body>
    34 </html>

mercurial