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

Unified Diff: content/browser/tab_contents/navigation_entry_unittest.cc

Issue 8224023: Don't show URL for pending new navigations initiated by the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsBrowserInitiated helper. Created 9 years, 2 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
Index: content/browser/tab_contents/navigation_entry_unittest.cc
diff --git a/content/browser/tab_contents/navigation_entry_unittest.cc b/content/browser/tab_contents/navigation_entry_unittest.cc
index bbd6e34556e6dc3c144693b36faca63532b49de4..496511005ae6d9212407bc6ada19a259164d96ac 100644
--- a/content/browser/tab_contents/navigation_entry_unittest.cc
+++ b/content/browser/tab_contents/navigation_entry_unittest.cc
@@ -187,3 +187,16 @@ TEST_F(NavigationEntryTest, NavigationEntryAccessors) {
entry2_->set_restore_type(NavigationEntry::RESTORE_LAST_SESSION);
EXPECT_EQ(NavigationEntry::RESTORE_LAST_SESSION, entry2_->restore_type());
}
+
+// Test whether entries are browser-initiated.
+TEST_F(NavigationEntryTest, NavigationEntryBrowserInitiated) {
+ // Link clicks and form submissions are renderer-initiated.
+ EXPECT_EQ(PageTransition::LINK, entry1_.get()->transition_type());
+ EXPECT_FALSE(entry1_.get()->IsBrowserInitiated());
+ entry1_.get()->set_transition_type(PageTransition::FORM_SUBMIT);
+ EXPECT_FALSE(entry1_.get()->IsBrowserInitiated());
+
+ // Typed URLs are browser-initiated.
+ EXPECT_EQ(PageTransition::TYPED, entry2_.get()->transition_type());
+ EXPECT_TRUE(entry2_.get()->IsBrowserInitiated());
+}

Powered by Google App Engine
This is Rietveld 408576698