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

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: Try again. 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
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..4dc32f7e66ccc134b0b44ed65132e26f0a2158a5 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, UseTitleFromPendingEntry) {
Charlie Reis 2013/11/25 18:17:47 nit: UseTitleFromPendingEntryIfSet
samarth 2013/11/25 18:40:51 Done.
+ 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 =

Powered by Google App Engine
This is Rietveld 408576698