tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / history / back-forward-reset-after-error-handling.html
1 <html>
2     <script>
3     // Pre-conditions
4     // - Error page handling is supported on DRT.
5
6     // Navigation steps:
7     // 1- loads this page.
8     // 2- loads a non-existent page (an error page is loaded).
9     // 4- executes a back, forward and back navigations.
10
11     // Expected results:
12     // - forward-list should comprise the non-existent loaded page(2).
13
14     var isOkToContinue = "                                  "+
15     "{                                                      "+
16     "    var console = document.getElementById('console');  "+
17     "    if (console != null)                               "+
18     "        console.innerHTML = 'SUCCESS';                 "+
19     "    else                                               "+
20     "        console.innerHTML = 'FAIL';                    "+
21     "}";
22
23     if (window.layoutTestController) {
24         layoutTestController.dumpAsText();
25         layoutTestController.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
26         layoutTestController.handleErrorPages();
27         layoutTestController.dumpBackForwardList();
28     }
29
30     function onPageShow(evt)
31     {
32         if (!evt.persisted) {
33             // this is the first time the page has been loaded, then setup the
34             // to-be-tested scenario.
35             layoutTestController.queueLoad("./non-existent.html");
36             layoutTestController.queueBackNavigation(1);
37             layoutTestController.queueForwardNavigation(1);
38             layoutTestController.queueBackNavigation(1);
39             layoutTestController.queueNonLoadingScript("eval(\"" + isOkToContinue + "\")");
40         }
41     }
42
43     window.onpageshow = onPageShow;
44     </script>
45     <body>
46         <h1 id='console'/>
47     </body>
48 </html>