Chromium Code Reviews| Index: content/browser/web_contents/navigation_controller_impl_unittest.cc |
| diff --git a/content/browser/web_contents/navigation_controller_impl_unittest.cc b/content/browser/web_contents/navigation_controller_impl_unittest.cc |
| index b0b09a544e0d0def241b14566f98b45cf20755cb..c7a2181ced958c5740e36affd508ed4402fdd219 100644 |
| --- a/content/browser/web_contents/navigation_controller_impl_unittest.cc |
| +++ b/content/browser/web_contents/navigation_controller_impl_unittest.cc |
| @@ -490,68 +490,6 @@ TEST_F(NavigationControllerTest, LoadURL_AbortCancelsPending) { |
| contents()->SetDelegate(NULL); |
| } |
| -// Tests that the pending entry state is correct after a redirect and abort. |
| -// http://crbug.com/83031. |
|
Charlie Reis
2012/05/17 23:42:55
This is a regression test for a security bug. It'
cbentzel
2012/05/18 00:23:57
Sorry about LGTM'ing with this change.
|
| -TEST_F(NavigationControllerTest, LoadURL_RedirectAbortCancelsPending) { |
| - NavigationControllerImpl& controller = controller_impl(); |
| - TestNotificationTracker notifications; |
| - RegisterForAllNavNotifications(¬ifications, &controller); |
| - |
| - // Set a WebContentsDelegate to listen for state changes. |
| - scoped_ptr<TestWebContentsDelegate> delegate(new TestWebContentsDelegate()); |
| - EXPECT_FALSE(contents()->GetDelegate()); |
| - contents()->SetDelegate(delegate.get()); |
| - |
| - // Without any navigations, the renderer starts at about:blank. |
| - const GURL kExistingURL("about:blank"); |
| - |
| - // Now make a pending new navigation. |
| - const GURL kNewURL("http://eh"); |
| - controller.LoadURL( |
| - kNewURL, content::Referrer(), content::PAGE_TRANSITION_TYPED, |
| - std::string()); |
| - EXPECT_EQ(0U, notifications.size()); |
| - EXPECT_EQ(-1, controller.GetPendingEntryIndex()); |
| - EXPECT_TRUE(controller.GetPendingEntry()); |
| - EXPECT_EQ(-1, controller.GetLastCommittedEntryIndex()); |
| - EXPECT_EQ(1, delegate->navigation_state_change_count()); |
| - |
| - // Now the navigation redirects. |
| - const GURL kRedirectURL("http://bee"); |
| - test_rvh()->OnMessageReceived( |
| - ViewHostMsg_DidRedirectProvisionalLoad(0, // routing_id |
| - -1, // pending page_id |
| - GURL(), // opener |
| - kNewURL, // old url |
| - kRedirectURL)); // new url |
| - |
| - // We don't want to change the NavigationEntry's url, in case it cancels. |
| - // Prevents regression of http://crbug.com/77786. |
| - EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); |
| - |
| - // It may abort before committing, if it's a download or due to a stop or |
| - // a new navigation from the user. |
| - ViewHostMsg_DidFailProvisionalLoadWithError_Params params; |
| - params.frame_id = 1; |
| - params.is_main_frame = true; |
| - params.error_code = net::ERR_ABORTED; |
| - params.error_description = string16(); |
| - params.url = kRedirectURL; |
| - params.showing_repost_interstitial = false; |
| - test_rvh()->OnMessageReceived( |
| - ViewHostMsg_DidFailProvisionalLoadWithError(0, // routing_id |
| - params)); |
| - |
| - // This should clear the pending entry and notify of a navigation state |
| - // change, so that we do not keep displaying kNewURL. |
| - EXPECT_EQ(-1, controller.GetPendingEntryIndex()); |
| - EXPECT_FALSE(controller.GetPendingEntry()); |
| - EXPECT_EQ(-1, controller.GetLastCommittedEntryIndex()); |
| - EXPECT_EQ(2, delegate->navigation_state_change_count()); |
| - |
| - contents()->SetDelegate(NULL); |
| -} |
| - |
| TEST_F(NavigationControllerTest, Reload) { |
| NavigationControllerImpl& controller = controller_impl(); |
| TestNotificationTracker notifications; |