Commit 16fae7ca authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

Make DomSerializerTests not commit unexpected navigations.

The DomSerializerTest are executing browser-side and renderer-side code
in the same process. This was written 10 years ago. The renderer is no
more expected to load new documents without requesting navigations from
the browser process.

This patch updates the DomSerializerTest.
Now the browser process is free to kill more renderer when they try to
commit unexpected navigation.

This patch looks big, but it isn't. This patch consists of:

1. Update LoadContent to use regular navigations. It is now called from
   the browser process instead of the renderer.
2. For every test:
      Replace the callback (executed by the renderer process) by a
      lambda expression. Split the lambda around every call to
      LoadContent.  It is now executed from the browser process.

3. Update GetRenderView(). The navigation can now happens in a different
   RenderView[Host], this wasn't the case previously. The value returned
   can now change.

Bug: 1133115
Change-Id: I683149fbe353cf19fe1db96cda803eab079d8f96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435350Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813648}
parent 58d51bcf
......@@ -8432,12 +8432,6 @@ bool RenderFrameHostImpl::DidCommitNavigationInternal(
// TODO(clamy): Fix this.
is_commit_allowed_to_proceed |= params->url_is_unreachable;
// 4) Special case for DOMSerializerBrowsertests which are implemented
// entirely renderer-side and unlike normal RenderView based tests load
// file URLs instead of data URLs.
// TODO(clamy): Rework the tests to remove this exception.
is_commit_allowed_to_proceed |= params->url.SchemeIsFile();
if (!is_commit_allowed_to_proceed) {
bad_message::ReceivedBadMessage(
GetProcess(),
......
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