Better support for testing race conditions around navigation and loading in browser_tests |
||
Issue descriptionWhile launching PlzNavigate, we have encountered several bugs on stable that resulted from race conditions around concurrent navigations and document loads. While we had theorized that some of them could appear, we faced issues in actually testing them in browser tests. In particular, it is very hard to reproduce some interleavings of events in a non-flaky manner in browser tests. This require being able to pause navigations and loads at various point in time while we wait for other events to happen. We already have support to pause navigations at various point in time until the navigation is ready to commit thanks to the TestNavigationManager. However once the navigation is sent to the renderer, we no longer have ways to pause the load. Ideally, we should be able to: - delay a navigation commit - keep a frame in a loading state (it would be even better if we could specify at which point in the load the load needs to be paused) This would really help us in having robust testing of the various edge cases related to navigation and loading.
,
Sep 27 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/14b323009e98473053deb846c2c974e3315a45a0 commit 14b323009e98473053deb846c2c974e3315a45a0 Author: arthursonzogni <arthursonzogni@chromium.org> Date: Wed Sep 27 08:06:10 2017 Introduce ControllableHttpResponse for tests. It is an HTTP response that can be controlled on the current thread in tests. It is useful for making pauses in the middle of a response. For instance, you can send only the headers, wait in the test for an event, perform some actions and finally send the response's body. Bug: 765610 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation Change-Id: If7c8904c3d17322d64dc1186014c29cc5860be7e Reviewed-on: https://chromium-review.googlesource.com/666926 Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Matt Menke <mmenke@chromium.org> Cr-Commit-Position: refs/heads/master@{#504599} [modify] https://crrev.com/14b323009e98473053deb846c2c974e3315a45a0/content/browser/frame_host/render_frame_host_impl_browsertest.cc [add] https://crrev.com/14b323009e98473053deb846c2c974e3315a45a0/content/public/test/controllable_http_response.cc [add] https://crrev.com/14b323009e98473053deb846c2c974e3315a45a0/content/public/test/controllable_http_response.h [modify] https://crrev.com/14b323009e98473053deb846c2c974e3315a45a0/content/test/BUILD.gn [modify] https://crrev.com/14b323009e98473053deb846c2c974e3315a45a0/testing/buildbot/filters/mojo.fyi.network_content_browsertests.filter
,
May 21 2018
Bulk edit** This bug has the label Postmortem-Followup but has not been updated in 3+ weeks. We are working on a new workflow to improve postmortem followthrough. Postmortems and postmortem bugs are very important in making sure we don't repeat prior mistakes and for making Chrome better for all. We will be taking a closer look at these bugs in the coming weeks. Please take some time to work on this, reassign, or close if the issue has been fixed. Thank you.
,
May 22 2018
I am marking this bug as fixed. The net::test_server::ControllableHttpResponse introduced in comment 2 allows us to control how and when the web server sends its data. We have now a way to pause and resume the load at any moment, especially after the navigation is sent to the renderer process. Example of test related to this issue using the ControllableHttpResponse: * ContentBrowserTest.BrowserInitiatedJavascriptUrlDoNotPreventLoading * ContentBrowserTest.AbortedRendererInitiatedNavigationDoNotCancelPendingXHR * ContentBrowserTest.SameDocumentBrowserInitiatedNavigationWhileDocumentIsLoading * RenderFrameDevToolsAgentHostBrowserTest.CancelCrossOriginNavigationAfterReadyToCommit * ContentBrowserTest.HistoryBackInUnloadCancelsReload |
||
►
Sign in to add a comment |
||
Comment 1 by clamy@chromium.org
, Sep 15 2017