1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/localstorage/frameSlaveNotEqual.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 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"), null, "X not set 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"), "2", "X still set to 2 in the slave"); 1.25 + localStorage.setItem("Y", "3"); 1.26 + is(localStorage.getItem("Y"), "3", "Y set to 4 (MUST FAIL!) in the slave"); 1.27 + break; 1.28 + 1.29 + case 6: 1.30 + return finishTest(); 1.31 + } 1.32 + 1.33 + // Increase by two to distinguish each test step order 1.34 + // in both master doStep and slave doStep functions. 1.35 + ++currentStep; 1.36 + ++currentStep; 1.37 + 1.38 + return true; 1.39 +} 1.40 + 1.41 +</script> 1.42 + 1.43 +</head> 1.44 + 1.45 +<body onload="postMsg('frame loaded');"> 1.46 +</body> 1.47 +</html>