OLD | NEW |
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 Loading... |
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 corresponding message here.) |
1041 const GURL kRedirectURL("http://foo/see"); | 1041 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 | 1042 |
1048 // We don't want to change the NavigationEntry's url, in case it cancels. | 1043 // We don't want to change the NavigationEntry's url, in case it cancels. |
1049 // Prevents regression of http://crbug.com/77786. | 1044 // Prevents regression of http://crbug.com/77786. |
1050 EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); | 1045 EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); |
1051 | 1046 |
1052 // It may abort before committing, if it's a download or due to a stop or | 1047 // It may abort before committing, if it's a download or due to a stop or |
1053 // a new navigation from the user. | 1048 // a new navigation from the user. |
1054 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; | 1049 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; |
1055 params.error_code = net::ERR_ABORTED; | 1050 params.error_code = net::ERR_ABORTED; |
1056 params.error_description = base::string16(); | 1051 params.error_description = base::string16(); |
(...skipping 3303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4360 params.post_id = -1; | 4355 params.post_id = -1; |
4361 test_rvh()->SendNavigateWithParams(¶ms); | 4356 test_rvh()->SendNavigateWithParams(¶ms); |
4362 | 4357 |
4363 // Now reload. replaceState overrides the POST, so we should not show a | 4358 // Now reload. replaceState overrides the POST, so we should not show a |
4364 // repost warning dialog. | 4359 // repost warning dialog. |
4365 controller_impl().Reload(true); | 4360 controller_impl().Reload(true); |
4366 EXPECT_EQ(0, delegate->repost_form_warning_count()); | 4361 EXPECT_EQ(0, delegate->repost_form_warning_count()); |
4367 } | 4362 } |
4368 | 4363 |
4369 } // namespace content | 4364 } // namespace content |
OLD | NEW |