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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl_unittest.cc

Issue 596543002: Remove WebContentsObserver::ProvisionalChangeToMainFrameUrl and all the code supporting it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@redirprerender
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/navigator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 controller.LoadURLWithParams(load_url_params); 1030 controller.LoadURLWithParams(load_url_params);
1031 EXPECT_EQ(0U, notifications.size()); 1031 EXPECT_EQ(0U, notifications.size());
1032 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); 1032 EXPECT_EQ(-1, controller.GetPendingEntryIndex());
1033 EXPECT_TRUE(controller.GetPendingEntry()); 1033 EXPECT_TRUE(controller.GetPendingEntry());
1034 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex()); 1034 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex());
1035 EXPECT_EQ(0, delegate->navigation_state_change_count()); 1035 EXPECT_EQ(0, delegate->navigation_state_change_count());
1036 1036
1037 // The visible entry should be the last committed URL, not the pending one. 1037 // The visible entry should be the last committed URL, not the pending one.
1038 EXPECT_EQ(kExistingURL, controller.GetVisibleEntry()->GetURL()); 1038 EXPECT_EQ(kExistingURL, controller.GetVisibleEntry()->GetURL());
1039 1039
1040 // Now the navigation redirects. 1040 // Now the navigation redirects. (There is no longer a corresponding message
davidben 2014/09/22 19:27:21 Nit: Probably better to say "(There is no correspo
Avi (use Gerrit) 2014/09/22 19:54:06 Done.
1041 // here.)
1041 const GURL kRedirectURL("http://foo/see"); 1042 const GURL kRedirectURL("http://foo/see");
1042 main_test_rfh()->OnMessageReceived(
1043 FrameHostMsg_DidRedirectProvisionalLoad(0, // routing_id
1044 -1, // pending page_id
1045 kNewURL, // old url
1046 kRedirectURL)); // new url
1047 1043
1048 // We don't want to change the NavigationEntry's url, in case it cancels. 1044 // We don't want to change the NavigationEntry's url, in case it cancels.
1049 // Prevents regression of http://crbug.com/77786. 1045 // Prevents regression of http://crbug.com/77786.
1050 EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); 1046 EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL());
1051 1047
1052 // It may abort before committing, if it's a download or due to a stop or 1048 // It may abort before committing, if it's a download or due to a stop or
1053 // a new navigation from the user. 1049 // a new navigation from the user.
1054 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; 1050 FrameHostMsg_DidFailProvisionalLoadWithError_Params params;
1055 params.error_code = net::ERR_ABORTED; 1051 params.error_code = net::ERR_ABORTED;
1056 params.error_description = base::string16(); 1052 params.error_description = base::string16();
(...skipping 3303 matching lines...) Expand 10 before | Expand all | Expand 10 after
4360 params.post_id = -1; 4356 params.post_id = -1;
4361 test_rvh()->SendNavigateWithParams(&params); 4357 test_rvh()->SendNavigateWithParams(&params);
4362 4358
4363 // Now reload. replaceState overrides the POST, so we should not show a 4359 // Now reload. replaceState overrides the POST, so we should not show a
4364 // repost warning dialog. 4360 // repost warning dialog.
4365 controller_impl().Reload(true); 4361 controller_impl().Reload(true);
4366 EXPECT_EQ(0, delegate->repost_form_warning_count()); 4362 EXPECT_EQ(0, delegate->repost_form_warning_count());
4367 } 4363 }
4368 4364
4369 } // namespace content 4365 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698