| 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 603b20c283944381c71ff9acfbfb9b87638a17bf..a8c1b693ecdb1b6b98e2fa524fccd905e71cbe93 100644
|
| --- a/content/browser/web_contents/navigation_controller_impl_unittest.cc
|
| +++ b/content/browser/web_contents/navigation_controller_impl_unittest.cc
|
| @@ -2401,20 +2401,25 @@ TEST_F(NavigationControllerTest, RemoveEntry) {
|
| test_rvh()->SendNavigate(4, url5);
|
|
|
| // Try to remove the last entry. Will fail because it is the current entry.
|
| - controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1);
|
| + EXPECT_FALSE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1));
|
| EXPECT_EQ(5, controller.GetEntryCount());
|
| EXPECT_EQ(4, controller.GetLastCommittedEntryIndex());
|
|
|
| - // Go back and remove the last entry.
|
| + // Go back, but don't commit yet. Check that we can't delete the current
|
| + // and pending entries.
|
| controller.GoBack();
|
| + EXPECT_FALSE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1));
|
| + EXPECT_FALSE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 2));
|
| +
|
| + // Now commit and delete the last entry.
|
| test_rvh()->SendNavigate(3, url4);
|
| - controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1);
|
| + EXPECT_TRUE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1));
|
| EXPECT_EQ(4, controller.GetEntryCount());
|
| EXPECT_EQ(3, controller.GetLastCommittedEntryIndex());
|
| EXPECT_FALSE(controller.GetPendingEntry());
|
|
|
| // Remove an entry which is not the last committed one.
|
| - controller.RemoveEntryAtIndex(0);
|
| + EXPECT_TRUE(controller.RemoveEntryAtIndex(0));
|
| EXPECT_EQ(3, controller.GetEntryCount());
|
| EXPECT_EQ(2, controller.GetLastCommittedEntryIndex());
|
| EXPECT_FALSE(controller.GetPendingEntry());
|
|
|