Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: content/browser/frame_host/navigation_entry_impl_unittest.cc

Issue 994803004: Add Clone and disallow copy construction for NavigationEntryImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix leak in test. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_entry_impl_unittest.cc
diff --git a/content/browser/frame_host/navigation_entry_impl_unittest.cc b/content/browser/frame_host/navigation_entry_impl_unittest.cc
index 663386a1316399e6d786735f20df8f4b8bb51d8c..274676dff55bd8374e0fbebcac8bba964195c1b9 100644
--- a/content/browser/frame_host/navigation_entry_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_entry_impl_unittest.cc
@@ -213,6 +213,27 @@ TEST_F(NavigationEntryTest, NavigationEntryAccessors) {
EXPECT_TRUE(entry2_->GetFrameToNavigate().empty());
}
+// Test basic Clone behavior.
+TEST_F(NavigationEntryTest, NavigationEntryClone) {
+ // Set some additional values.
+ entry2_->SetTransitionType(ui::PAGE_TRANSITION_RELOAD);
+ entry2_->set_should_replace_entry(true);
+
+ scoped_ptr<NavigationEntryImpl> clone(entry2_->Clone());
+
+ // Value from FrameNavigationEntry.
+ EXPECT_EQ(entry2_->site_instance(), clone->site_instance());
+
+ // Value from constructor.
+ EXPECT_EQ(entry2_->GetTitle(), clone->GetTitle());
+
+ // Value set after constructor.
+ EXPECT_EQ(entry2_->GetTransitionType(), clone->GetTransitionType());
+
+ // Value not copied due to ResetForCommit.
+ EXPECT_NE(entry2_->should_replace_entry(), clone->should_replace_entry());
+}
+
// Test timestamps.
TEST_F(NavigationEntryTest, NavigationEntryTimestamps) {
EXPECT_EQ(base::Time(), entry1_->GetTimestamp());
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698