dom/tests/mochitest/sessionstorage/frameEqual.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 <html xmlns="http://www.w3.org/1999/xhtml">
     2 <head>
     3 <title>slave for sessionStorage test</title>
     5 <script type="text/javascript" src="interOriginSlave.js"></script>
     6 <script type="text/javascript">
     8 var currentStep = 2;
    10 function doStep()
    11 {
    12   switch (currentStep)
    13   {
    14     case 2:
    15       is(sessionStorage.getItem("A"), "1", "A is 1 in the slave");
    16       is(sessionStorage.getItem("B"), "2", "B is 2 in the slave");
    17       is(sessionStorage.length, 2, "Num of items is 2");
    19       sessionStorage.setItem("C", "3");
    20       is(sessionStorage.getItem("C"), "3", "C is 3 in the slave");
    21       is(sessionStorage.length, 3, "Num of items is 3");
    22       break;
    24     case 4:
    25       is(sessionStorage.getItem("A"), "1", "A is 1 in the slave");
    26       is(sessionStorage.getItem("B"), "2", "B is 2 in the slave");
    27       is(sessionStorage.getItem("C"), "3", "C is 3 in the slave");
    28       is(sessionStorage.length, 3, "Num of items is 3");
    29       break;
    31     case 6:
    32       return finishTest();
    33   }
    35   ++currentStep;
    36   ++currentStep;
    38   return true;
    39 }
    41 </script>
    43 </head>
    45 <body onload="postMsg('frame loaded');">
    46 </body>
    47 </html>

mercurial