Commit 5f32e29a authored by Arthur Sonzogni's avatar Arthur Sonzogni Committed by Commit Bot

Fix 2 flaky blink layout tests.

The test http/tests/misc/adopt-iframe-src-attr-after-remove.html as
always been a bit flaky:
https://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=http%2Ftests%2Fmisc%2Fadopt-iframe-src-attr-after-remove.html&testType=webkit_layout_tests

The reason is that navigations triggered by a script before the onload
handler don't generate back/forward entries.
See third_party/blink/public/web/web_history_commit_type.h

Sometimes, this test was fast enough so that no history entry was created.
Then history.back() failed and it ended with a timeout.

This is the same for:
http/tests/misc/resource-timing-iframe-restored-from-history.html

Bug: 862580, 831155
Change-Id: I3b8243c5f43c5043de8e23acfbe561a648c0f115
Reviewed-on: https://chromium-review.googlesource.com/1133170Reviewed-by: default avatarNate Chapin <japhet@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579001}
parent 15d5f5e9
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<li>Final URL loaded.</li> <li>Final URL loaded.</li>
</ol> </ol>
<iframe a width="200" height="200" onunload="" src="resources/frame-initial-url.html"></iframe> <iframe a width="200" height="200" onunload=""></iframe>
<script> <script>
if (window.testRunner) { if (window.testRunner) {
...@@ -36,6 +36,15 @@ function runTest() ...@@ -36,6 +36,15 @@ function runTest()
sessionStorage.didNav = true; sessionStorage.didNav = true;
} }
}; };
// Wait for the onload event before starting the first navigation. Not waiting
// may cause the second history entry to replace the current one instead of
// being appended. history.back() failed for this reason.
// See https://crbug.com/862580
window.onload = function() {
document.querySelector("iframe").src = "resources/frame-initial-url.html"
}
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<script src="/js-test-resources/js-test.js"></script> <script src="/js-test-resources/js-test.js"></script>
<iframe id="frame" src="resources/frame-initial-url.html"></iframe>
<script> <script>
description('Tests that iframe restored from history does not report resource timing.'); description('Tests that iframe restored from history does not report resource timing.');
window.jsTestIsAsync = true; window.jsTestIsAsync = true;
...@@ -21,4 +20,10 @@ function runTest() { ...@@ -21,4 +20,10 @@ function runTest() {
finishJSTest(); finishJSTest();
} }
} }
window.onload = function() {
document.querySelector("iframe").src = "resources/frame-initial-url.html";
}
</script> </script>
<iframe></iframe>
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