tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / http / tests / history / back-with-fragment-change.php
1 <?php
2 // We intentionally want the page to load slowly (every time, hence no caching), 
3 // so that when back-with-fragment-change-target.html calls history.back(), the
4 // load is provisional for a while (long enough for the window.location = '#foo'
5 // script to run and stop that load).
6 sleep(2);
7
8 header("Cache-control: no-cache, no-store");
9 header("Pragma: no-cache");
10 ?>
11
12 <script>
13 if (window.layoutTestController) {
14     layoutTestController.dumpBackForwardList();
15     layoutTestController.dumpAsText();
16     layoutTestController.waitUntilDone();
17 }
18
19 onload = function() {
20     if (sessionStorage.didNavigate) {
21         console.log('Should not have ended up back at the test start page');
22         delete sessionStorage.didNavigate;
23         if (window.layoutTestController)
24             layoutTestController.notifyDone();
25         return;
26     }
27
28     // Change the location in a timeout to make sure it generates a history entry
29     setTimeout(function() {
30             window.location = 'resources/back-with-fragment-change-target.html'
31             sessionStorage.didNavigate = true;
32         }, 0);
33 }
34
35 // Make sure there's no page cache.
36 onunload = function() { };
37 </script>
38 <p>
39 Tests that a history navigation that is aborted by a fragment change doesn't
40 update the provisional history item. This test relies on
41 <code>layoutTestController.dumpBackForwardList</code> to verify correctness
42 and thus can only be run via DumpRenderTree.</p>