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

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

Issue 953503002: PlzNavigate: test updates post beforeUnload IPC refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: content/browser/frame_host/navigator_impl_unittest.cc
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc
index 82a49874ec9561ca5d6d17ec8a0aeb1c70cb8cce..77503165aa5b7be7fe64220b7370bd20cb754d1b 100644
--- a/content/browser/frame_host/navigator_impl_unittest.cc
+++ b/content/browser/frame_host/navigator_impl_unittest.cc
@@ -421,21 +421,14 @@ TEST_F(NavigatorTestWithBrowserSideNavigation, RedirectCrossSite) {
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
// It then redirects to another site.
- net::RedirectInfo redirect_info;
- redirect_info.status_code = 302;
- redirect_info.new_method = "GET";
- redirect_info.new_url = kUrl2;
- redirect_info.new_first_party_for_cookies = kUrl2;
- scoped_refptr<ResourceResponse> response(new ResourceResponse);
- GetLoaderForNavigationRequest(main_request)->CallOnRequestRedirected(
- redirect_info, response);
+ GetLoaderForNavigationRequest(main_request)->SimulateServerRedirect(kUrl2);
// The redirect should have been followed.
EXPECT_EQ(1, GetLoaderForNavigationRequest(main_request)->redirect_count());
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
// Have the RenderFrameHost commit the navigation.
- response = new ResourceResponse;
+ scoped_refptr<ResourceResponse> response(new ResourceResponse);
GetLoaderForNavigationRequest(main_request)->CallOnResponseStarted(
response, MakeEmptyStream());
TestRenderFrameHost* final_speculative_rfh =
@@ -750,7 +743,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation, Reload) {
ASSERT_TRUE(main_request != NULL);
EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD,
main_request->common_params().navigation_type);
- main_test_rfh()->PrepareForCommit(kUrl);
+ main_test_rfh()->PrepareForCommit();
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
main_test_rfh()->SendNavigate(0, kUrl);
@@ -765,7 +758,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation, Reload) {
ASSERT_TRUE(main_request != NULL);
EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE,
main_request->common_params().navigation_type);
- main_test_rfh()->PrepareForCommit(kUrl);
+ main_test_rfh()->PrepareForCommit();
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
}
@@ -843,14 +836,8 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
NavigationRequest* main_request = GetNavigationRequestForFrameTreeNode(node);
ASSERT_TRUE(main_request);
const GURL kUrlRedirect("https://www.google.com/");
- net::RedirectInfo redirect_info;
- redirect_info.status_code = 302;
- redirect_info.new_method = "GET";
- redirect_info.new_url = kUrlRedirect;
- redirect_info.new_first_party_for_cookies = kUrlRedirect;
- scoped_refptr<ResourceResponse> response(new ResourceResponse);
GetLoaderForNavigationRequest(main_request)
- ->CallOnRequestRedirected(redirect_info, response);
+ ->SimulateServerRedirect(kUrlRedirect);
EXPECT_EQ(init_site_instance_id, main_test_rfh()->GetSiteInstance()->GetId());
speculative_rfh = GetSpeculativeRenderFrameHost(node);
ASSERT_TRUE(speculative_rfh);
@@ -863,7 +850,7 @@ TEST_F(NavigatorTestWithBrowserSideNavigation,
// Commit the navigation with Navigator by simulating the call to
// OnResponseStarted.
- response = new ResourceResponse;
+ scoped_refptr<ResourceResponse> response(new ResourceResponse);
GetLoaderForNavigationRequest(main_request)
->CallOnResponseStarted(response, MakeEmptyStream());
speculative_rfh = GetSpeculativeRenderFrameHost(node);

Powered by Google App Engine
This is Rietveld 408576698