Commit d74c8dbc authored by Mohamed Abdelhalim's avatar Mohamed Abdelhalim Committed by Commit Bot

bfcache: Update test. Clear in-page memory cache correctly.

To clear the in-memory cache, the test was relying on a cross-process
navigation. This is not enough, because the old page can be kept in the
back-forward cache.

This patch disables the back-forward cache for the old page.

Bug: 999849
Change-Id: I7f2587d0bc25a349c74c8a68599e74db4eb8e318
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863296
Commit-Queue: Mohamed Abdelhalim <zetamoo@chromium.org>
Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706466}
parent 8c7f3a70
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "content/browser/web_contents/web_contents_view.h" #include "content/browser/web_contents/web_contents_view.h"
#include "content/common/frame_messages.h" #include "content/common/frame_messages.h"
#include "content/common/unfreezable_frame_messages.h" #include "content/common/unfreezable_frame_messages.h"
#include "content/public/browser/back_forward_cache.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/file_select_listener.h" #include "content/public/browser/file_select_listener.h"
#include "content/public/browser/invalidate_type.h" #include "content/public/browser/invalidate_type.h"
...@@ -1052,11 +1053,13 @@ class WebContentsSplitCacheBrowserTest : public WebContentsImplBrowserTest { ...@@ -1052,11 +1053,13 @@ class WebContentsSplitCacheBrowserTest : public WebContentsImplBrowserTest {
const GURL& worker) { const GURL& worker) {
DCHECK(url.is_valid()); DCHECK(url.is_valid());
// Do a cross-process navigation to clear the in-memory cache. // Clear the in-memory cache held by the current process:
// We assume that we don't start this call from "chrome://gpu", as // 1) Prevent the old page from entering the back-forward cache. Otherwise
// otherwise it won't be a cross-process navigation. We are relying // the old process will be kept alive, because it is still being used.
// on this navigation to discard the old process. // 2) Navigate to a WebUI URL, which uses a new process.
EXPECT_TRUE(NavigateToURL(shell(), GetWebUIURL("gpu"))); BackForwardCache::DisableForRenderFrameHost(
shell()->web_contents()->GetMainFrame(), "test");
EXPECT_TRUE(NavigateToURL(shell(), GetWebUIURL(kChromeUIGpuHost)));
// Observe network requests. // Observe network requests.
ResourceLoadObserver observer(shell()); ResourceLoadObserver observer(shell());
......
...@@ -55,11 +55,6 @@ ...@@ -55,11 +55,6 @@
# happen when the BackForwardCache is used to store the old document. # happen when the BackForwardCache is used to store the old document.
-RenderFrameHostManagerTest.RenderViewInitAfterNewProxyAndProcessKill -RenderFrameHostManagerTest.RenderViewInitAfterNewProxyAndProcessKill
# FATAL:casting.h Security DCHECK failed: IsA<Derived>(from).
# In content::RenderFrameProxy::OnSetFrameOwnerProperties()
# https://crbug.com/999849
-WebContentsSplitCacheWithFrameOriginBrowserTest.SplitCache*
# Histogram "PrefetchedSignedExchangeCache.Count" is recorded when the document # Histogram "PrefetchedSignedExchangeCache.Count" is recorded when the document
# in the RenderFrameHost is replaced, or when the RenderFrameHost is deleted. # in the RenderFrameHost is replaced, or when the RenderFrameHost is deleted.
# With the BackForwardCache, the RenderFrameHost is not deleted, so the # With the BackForwardCache, the RenderFrameHost is not deleted, so the
......
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