dom/tests/mochitest/localstorage/frameSlaveEqual.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <html xmlns="http://www.w3.org/1999/xhtml">
     2 <head>
     3 <title>frame for localStorage test</title>
     5 <script type="text/javascript" src="interOriginFrame.js"></script>
     6 <script type="text/javascript">
     8 var currentStep = 2;
    10 function doStep()
    11 {
    12   switch (currentStep)
    13   {
    14     case 2:
    15       is(localStorage.getItem("X"), "1", "X is 1 in the slave");
    16       localStorage.setItem("X", "2");
    17       is(localStorage.getItem("X"), "2", "X set to 2 in the slave");
    18       break;
    20     case 4:
    21       is(localStorage.getItem("X"), null, "X was removed from the slave");
    22       localStorage.setItem("Y", "3");
    23       is(localStorage.getItem("Y"), "3", "Y set to 3 in the slave");
    24       break;
    26     case 6:
    27       is(localStorage.length, 0, "Slave is empty");
    28       is(localStorage.getItem("X"), null, "X is null in the slave");
    29       is(localStorage.getItem("Y"), null, "Y is null in the slave");
    30       is(localStorage.getItem("Z"), null, "Z is null in the slave");
    31       break;
    33     case 8:
    34       return finishTest();
    35   }
    37   // Increase by two to distinguish each test step order
    38   // in both master doStep and slave doStep functions.
    39   ++currentStep;
    40   ++currentStep;
    42   return true;
    43 }
    45 </script>
    47 </head>
    49 <body onload="postMsg('frame loaded');">
    50 </body>
    51 </html>

mercurial