| Index: content/browser/frame_host/navigation_controller_impl_unittest.cc
|
| diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
|
| index b23fb0156a37669669e0312f395f165c16ec67d5..5863b90b45376734a1601a74f25ccb395ee4548b 100644
|
| --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
|
| +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
|
| @@ -307,13 +307,13 @@ class LoadCommittedDetailsObserver : public WebContentsObserver {
|
| explicit LoadCommittedDetailsObserver(WebContents* web_contents)
|
| : WebContentsObserver(web_contents),
|
| navigation_type_(NAVIGATION_TYPE_UNKNOWN),
|
| - is_in_page_(false),
|
| + is_same_document_(false),
|
| is_main_frame_(false),
|
| did_replace_entry_(false) {}
|
|
|
| NavigationType navigation_type() { return navigation_type_; }
|
| const GURL& previous_url() { return previous_url_; }
|
| - bool is_in_page() { return is_in_page_; }
|
| + bool is_same_document() { return is_same_document_; }
|
| bool is_main_frame() { return is_main_frame_; }
|
| bool did_replace_entry() { return did_replace_entry_; }
|
|
|
| @@ -325,14 +325,14 @@ class LoadCommittedDetailsObserver : public WebContentsObserver {
|
| navigation_type_ = static_cast<NavigationHandleImpl*>(navigation_handle)
|
| ->navigation_type();
|
| previous_url_ = navigation_handle->GetPreviousURL();
|
| - is_in_page_ = navigation_handle->IsSameDocument();
|
| + is_same_document_ = navigation_handle->IsSameDocument();
|
| is_main_frame_ = navigation_handle->IsInMainFrame();
|
| did_replace_entry_ = navigation_handle->DidReplaceEntry();
|
| }
|
|
|
| NavigationType navigation_type_;
|
| GURL previous_url_;
|
| - bool is_in_page_;
|
| + bool is_same_document_;
|
| bool is_main_frame_;
|
| bool did_replace_entry_;
|
| };
|
| @@ -2275,7 +2275,7 @@ TEST_F(NavigationControllerTest, NewSubframe) {
|
| EXPECT_EQ(1U, navigation_entry_committed_counter_);
|
| navigation_entry_committed_counter_ = 0;
|
| EXPECT_EQ(url1, observer.previous_url());
|
| - EXPECT_FALSE(observer.is_in_page());
|
| + EXPECT_FALSE(observer.is_same_document());
|
| EXPECT_FALSE(observer.is_main_frame());
|
|
|
| // The new entry should be appended.
|
| @@ -2621,7 +2621,7 @@ TEST_F(NavigationControllerTest, LinkClick) {
|
| EXPECT_FALSE(controller.CanGoForward());
|
| }
|
|
|
| -TEST_F(NavigationControllerTest, InPage) {
|
| +TEST_F(NavigationControllerTest, SameDocument) {
|
| NavigationControllerImpl& controller = controller_impl();
|
| TestNotificationTracker notifications;
|
| RegisterForAllNavNotifications(¬ifications, &controller);
|
| @@ -2656,7 +2656,7 @@ TEST_F(NavigationControllerTest, InPage) {
|
| NavigationEntry* entry1 = controller.GetLastCommittedEntry();
|
| EXPECT_EQ(1U, navigation_entry_committed_counter_);
|
| navigation_entry_committed_counter_ = 0;
|
| - EXPECT_TRUE(observer.is_in_page());
|
| + EXPECT_TRUE(observer.is_same_document());
|
| EXPECT_TRUE(observer.did_replace_entry());
|
| EXPECT_EQ(1, controller.GetEntryCount());
|
|
|
| @@ -2681,7 +2681,7 @@ TEST_F(NavigationControllerTest, InPage) {
|
| NavigationEntry* entry2 = controller.GetLastCommittedEntry();
|
| EXPECT_EQ(1U, navigation_entry_committed_counter_);
|
| navigation_entry_committed_counter_ = 0;
|
| - EXPECT_TRUE(observer.is_in_page());
|
| + EXPECT_TRUE(observer.is_same_document());
|
| EXPECT_FALSE(observer.did_replace_entry());
|
| EXPECT_EQ(2, controller.GetEntryCount());
|
|
|
| @@ -2693,7 +2693,7 @@ TEST_F(NavigationControllerTest, InPage) {
|
| main_test_rfh()->SendNavigateWithParams(&back_params);
|
| EXPECT_EQ(1U, navigation_entry_committed_counter_);
|
| navigation_entry_committed_counter_ = 0;
|
| - EXPECT_TRUE(observer.is_in_page());
|
| + EXPECT_TRUE(observer.is_same_document());
|
| EXPECT_EQ(2, controller.GetEntryCount());
|
| EXPECT_EQ(0, controller.GetCurrentEntryIndex());
|
| EXPECT_EQ(back_params.url, controller.GetVisibleEntry()->GetURL());
|
| @@ -2706,7 +2706,7 @@ TEST_F(NavigationControllerTest, InPage) {
|
| main_test_rfh()->SendNavigateWithParams(&forward_params);
|
| EXPECT_EQ(1U, navigation_entry_committed_counter_);
|
| navigation_entry_committed_counter_ = 0;
|
| - EXPECT_TRUE(observer.is_in_page());
|
| + EXPECT_TRUE(observer.is_same_document());
|
| EXPECT_EQ(2, controller.GetEntryCount());
|
| EXPECT_EQ(1, controller.GetCurrentEntryIndex());
|
| EXPECT_EQ(forward_params.url,
|
| @@ -2723,7 +2723,8 @@ TEST_F(NavigationControllerTest, InPage) {
|
| EXPECT_EQ(forward_params.url,
|
| controller.GetVisibleEntry()->GetURL());
|
|
|
| - // Finally, navigate to an unrelated URL to make sure in_page is not sticky.
|
| + // Finally, navigate to an unrelated URL to make sure same_document is not
|
| + // sticky.
|
| const GURL url3("http://bar");
|
| params.nav_entry_id = 0;
|
| params.did_create_new_entry = true;
|
| @@ -2738,12 +2739,12 @@ TEST_F(NavigationControllerTest, InPage) {
|
| main_test_rfh()->SendNavigateWithParams(¶ms);
|
| EXPECT_EQ(1U, navigation_entry_committed_counter_);
|
| navigation_entry_committed_counter_ = 0;
|
| - EXPECT_FALSE(observer.is_in_page());
|
| + EXPECT_FALSE(observer.is_same_document());
|
| EXPECT_EQ(3, controller.GetEntryCount());
|
| EXPECT_EQ(2, controller.GetCurrentEntryIndex());
|
| }
|
|
|
| -TEST_F(NavigationControllerTest, InPage_Replace) {
|
| +TEST_F(NavigationControllerTest, SameDocument_Replace) {
|
| NavigationControllerImpl& controller = controller_impl();
|
| TestNotificationTracker notifications;
|
| RegisterForAllNavNotifications(¬ifications, &controller);
|
| @@ -2772,7 +2773,7 @@ TEST_F(NavigationControllerTest, InPage_Replace) {
|
| main_test_rfh()->SendNavigateWithParams(¶ms);
|
| EXPECT_EQ(1U, navigation_entry_committed_counter_);
|
| navigation_entry_committed_counter_ = 0;
|
| - EXPECT_TRUE(observer.is_in_page());
|
| + EXPECT_TRUE(observer.is_same_document());
|
| EXPECT_TRUE(observer.did_replace_entry());
|
| EXPECT_EQ(1, controller.GetEntryCount());
|
| }
|
| @@ -2824,7 +2825,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) {
|
| main_test_rfh()->SendNavigateWithParams(¶ms);
|
| EXPECT_EQ(1U, navigation_entry_committed_counter_);
|
| navigation_entry_committed_counter_ = 0;
|
| - EXPECT_TRUE(observer.is_in_page());
|
| + EXPECT_TRUE(observer.is_same_document());
|
| EXPECT_TRUE(observer.did_replace_entry());
|
| EXPECT_EQ(2, controller.GetEntryCount());
|
| }
|
| @@ -2851,7 +2852,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) {
|
| main_test_rfh()->SendNavigateWithParams(¶ms);
|
| EXPECT_EQ(1U, navigation_entry_committed_counter_);
|
| navigation_entry_committed_counter_ = 0;
|
| - EXPECT_FALSE(observer.is_in_page());
|
| + EXPECT_FALSE(observer.is_same_document());
|
| EXPECT_EQ(3, controller.GetEntryCount());
|
| }
|
|
|
| @@ -5140,7 +5141,7 @@ TEST_F(NavigationControllerTest, UnreachableURLGivesErrorPage) {
|
| main_test_rfh()->SendNavigateWithParams(¶ms);
|
| EXPECT_EQ(PAGE_TYPE_ERROR,
|
| controller_impl().GetLastCommittedEntry()->GetPageType());
|
| - EXPECT_TRUE(observer.is_in_page());
|
| + EXPECT_TRUE(observer.is_same_document());
|
| }
|
| }
|
|
|
|
|