1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/localstorage/frameMasterEqual.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,56 @@ 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 = 1; 1.12 + 1.13 +function doStep() 1.14 +{ 1.15 + switch (currentStep) 1.16 + { 1.17 + case 1: 1.18 + localStorage.setItem("X", "1"); 1.19 + is(localStorage.getItem("X"), "1", "X is 1 in the master"); 1.20 + break; 1.21 + 1.22 + case 3: 1.23 + is(localStorage.getItem("X"), "2", "X set to 2 in the master"); 1.24 + localStorage.removeItem("X"); 1.25 + is(localStorage.getItem("X"), null, "X was removed from the master"); 1.26 + break; 1.27 + 1.28 + case 5: 1.29 + is(localStorage.getItem("Y"), "3", "Y is 3 in the master"); 1.30 + localStorage.setItem("Z", "4"); 1.31 + is(localStorage.getItem("Z"), "4", "Z is 4 in the master"); 1.32 + 1.33 + localStorage.clear(); 1.34 + is(localStorage.length, 0, "Master is empty"); 1.35 + break; 1.36 + 1.37 + case 7: 1.38 + is(localStorage.length, 0, "Master is empty"); 1.39 + break; 1.40 + 1.41 + case 9: 1.42 + return finishTest(); 1.43 + } 1.44 + 1.45 + // Increase by two to distinguish each test step order 1.46 + // in both master doStep and slave doStep functions. 1.47 + ++currentStep; 1.48 + ++currentStep; 1.49 + 1.50 + return true; 1.51 +} 1.52 + 1.53 +</script> 1.54 + 1.55 +</head> 1.56 + 1.57 +<body onload="postMsg('frame loaded');"> 1.58 +</body> 1.59 +</html>