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 8dc64af604ff82a0801d11a6f63fae9fec9c4d45..d265010d48eb50848c73d2510a3c7136ee9d891e 100644 |
--- a/content/browser/frame_host/navigator_impl_unittest.cc |
+++ b/content/browser/frame_host/navigator_impl_unittest.cc |
@@ -50,17 +50,12 @@ |
return static_cast<TestNavigationURLLoader*>(request->loader_for_testing()); |
} |
- // Requests a navigation of the specified FrameTreeNode to the specified URL; |
- // returns the unique ID of the pending NavigationEntry. |
- int RequestNavigation(FrameTreeNode* node, const GURL& url) { |
- return RequestNavigationWithParameters(node, url, Referrer(), |
- ui::PAGE_TRANSITION_LINK); |
- } |
- |
- // Requests a navigation of the specified FrameTreeNode to the specified URL, |
- // using other specified parameters; returns the unique ID of the pending |
- // NavigationEntry. |
- int RequestNavigationWithParameters( |
+ void RequestNavigation(FrameTreeNode* node, const GURL& url) { |
+ RequestNavigationWithParameters(node, url, Referrer(), |
+ ui::PAGE_TRANSITION_LINK); |
+ } |
+ |
+ void RequestNavigationWithParameters( |
FrameTreeNode* node, |
const GURL& url, |
const Referrer& referrer, |
@@ -71,7 +66,6 @@ |
load_params.transition_type = transition_type; |
controller().LoadURLWithParams(load_params); |
- return controller().GetPendingEntry()->GetUniqueID(); |
} |
TestRenderFrameHost* GetSpeculativeRenderFrameHost(FrameTreeNode* node) { |
@@ -111,7 +105,7 @@ |
// Start a browser-initiated navigation. |
int32 site_instance_id = main_test_rfh()->GetSiteInstance()->GetId(); |
FrameTreeNode* node = main_test_rfh()->frame_tree_node(); |
- int entry_id = RequestNavigation(node, kUrl); |
+ RequestNavigation(node, kUrl); |
NavigationRequest* request = node->navigation_request(); |
ASSERT_TRUE(request); |
EXPECT_EQ(kUrl, request->common_params().url); |
@@ -132,7 +126,7 @@ |
EXPECT_EQ(NavigationRequest::RESPONSE_STARTED, request->state()); |
// Commit the navigation. |
- main_test_rfh()->SendNavigate(0, entry_id, true, kUrl); |
+ main_test_rfh()->SendNavigate(0, kUrl); |
EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, main_test_rfh()->rfh_state()); |
EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl), |
main_test_rfh()->GetSiteInstance()->GetSiteURL()); |
@@ -185,7 +179,7 @@ |
EXPECT_EQ(NavigationRequest::RESPONSE_STARTED, request->state()); |
// Commit the navigation. |
- main_test_rfh()->SendNavigate(1, 0, true, kUrl2); |
+ main_test_rfh()->SendNavigate(0, kUrl2); |
EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, main_test_rfh()->rfh_state()); |
EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl2), |
main_test_rfh()->GetSiteInstance()->GetSiteURL()); |
@@ -230,7 +224,7 @@ |
EXPECT_EQ(NavigationRequest::RESPONSE_STARTED, request->state()); |
// Commit the navigation. |
- main_test_rfh()->SendNavigate(1, 0, true, kUrl2); |
+ main_test_rfh()->SendNavigate(0, kUrl2); |
EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, main_test_rfh()->rfh_state()); |
EXPECT_EQ(kUrl2, contents()->GetLastCommittedURL()); |
EXPECT_FALSE(node->navigation_request()); |
@@ -420,7 +414,7 @@ |
// Navigate to a different site. |
process()->sink().ClearMessages(); |
- int entry_id = RequestNavigation(node, kUrl2); |
+ RequestNavigation(node, kUrl2); |
NavigationRequest* main_request = node->navigation_request(); |
ASSERT_TRUE(main_request); |
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
@@ -439,7 +433,7 @@ |
EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh())); |
EXPECT_TRUE(contents()->CrossProcessNavigationPending()); |
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl2); |
+ speculative_rfh->SendNavigate(0, kUrl2); |
RenderFrameHostImpl* final_rfh = main_test_rfh(); |
EXPECT_EQ(speculative_rfh, final_rfh); |
@@ -461,7 +455,7 @@ |
// Navigate to a URL on the same site. |
process()->sink().ClearMessages(); |
- int entry_id = RequestNavigation(node, kUrl1); |
+ RequestNavigation(node, kUrl1); |
main_test_rfh()->SendBeforeUnloadACK(true); |
NavigationRequest* main_request = node->navigation_request(); |
ASSERT_TRUE(main_request); |
@@ -484,7 +478,7 @@ |
EXPECT_TRUE(DidRenderFrameHostRequestCommit(final_speculative_rfh)); |
// Commit the navigation. |
- final_speculative_rfh->SendNavigate(0, entry_id, true, kUrl2); |
+ final_speculative_rfh->SendNavigate(0, kUrl2); |
RenderFrameHostImpl* final_rfh = main_test_rfh(); |
ASSERT_TRUE(final_rfh); |
EXPECT_NE(rfh, final_rfh); |
@@ -529,7 +523,7 @@ |
// Request navigation to the 2nd URL; the NavigationRequest must have been |
// replaced by a new one with a different URL. |
- int entry_id = RequestNavigation(node, kUrl2); |
+ RequestNavigation(node, kUrl2); |
main_test_rfh()->SendBeforeUnloadACK(true); |
NavigationRequest* request2 = node->navigation_request(); |
ASSERT_TRUE(request2); |
@@ -553,7 +547,7 @@ |
EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh())); |
// Commit the navigation. |
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl2); |
+ speculative_rfh->SendNavigate(0, kUrl2); |
// Confirm that the commit corresponds to the new request. |
ASSERT_TRUE(main_test_rfh()); |
@@ -614,7 +608,7 @@ |
EXPECT_TRUE(DidRenderFrameHostRequestCommit(main_test_rfh())); |
// Commit the navigation. |
- main_test_rfh()->SendNavigate(1, 0, true, kUrl2); |
+ main_test_rfh()->SendNavigate(0, kUrl2); |
// Confirm that the commit corresponds to the new request. |
ASSERT_TRUE(main_test_rfh()); |
@@ -662,7 +656,7 @@ |
EXPECT_TRUE(DidRenderFrameHostRequestCommit(main_test_rfh())); |
// Commit the navigation. |
- main_test_rfh()->SendNavigate(1, 0, true, kUrl1); |
+ main_test_rfh()->SendNavigate(0, kUrl1); |
EXPECT_EQ(kUrl1, contents()->GetLastCommittedURL()); |
} |
@@ -680,7 +674,7 @@ |
// Start a browser-initiated navigation to the 1st URL. |
process()->sink().ClearMessages(); |
- int entry_id = RequestNavigation(node, kUrl1); |
+ RequestNavigation(node, kUrl1); |
NavigationRequest* request1 = node->navigation_request(); |
ASSERT_TRUE(request1); |
EXPECT_EQ(kUrl1, request1->common_params().url); |
@@ -710,7 +704,7 @@ |
EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh())); |
// Commit the navigation. |
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl1); |
+ speculative_rfh->SendNavigate(0, kUrl1); |
EXPECT_EQ(kUrl1, contents()->GetLastCommittedURL()); |
} |
@@ -758,7 +752,7 @@ |
EXPECT_TRUE(DidRenderFrameHostRequestCommit(main_test_rfh())); |
// Commit the navigation. |
- main_test_rfh()->SendNavigate(1, 0, true, kUrl2); |
+ main_test_rfh()->SendNavigate(0, kUrl2); |
EXPECT_EQ(kUrl2, contents()->GetLastCommittedURL()); |
// The SiteInstance did not change. |
@@ -774,7 +768,6 @@ |
FrameTreeNode* node = main_test_rfh()->frame_tree_node(); |
controller().Reload(false); |
- int entry_id = controller().GetPendingEntry()->GetUniqueID(); |
// A NavigationRequest should have been generated. |
NavigationRequest* main_request = node->navigation_request(); |
ASSERT_TRUE(main_request != NULL); |
@@ -783,7 +776,7 @@ |
main_test_rfh()->PrepareForCommit(); |
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
- main_test_rfh()->SendNavigate(0, entry_id, false, kUrl); |
+ main_test_rfh()->SendNavigate(0, kUrl); |
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
// Now do a shift+reload. |
@@ -809,7 +802,7 @@ |
// Begin navigating to another site. |
const GURL kUrl("http://google.com/"); |
process()->sink().ClearMessages(); |
- int entry_id = RequestNavigation(node, kUrl); |
+ RequestNavigation(node, kUrl); |
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
// Receive the beforeUnload ACK. |
@@ -834,7 +827,7 @@ |
EXPECT_FALSE(node->render_manager()->pending_frame_host()); |
// Invoke OnDidCommitProvisionalLoad. |
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl); |
+ speculative_rfh->SendNavigate(0, kUrl); |
EXPECT_EQ(site_instance_id, main_test_rfh()->GetSiteInstance()->GetId()); |
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
EXPECT_FALSE(node->render_manager()->pending_frame_host()); |
@@ -853,7 +846,7 @@ |
// Begin navigating to another site. |
const GURL kUrl("http://google.com/"); |
process()->sink().ClearMessages(); |
- int entry_id = RequestNavigation(node, kUrl); |
+ RequestNavigation(node, kUrl); |
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
// Receive the beforeUnload ACK. |
@@ -902,7 +895,7 @@ |
EXPECT_NE(site_instance_id, redirect_site_instance_id); |
// Invoke OnDidCommitProvisionalLoad. |
- speculative_rfh->SendNavigate(0, entry_id, true, kUrlRedirect); |
+ speculative_rfh->SendNavigate(0, kUrlRedirect); |
// Check that the speculative RenderFrameHost was swapped in. |
EXPECT_EQ(redirect_site_instance_id, |
@@ -938,7 +931,7 @@ |
// should be reused. |
process()->sink().ClearMessages(); |
rfh1->GetProcess()->sink().ClearMessages(); |
- int entry_id = RequestNavigation(node, kUrl1); |
+ RequestNavigation(node, kUrl1); |
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
main_test_rfh()->SendBeforeUnloadACK(true); |
@@ -955,7 +948,7 @@ |
EXPECT_TRUE(DidRenderFrameHostRequestCommit(rfh1)); |
EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh())); |
- rfh1->SendNavigate(1, entry_id, true, kUrl1); |
+ rfh1->SendNavigate(1, kUrl1); |
EXPECT_EQ(rfh1, main_test_rfh()); |
EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); |
EXPECT_FALSE(rfhm->IsOnSwappedOutList(rfh1)); |
@@ -971,7 +964,7 @@ |
FrameTreeNode* node = main_test_rfh()->frame_tree_node(); |
// Navigate to a data url. |
- int entry_id = RequestNavigation(node, kUrl2); |
+ RequestNavigation(node, kUrl2); |
NavigationRequest* navigation_request = node->navigation_request(); |
ASSERT_TRUE(navigation_request); |
EXPECT_EQ(NavigationRequest::WAITING_FOR_RENDERER_RESPONSE, |
@@ -985,7 +978,7 @@ |
EXPECT_FALSE(navigation_request->loader_for_testing()); |
TestRenderFrameHost* speculative_rfh = GetSpeculativeRenderFrameHost(node); |
ASSERT_TRUE(speculative_rfh); |
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl2); |
+ speculative_rfh->SendNavigate(0, kUrl2); |
EXPECT_EQ(main_test_rfh(), speculative_rfh); |
// Go back to the initial site. |