The test is:
~~~
<html>
<head>
<title>JavaScript Redirect</title>
<script>
if (window.testRunner) {
testRunner.clearBackForwardList();
testRunner.waitUntilDone();
}
</script>
</head>
<body>
<p>This page is a JavaScript redirect on a 0 second delay.</p>
<form id="form" action="resources/redirect-target.html#1"></form>
<script>
setTimeout(function () { document.getElementById("form").submit(); }, 0);
</script>
</body>
</html>
~~~
The current test expectation is:
~~~
This page is the target of a redirect.
FAIL: History item count should be 1 but instead is 2.
============== Back Forward List ==============
http://127.0.0.1:8000/history/redirect-js-form-submit-0-seconds.html
curr-> http://127.0.0.1:8000/history/resources/redirect-target.html?#1
===============================================
~~~
So this test is currently expected to display "FAIL".
I don't quite understand what guarantees |must_replace_current_item| to be false or true here. For me both may happen.
I think it depends only on the load event. Non-user navigation before the page has finished firing onload should not create a new back/forward history item. See NavigationScheduler::MustReplaceCurrentItem
+CC japhet@. Do you think this test make sense? I would like to replace it by two tests:
1) Navigation before the onload event => no new entry created.
2) Navigation after the onload event => new entry appended.
Note: I am interested on working on this test because I have a CL where setTimeout(..., 0) and the onload event handler are not executed in the same order. It gives my a different test output.
Comment 1 by arthurso...@chromium.org
, Jul 12