Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / history / back-during-onload-triggered-by-back.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <script src="../../js-test-resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9
10 <script>
11 description('Tests that an onload handler that runs history.back() that\'s triggered by a history.back() doesn\'t crash the browser (see http://crbug.com/59554 for more details).');
12
13 onload = function()
14 {
15   if (window.localStorage.started) {
16       delete window.localStorage.started;
17       finishJSTest();
18   } else {
19       // To make sure that we hit this branch, log this to the console so that 
20       // it shows up in expected output (debug() will be blown away once we
21       // navigate out).
22       console.log('Starting test.');
23       window.localStorage.started = true;
24       // Navigate in a timeout to make sure we create a history entry.
25       setTimeout(function() {
26         window.location.href = 'resources/back-during-onload-container.html';
27       }, 0);
28  }
29 };
30
31 var jsTestIsAsync = true;
32 </script> 
33
34 </body>
35 </html>