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

Unified Diff: ios/web/web_state/ui/crw_web_controller_unittest.mm

Issue 2873063002: Use the current title for items created by same document navigations. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller_unittest.mm
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
index bc71bfbc9ba346bbff34daa0ab4b37d414ff0ad9..2f9a6c94872164b3bc2d181c35beab9f8ddb6188 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -851,6 +851,14 @@ TEST_F(CRWWebControllerTitleTest, TitleChange) {
EXPECT_GE(observer.title_change_count(), 2);
};
+// Tests that fragment change navigations use title from the previous page.
+TEST_F(CRWWebControllerTitleTest, FragmentChangeNavigationsUsePreviousTitle) {
+ LoadHtml(@"<title>Title1</title>");
+ ASSERT_EQ("Title1", base::UTF16ToUTF8(web_state()->GetTitle()));
+ ExecuteJavaScript(@"window.location.hash = '#1'");
+ EXPECT_EQ("Title1", base::UTF16ToUTF8(web_state()->GetTitle()));
+}
+
// Test fixture for JavaScript execution.
class ScriptExecutionTest : public web::WebTestWithWebController {
protected:
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698