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 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex()); | 1024 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex()); |
1025 EXPECT_EQ(0, delegate->navigation_state_change_count()); | 1025 EXPECT_EQ(0, delegate->navigation_state_change_count()); |
1026 | 1026 |
1027 // The visible entry should be the last committed URL, not the pending one. | 1027 // The visible entry should be the last committed URL, not the pending one. |
1028 EXPECT_EQ(kExistingURL, controller.GetVisibleEntry()->GetURL()); | 1028 EXPECT_EQ(kExistingURL, controller.GetVisibleEntry()->GetURL()); |
1029 | 1029 |
1030 // Now the navigation redirects. | 1030 // Now the navigation redirects. |
1031 const GURL kRedirectURL("http://foo/see"); | 1031 const GURL kRedirectURL("http://foo/see"); |
1032 main_test_rfh()->OnMessageReceived( | 1032 main_test_rfh()->OnMessageReceived( |
1033 FrameHostMsg_DidRedirectProvisionalLoad(0, // routing_id | 1033 FrameHostMsg_DidRedirectProvisionalLoad(0, // routing_id |
1034 1, // pending page_id | 1034 -1, // pending page_id |
1035 kNewURL, // old url | 1035 kNewURL, // old url |
1036 kRedirectURL)); // new url | 1036 kRedirectURL)); // new url |
1037 | 1037 |
1038 // We don't want to change the NavigationEntry's url, in case it cancels. | 1038 // We don't want to change the NavigationEntry's url, in case it cancels. |
1039 // Prevents regression of http://crbug.com/77786. | 1039 // Prevents regression of http://crbug.com/77786. |
1040 EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); | 1040 EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); |
1041 | 1041 |
1042 // It may abort before committing, if it's a download or due to a stop or | 1042 // It may abort before committing, if it's a download or due to a stop or |
1043 // a new navigation from the user. | 1043 // a new navigation from the user. |
1044 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; | 1044 FrameHostMsg_DidFailProvisionalLoadWithError_Params params; |
(...skipping 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4335 params.post_id = -1; | 4335 params.post_id = -1; |
4336 test_rvh()->SendNavigateWithParams(¶ms); | 4336 test_rvh()->SendNavigateWithParams(¶ms); |
4337 | 4337 |
4338 // Now reload. replaceState overrides the POST, so we should not show a | 4338 // Now reload. replaceState overrides the POST, so we should not show a |
4339 // repost warning dialog. | 4339 // repost warning dialog. |
4340 controller_impl().Reload(true); | 4340 controller_impl().Reload(true); |
4341 EXPECT_EQ(0, delegate->repost_form_warning_count()); | 4341 EXPECT_EQ(0, delegate->repost_form_warning_count()); |
4342 } | 4342 } |
4343 | 4343 |
4344 } // namespace content | 4344 } // namespace content |
OLD | NEW |