Commit 18c6a9a6 authored by Arthur Hemery's avatar Arthur Hemery Committed by Commit Bot

[bfcache] Fixing some tests expectation with bfcache

Modified some content_unittest expectations to work with
BackForwardCache enabled.

Change-Id: Ia754e152a557a13acc25182791626d45e2e7913f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880044Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710737}
parent 7a15a747
......@@ -532,6 +532,12 @@ TEST_F(WebContentsImplTest, NavigateToInvalidURL) {
// Test that navigating across a site boundary creates a new RenderViewHost
// with a new SiteInstance. Going back should do the same.
TEST_F(WebContentsImplTest, CrossSiteBoundaries) {
// This test assumes no interaction with the back forward cache.
// Similar coverage when BFCache is on can be found in
// BackForwardCacheBrowserTest.NavigateBackForwardRepeatedly.
contents()->GetController().GetBackForwardCache().DisableForTesting(
BackForwardCache::TEST_ASSUMES_NO_CACHING);
TestRenderFrameHost* orig_rfh = main_test_rfh();
int orig_rvh_delete_count = 0;
orig_rfh->GetRenderViewHost()->set_delete_counter(&orig_rvh_delete_count);
......@@ -762,7 +768,6 @@ TEST_F(WebContentsImplTest, NavigateFromSitelessUrl) {
// non-zero so that orig_rfh doesn't get deleted when it gets
// swapped out.
orig_rfh->GetSiteInstance()->IncrementActiveFrameCount();
SiteInstanceImpl* orig_site_instance = orig_rfh->GetSiteInstance();
EXPECT_EQ(orig_instance, contents()->GetSiteInstance());
if (AreDefaultSiteInstancesEnabled()) {
......@@ -798,10 +803,6 @@ TEST_F(WebContentsImplTest, NavigateFromSitelessUrl) {
EXPECT_EQ(url2, contents()->GetVisibleURL());
EXPECT_NE(new_instance, orig_instance);
EXPECT_FALSE(contents()->GetPendingMainFrame());
// We keep a proxy for the original RFH's SiteInstance.
EXPECT_TRUE(contents()->GetRenderManagerForTesting()->GetRenderFrameProxyHost(
orig_site_instance));
EXPECT_EQ(orig_rvh_delete_count, 0);
// Close contents and ensure RVHs are deleted.
......
......@@ -18,8 +18,3 @@
# NavigationSimulator.CommitErrorPage() is not supported.
-RenderProcessHostUnitTest.DoNotReuseError
# Test expect a proxy for the old RFH's SiteInstance after a normal navigation
# to exist.
-WebContentsImplTest.CrossSiteBoundaries
-WebContentsImplTest.NavigateFromSitelessUrl
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