chrome/browser/sessions/session_types_unittest.cc
// Create a NavigationEntry, then create another one by converting to
// a TabNavigation and back.  The new one should match the old one
// except for fields that aren't preserved, which should be set to
// expected values.
Create a NavigationEntry, then create another one by converting to
a TabNavigation and back.  The new one should match the old one
except for fields that aren't preserved, which should be set to
expected values.
Create a NavigationEntry then create another one by converting to a TabNavigation and back . The new one should match the old one except for fields that aren ' t preserved which should be set to expected values .
TEST(TabNavigationTest, ToNavigationEntry) {
  const scoped_ptr<content::NavigationEntry> old_navigation_entry(
      MakeNavigationEntryForTest());
  const TabNavigation& navigation =
      TabNavigation::FromNavigationEntry(kIndex, *old_navigation_entry);
  const scoped_ptr<content::NavigationEntry> new_navigation_entry(
      navigation.ToNavigationEntry(kPageID, NULL));
  EXPECT_EQ(kReferrer.url, new_navigation_entry->GetReferrer().url);
  EXPECT_EQ(kReferrer.policy, new_navigation_entry->GetReferrer().policy);
  EXPECT_EQ(kVirtualURL, new_navigation_entry->GetVirtualURL());
  EXPECT_EQ(kTitle, new_navigation_entry->GetTitle());
  EXPECT_EQ(kContentState, new_navigation_entry->GetContentState());
  EXPECT_EQ(kPageID, new_navigation_entry->GetPageID());
  EXPECT_EQ(content::PAGE_TRANSITION_RELOAD,
            new_navigation_entry->GetTransitionType());
  EXPECT_EQ(kHasPostData, new_navigation_entry->GetHasPostData());
  EXPECT_EQ(kPostID, new_navigation_entry->GetPostID());
  EXPECT_EQ(kOriginalRequestURL,
            new_navigation_entry->GetOriginalRequestURL());
  EXPECT_EQ(kIsOverridingUserAgent,
            new_navigation_entry->GetIsOverridingUserAgent());
}
TEST ( TabNavigationTest , ToNavigationEntry ) { const scoped_ptr < content :: NavigationEntry > old_navigation_entry ( MakeNavigationEntryForTest ( ) ) ; const TabNavigation & navigation = TabNavigation :: FromNavigationEntry ( kIndex , * old_navigation_entry ) ; const scoped_ptr < content :: NavigationEntry > new_navigation_entry ( navigation . ToNavigationEntry ( kPageID , NULL ) ) ; EXPECT_EQ ( kReferrer . url , new_navigation_entry -> GetReferrer ( ) . url ) ; EXPECT_EQ ( kReferrer . policy , new_navigation_entry -> GetReferrer ( ) . policy ) ; EXPECT_EQ ( kVirtualURL , new_navigation_entry -> GetVirtualURL ( ) ) ; EXPECT_EQ ( kTitle , new_navigation_entry -> GetTitle ( ) ) ; EXPECT_EQ ( kContentState , new_navigation_entry -> GetContentState ( ) ) ; EXPECT_EQ ( kPageID , new_navigation_entry -> GetPageID ( ) ) ; EXPECT_EQ ( content :: PAGE_TRANSITION_RELOAD , new_navigation_entry -> GetTransitionType ( ) ) ; EXPECT_EQ ( kHasPostData , new_navigation_entry -> GetHasPostData ( ) ) ; EXPECT_EQ ( kPostID , new_navigation_entry -> GetPostID ( ) ) ; EXPECT_EQ ( kOriginalRequestURL , new_navigation_entry -> GetOriginalRequestURL ( ) ) ; EXPECT_EQ ( kIsOverridingUserAgent , new_navigation_entry -> GetIsOverridingUserAgent ( ) ) ; }
Create a NavigationEntry, then create another one by converting to
a TabNavigation and back.
Create a NavigationEntry then create another one by converting to a TabNavigation and back .