Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Unified Diff: content/browser/frame_host/render_frame_host_manager_browsertest.cc

Issue 1681973002: PlzNavigate: fix RenderFrameHostManagerTest.ConsecutiveNavigationsToSite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_manager_browsertest.cc
diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
index 1fb3bfd688359d2c70512d340044555e0f4a485e..4a37ef582d615e3534d42f68e6afe22bad02d726 100644
--- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
@@ -35,6 +35,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/bindings_policy.h"
+#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/file_chooser_file_info.h"
#include "content/public/common/file_chooser_params.h"
@@ -2450,21 +2451,34 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
shell()->web_contents());
- RenderFrameHostImpl* pending_rfh =
- web_contents->GetRenderManagerForTesting()->pending_frame_host();
- ASSERT_TRUE(pending_rfh);
+ RenderFrameHostImpl* next_rfh =
+ IsBrowserSideNavigationEnabled()
+ ? web_contents->GetRenderManagerForTesting()->speculative_frame_host()
+ : web_contents->GetRenderManagerForTesting()->pending_frame_host();
+ ASSERT_TRUE(next_rfh);
// Navigate to the same new site and verify that we commit in the same RFH.
GURL cross_site_url2(embedded_test_server()->GetURL("b.com", "/title2.html"));
TestNavigationObserver navigation_observer(web_contents, 1);
shell()->LoadURL(cross_site_url2);
- EXPECT_EQ(pending_rfh,
- web_contents->GetRenderManagerForTesting()->pending_frame_host());
+ if (IsBrowserSideNavigationEnabled()) {
+ EXPECT_EQ(
+ next_rfh,
+ web_contents->GetRenderManagerForTesting()->speculative_frame_host());
+ } else {
+ EXPECT_EQ(next_rfh,
+ web_contents->GetRenderManagerForTesting()->pending_frame_host());
+ }
navigation_observer.Wait();
EXPECT_EQ(cross_site_url2, web_contents->GetLastCommittedURL());
- EXPECT_EQ(pending_rfh, web_contents->GetMainFrame());
- EXPECT_FALSE(
- web_contents->GetRenderManagerForTesting()->pending_frame_host());
+ EXPECT_EQ(next_rfh, web_contents->GetMainFrame());
+ if (IsBrowserSideNavigationEnabled()) {
+ EXPECT_FALSE(
+ web_contents->GetRenderManagerForTesting()->speculative_frame_host());
+ } else {
+ EXPECT_FALSE(
+ web_contents->GetRenderManagerForTesting()->pending_frame_host());
+ }
ResourceDispatcherHost::Get()->SetDelegate(nullptr);
}
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698