dom/tests/mochitest/localstorage/frameSlaveEqual.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/localstorage/frameSlaveEqual.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.5 +<head>
     1.6 +<title>frame for localStorage test</title>
     1.7 +
     1.8 +<script type="text/javascript" src="interOriginFrame.js"></script>
     1.9 +<script type="text/javascript">
    1.10 +
    1.11 +var currentStep = 2;
    1.12 +
    1.13 +function doStep()
    1.14 +{
    1.15 +  switch (currentStep)
    1.16 +  {
    1.17 +    case 2:
    1.18 +      is(localStorage.getItem("X"), "1", "X is 1 in the slave");
    1.19 +      localStorage.setItem("X", "2");
    1.20 +      is(localStorage.getItem("X"), "2", "X set to 2 in the slave");
    1.21 +      break;
    1.22 +
    1.23 +    case 4:
    1.24 +      is(localStorage.getItem("X"), null, "X was removed from the slave");
    1.25 +      localStorage.setItem("Y", "3");
    1.26 +      is(localStorage.getItem("Y"), "3", "Y set to 3 in the slave");
    1.27 +      break;
    1.28 +
    1.29 +    case 6:
    1.30 +      is(localStorage.length, 0, "Slave is empty");
    1.31 +      is(localStorage.getItem("X"), null, "X is null in the slave");
    1.32 +      is(localStorage.getItem("Y"), null, "Y is null in the slave");
    1.33 +      is(localStorage.getItem("Z"), null, "Z is null in the slave");
    1.34 +      break;
    1.35 +
    1.36 +    case 8:
    1.37 +      return finishTest();
    1.38 +  }
    1.39 +
    1.40 +  // Increase by two to distinguish each test step order
    1.41 +  // in both master doStep and slave doStep functions.
    1.42 +  ++currentStep;
    1.43 +  ++currentStep;
    1.44 +
    1.45 +  return true;
    1.46 +}
    1.47 +
    1.48 +</script>
    1.49 +
    1.50 +</head>
    1.51 +
    1.52 +<body onload="postMsg('frame loaded');">
    1.53 +</body>
    1.54 +</html>

mercurial