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

Unified Diff: ios/web/navigation/navigation_item_impl_unittest.mm

Issue 2876053002: Fixed NavigationItemImpl::GetDisplayTitleForURL for 'file://' URL. (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/navigation/navigation_item_impl.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/navigation_item_impl_unittest.mm
diff --git a/ios/web/navigation/navigation_item_impl_unittest.mm b/ios/web/navigation/navigation_item_impl_unittest.mm
index a2866276551c7fe011866eff90ae5a20830c395f..57ea40e05a5f75b588e46e400c6a5e47f7e5adda 100644
--- a/ios/web/navigation/navigation_item_impl_unittest.mm
+++ b/ios/web/navigation/navigation_item_impl_unittest.mm
@@ -148,5 +148,19 @@ TEST_F(NavigationItemTest, VirtualURLTest) {
EXPECT_EQ(original_url, item_->GetURL());
}
+// Tests NavigationItemImpl::GetDisplayTitleForURL method.
+TEST_F(NavigationItemTest, GetDisplayTitleForURL) {
+ base::string16 title;
+
+ title = NavigationItemImpl::GetDisplayTitleForURL(GURL("http://foo.org/"));
+ EXPECT_EQ("foo.org", base::UTF16ToUTF8(title));
+
+ title = NavigationItemImpl::GetDisplayTitleForURL(GURL("file://foo.org/"));
+ EXPECT_EQ("file://foo.org/", base::UTF16ToUTF8(title));
+
+ title = NavigationItemImpl::GetDisplayTitleForURL(GURL("file://foo/1.gz"));
+ EXPECT_EQ("1.gz", base::UTF16ToUTF8(title));
+}
+
} // namespace
} // namespace web
« no previous file with comments | « ios/web/navigation/navigation_item_impl.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698