Commit 4a63ed4e authored by Arthur Sonzogni's avatar Arthur Sonzogni Committed by Commit Bot

Fix flaky test open-with-pending-load2

There is a race in between:
 1) The end of the test.
 2) The XHR 'abort' event handlers executed.

There is a PostTask in between:
 A) blink::XMLHttpRequest::HandleDidCancel()
 B) blink::XMLHttpRequest::HandleRequestError()

FrameLoader::FinishedParsing may be interleaved in between A) and B).

Make use of testRunner.{waitUntilDone, notifyDone} to get reliable
results.

Bug: 831155
Change-Id: Ibe1ad9020319aae7268f331b2dba0911035789e2
Reviewed-on: https://chromium-review.googlesource.com/c/1261520
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596704}
parent 62691a48
This tests that calling document.open on a document that has a pending load correctly cancels the load and does not crash even if the frame is removed.
<script>
if (window.testRunner)
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
</script>
<body>
This tests that calling document.open on a document that has a pending load correctly cancels the load and does not crash even if the frame is removed.
......@@ -12,6 +14,7 @@ const client = new frame.contentWindow.XMLHttpRequest();
client.open("GET", "data:text/html,");
client.onabort = e => {
div.remove();
testRunner.notifyDone();
};
client.send();
frame.contentWindow.document.open();
......
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