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: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596704}
2 files changed