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

Unified Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 78443005: New Tab: fix tab title flickering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 1 month 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/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl_unittest.cc
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 2c98ee2968aed1080eed594cf25910550c8a967e..d5ac7057c18ae9629a2c0be6e9d7e3ccdd96e547 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -314,6 +314,26 @@ TEST_F(WebContentsImplTest, UpdateTitle) {
EXPECT_EQ(ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle());
}
+TEST_F(WebContentsImplTest, DontUseTitleFromPendingEntry) {
+ const GURL kGURL("chrome://blah");
+ controller().LoadURL(
+ kGURL, Referrer(), PAGE_TRANSITION_TYPED, std::string());
+ EXPECT_EQ(string16(), contents()->GetTitle());
+}
+
+TEST_F(WebContentsImplTest, UseTitleFromPendingEntryIfSet) {
+ const GURL kGURL("chrome://blah");
+ const string16 title = ASCIIToUTF16("My Title");
+ controller().LoadURL(
+ kGURL, Referrer(), PAGE_TRANSITION_TYPED, std::string());
+
+ NavigationEntry* entry = controller().GetVisibleEntry();
+ ASSERT_EQ(kGURL, entry->GetURL());
+ entry->SetTitle(title);
+
+ EXPECT_EQ(title, contents()->GetTitle());
+}
+
// Test view source mode for a webui page.
TEST_F(WebContentsImplTest, NTPViewSource) {
NavigationControllerImpl& cont =
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698