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 "content/browser/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 entry_id = controller.GetLastCommittedEntry()->GetUniqueID(); | 1512 entry_id = controller.GetLastCommittedEntry()->GetUniqueID(); |
1513 | 1513 |
1514 // The NavigationEntry should save both the original URL and the final | 1514 // The NavigationEntry should save both the original URL and the final |
1515 // redirected URL. | 1515 // redirected URL. |
1516 EXPECT_EQ( | 1516 EXPECT_EQ( |
1517 original_url, controller.GetVisibleEntry()->GetOriginalRequestURL()); | 1517 original_url, controller.GetVisibleEntry()->GetOriginalRequestURL()); |
1518 EXPECT_EQ(final_url, controller.GetVisibleEntry()->GetURL()); | 1518 EXPECT_EQ(final_url, controller.GetVisibleEntry()->GetURL()); |
1519 | 1519 |
1520 // Reload using the original URL. | 1520 // Reload using the original URL. |
1521 controller.GetVisibleEntry()->SetTitle(base::ASCIIToUTF16("Title")); | 1521 controller.GetVisibleEntry()->SetTitle(base::ASCIIToUTF16("Title")); |
1522 controller.ReloadOriginalRequestURL(false); | 1522 controller.Reload(false, ReloadType::ORIGINAL_REQUEST_URL); |
1523 EXPECT_EQ(0U, notifications.size()); | 1523 EXPECT_EQ(0U, notifications.size()); |
1524 | 1524 |
1525 // The reload is pending. The request should point to the original URL. | 1525 // The reload is pending. The request should point to the original URL. |
1526 EXPECT_EQ(original_url, navigated_url()); | 1526 EXPECT_EQ(original_url, navigated_url()); |
1527 EXPECT_EQ(controller.GetEntryCount(), 1); | 1527 EXPECT_EQ(controller.GetEntryCount(), 1); |
1528 EXPECT_EQ(controller.GetLastCommittedEntryIndex(), 0); | 1528 EXPECT_EQ(controller.GetLastCommittedEntryIndex(), 0); |
1529 EXPECT_EQ(controller.GetPendingEntryIndex(), 0); | 1529 EXPECT_EQ(controller.GetPendingEntryIndex(), 0); |
1530 EXPECT_TRUE(controller.GetLastCommittedEntry()); | 1530 EXPECT_TRUE(controller.GetLastCommittedEntry()); |
1531 EXPECT_TRUE(controller.GetPendingEntry()); | 1531 EXPECT_TRUE(controller.GetPendingEntry()); |
1532 EXPECT_FALSE(controller.CanGoBack()); | 1532 EXPECT_FALSE(controller.CanGoBack()); |
(...skipping 3672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5205 // means that occasionally a navigation conflict will end up with one entry | 5205 // means that occasionally a navigation conflict will end up with one entry |
5206 // bubbling to the end of the entry list, but that's the least-bad option. | 5206 // bubbling to the end of the entry list, but that's the least-bad option. |
5207 EXPECT_EQ(3, controller.GetEntryCount()); | 5207 EXPECT_EQ(3, controller.GetEntryCount()); |
5208 EXPECT_EQ(2, controller.GetCurrentEntryIndex()); | 5208 EXPECT_EQ(2, controller.GetCurrentEntryIndex()); |
5209 EXPECT_EQ(url_a, controller.GetEntryAtIndex(0)->GetURL()); | 5209 EXPECT_EQ(url_a, controller.GetEntryAtIndex(0)->GetURL()); |
5210 EXPECT_EQ(url_c, controller.GetEntryAtIndex(1)->GetURL()); | 5210 EXPECT_EQ(url_c, controller.GetEntryAtIndex(1)->GetURL()); |
5211 EXPECT_EQ(url_b, controller.GetEntryAtIndex(2)->GetURL()); | 5211 EXPECT_EQ(url_b, controller.GetEntryAtIndex(2)->GetURL()); |
5212 } | 5212 } |
5213 | 5213 |
5214 } // namespace content | 5214 } // namespace content |
OLD | NEW |