navigate_to_204.html: Wait for window.load before navigating.

I am working on https://crbug.com/831155. Some tests that are relying
on how things are scheduled in Blink are failing.

This CL makes the following test to keep working:
 * ExecuteScriptApiTest.FrameWithHttp204

What happened with this test?

1) Javascript test is started:
   test/data/extensions/api_test/executescript/http204/background.js

2) Function navigateToFrameAndWaitUntil204Loaded is executed.
   It navigates to:
   /extensions/api_test/executescript/http204/navigate_to_204.html?b.com

3) |location.href = "[...]page204.html"| happens before the document is
   fully loaded.

4) The navigation to page204.html cancels the previous one.
   FrameMsg_DroppedNavigation IPC is sent.

5) Test fails, it expected "page204.html" load to fail, but
   "navigate_to_204.html" failed first.

Solution is to wait for the document to be fully loaded before
navigating to page204.html.

Bug: 831155
Change-Id: I8780a48877a8a6a67338aa4a1ae167952cb35fb8
Reviewed-on: https://chromium-review.googlesource.com/1065972
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560592}
1 file changed