Index: content/browser/frame_host/navigation_controller_impl_unittest.cc |
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc |
index 6afa917a14b3f08a3a644b0937f813b1e28a6944..00906aba8f3d254798945185a56b9c7d5180334f 100644 |
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc |
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc |
@@ -4175,6 +4175,27 @@ TEST_F(NavigationControllerTest, MAYBE_PurgeScreenshot) { |
} |
} |
+TEST_F(NavigationControllerTest, PushStateUpdatesTitle) { |
+ |
+ // Navigate |
+ test_rvh()->SendNavigate(1, GURL("http://foo")); |
+ |
+ // Set title |
+ base::string16 title(base::ASCIIToUTF16("Title")); |
+ controller().GetVisibleEntry()->SetTitle(title); |
nasko
2014/05/30 19:04:55
GetLastCommittedEntry, since it should already be
Nate Chapin
2014/05/30 19:10:05
Done.
|
+ |
+ // history.pushState() is called. |
+ FrameHostMsg_DidCommitProvisionalLoad_Params params; |
+ params.page_id = 2; |
+ params.url = GURL("http://foo#foo"); |
+ params.was_within_same_page = true; |
+ test_rvh()->SendNavigateWithParams(¶ms); |
+ |
+ // The title should immediately be visible on the new NavigationEntry. |
+ EXPECT_EQ(title, |
+ controller().GetVisibleEntry()->GetTitleForDisplay(std::string())); |
nasko
2014/05/30 19:04:55
ditto on GetLastCommittedEntry
Nate Chapin
2014/05/30 19:10:05
Done.
|
+} |
+ |
// Test that the navigation controller clears its session history when a |
// navigation commits with the clear history list flag set. |
TEST_F(NavigationControllerTest, ClearHistoryList) { |