Chromium Code Reviews| 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 = |