Commit 8ca79b5d authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

BFcache: Update 3 tests under history/ to work with BFCache

On backward/forward navigations, BFCache does not load the destination
page again and onload event is not triggered.
Instead, onpageshow event is triggered on the first load and b/f
navigation.

This CL updates 3 tests under history/ to replace onload to onpageshow
to work with BFCache.

Bug: 1132180
Change-Id: I9146aecc4a020efe72dd8de24a1d33576395ab96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517188Reviewed-by: default avatarFergal Daly <fergal@chromium.org>
Reviewed-by: default avatarRakina Zata Amni <rakina@chromium.org>
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824766}
parent efc52d3e
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<script> <script>
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).'); 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).');
onload = function() onpageshow = function()
{ {
if (window.localStorage.started) { if (window.localStorage.started) {
delete window.localStorage.started; delete window.localStorage.started;
......
...@@ -19,7 +19,7 @@ function test() ...@@ -19,7 +19,7 @@ function test()
} }
</script> </script>
</head> </head>
<body onload="test()"> <body onpageshow="test()">
<form id="testForm" action="resources/replacestate-forward-back.php" method="POST"> <form id="testForm" action="resources/replacestate-forward-back.php" method="POST">
</form> </form>
</body> </body>
......
<script> <script>
window.onload = function() { window.onpageshow = function() {
setTimeout("window.top.test()", 0); setTimeout("window.top.test()", 0);
} }
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment