Commit b141188d authored by Rakina Zata Amni's avatar Rakina Zata Amni Committed by Commit Bot

Update components/ tests to handle same-site BrowsingInstance swap

With crrev.com/c/2121522, some main-frame same-site navigations will
result in a new BrowsingInstance, SiteInstance, RenderFrameHost,
RenderView, etc. This CL updates expectations of tests under chrome/
and components/ that didn't expect a change of RenderFrameHosts etc.
on same-site navigations.

This CL does not include fixes to other tests in content/, chrome/,
and layout tests (they are fixed in other CLs).

For more details, see doc: https://docs.google.com/document/d/1lHdkKLUe8H6ZP6ALwj-dsus7oYcuc93HkSCHCcerItg/edit?usp=sharing

Bug: 977562
Change-Id: Ibb9c7e9da1a8d743c57a0a16c36a67e1464cf1c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210605
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775033}
parent a996d3a0
...@@ -298,9 +298,19 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) { ...@@ -298,9 +298,19 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) {
cross_process_navigation->CommitErrorPage(); cross_process_navigation->CommitErrorPage();
} }
// Similar to the above test, except the original RenderViewHost manages to // Similar to the above test, except the original RenderFrameHost manages to
// commit before its navigation is aborted. // commit before its navigation is aborted.
TEST_F(CaptivePortalTabHelperTest, UnexpectedCommit) { TEST_F(CaptivePortalTabHelperTest, UnexpectedCommit) {
if (content::CanSameSiteMainFrameNavigationsChangeRenderFrameHosts()) {
// When ProactivelySwapBrowsingInstance or RenderDocument is enabled on
// same-site main-frame navigations, the same-site navigation below will
// create a pending RenderFrameHost, which will be deleted when a cross-site
// navigation starts (because it also creates a pending RenderFrameHost).
// This means the case we wanted for this test is not possible with
// ProactivelySwapBrowsingInstance or RenderDocument, so we should just skip
// this test.
return;
}
GURL same_site_url = GURL(kHttpUrl); GURL same_site_url = GURL(kHttpUrl);
GURL cross_process_url = GURL(kHttpsUrl2); GURL cross_process_url = GURL(kHttpsUrl2);
......
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