|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script> |
|
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
7 <script> |
|
8 var w; |
|
9 var counter = 0; |
|
10 |
|
11 function doNext() |
|
12 { |
|
13 counter++; |
|
14 postMessage("ohai", "*"); |
|
15 } |
|
16 |
|
17 function boom(event) |
|
18 { |
|
19 switch (counter) |
|
20 { |
|
21 case 1: |
|
22 w = window.open("data:text/html,1"); |
|
23 doNext(); |
|
24 return; |
|
25 case 2: |
|
26 w.location = "data:text/html,2"; |
|
27 function next() |
|
28 { |
|
29 w.history.back(); |
|
30 doNext(); |
|
31 } |
|
32 setTimeout(next, 5000); |
|
33 return; |
|
34 case 3: |
|
35 localStorage.setItem("key", "value"); |
|
36 w.history.forward(); |
|
37 doNext(); |
|
38 return; |
|
39 case 4: |
|
40 w.close(); |
|
41 ok(true, "Test complete"); |
|
42 SimpleTest.finish(); |
|
43 } |
|
44 } |
|
45 |
|
46 window.addEventListener("message", boom, false); |
|
47 SimpleTest.waitForExplicitFinish(); |
|
48 |
|
49 </script> |
|
50 </head> |
|
51 <body onload="doNext();"></body> |
|
52 </html> |