7e586cb5e4a6d2a49c8f5461f520cf1b959c1f3f
[WebKit.git] / LayoutTests / plugins / plugin-document-back-forward.html
1 <html>
2 <script>
3 if (window.layoutTestController) {
4     layoutTestController.waitUntilDone();
5     layoutTestController.dumpAsText();
6     layoutTestController.dumpChildFramesAsText();
7 }
8
9 state = "initial";
10
11 function next() {
12     switch (state) {
13     case "initial":
14         state = "loading-plugin";
15         var frame = document.getElementsByTagName("iframe")[0]
16         frame.addEventListener("load", next, false);
17         frame.src = "data:application/x-webkit-test-netscape,alertwhenloaded";
18         break;
19     case "loading-plugin":
20         state = "moving-backward";
21         history.back();
22         break;
23     case "moving-backward":
24         state = "moving-forward";
25         history.forward();
26         break;
27     case "moving-forward":
28         state = "done";
29         layoutTestController.notifyDone();
30         break;
31     default:
32         alert('FAIL');
33         break;
34     }
35 }
36
37 window.onload = function() {
38     // We need to wait for after the load event so that we get a new history
39     // entry when navigating the frame.
40     setTimeout(next, 0);
41 }
42 </script>
43 <iframe src="data:text/html,Waiting..."></iframe>
44 </html>