1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/bugs/test_bug622361.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 +<head> 1.7 +<script type="text/javascript" src="/MochiKit/MochiKit.js"></script> 1.8 +<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.9 +<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.10 +<script> 1.11 +var w; 1.12 +var counter = 0; 1.13 + 1.14 +function doNext() 1.15 +{ 1.16 + counter++; 1.17 + postMessage("ohai", "*"); 1.18 +} 1.19 + 1.20 +function boom(event) 1.21 +{ 1.22 + switch (counter) 1.23 + { 1.24 + case 1: 1.25 + w = window.open("data:text/html,1"); 1.26 + doNext(); 1.27 + return; 1.28 + case 2: 1.29 + w.location = "data:text/html,2"; 1.30 + function next() 1.31 + { 1.32 + w.history.back(); 1.33 + doNext(); 1.34 + } 1.35 + setTimeout(next, 5000); 1.36 + return; 1.37 + case 3: 1.38 + localStorage.setItem("key", "value"); 1.39 + w.history.forward(); 1.40 + doNext(); 1.41 + return; 1.42 + case 4: 1.43 + w.close(); 1.44 + ok(true, "Test complete"); 1.45 + SimpleTest.finish(); 1.46 + } 1.47 +} 1.48 + 1.49 +window.addEventListener("message", boom, false); 1.50 +SimpleTest.waitForExplicitFinish(); 1.51 + 1.52 +</script> 1.53 +</head> 1.54 +<body onload="doNext();"></body> 1.55 +</html>