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

Unified Diff: content/browser/frame_host/navigation_entry_impl_unittest.cc

Issue 2176463002: Default page title (the page's URL) is now in an LTR embedding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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 | « content/browser/frame_host/navigation_entry_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_entry_impl_unittest.cc
diff --git a/content/browser/frame_host/navigation_entry_impl_unittest.cc b/content/browser/frame_host/navigation_entry_impl_unittest.cc
index f44e6e8525c9c7b25690cdb690da5f07dba8f0b2..3534af8212af8f533f669e71c3089e52b25a28cd 100644
--- a/content/browser/frame_host/navigation_entry_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_entry_impl_unittest.cc
@@ -67,13 +67,27 @@ TEST_F(NavigationEntryTest, NavigationEntryURLs) {
entry1_->SetURL(GURL("http://www.google.com"));
EXPECT_EQ(GURL("http://www.google.com"), entry1_->GetURL());
EXPECT_EQ(GURL("http://www.google.com"), entry1_->GetVirtualURL());
- EXPECT_EQ(ASCIIToUTF16("www.google.com"),
+ EXPECT_EQ(ASCIIToUTF16("www.google.com"), entry1_->GetTitleForDisplay());
+
+ // Setting URL with RTL characters causes it to be wrapped in an LTR
+ // embedding.
+ entry1_->SetURL(GURL("http://www.xn--rgba6eo.com"));
+ EXPECT_EQ(base::WideToUTF16(L"\x202a"
+ L"www.\x062c\x0648\x062c\x0644"
+ L".com\x202c"),
entry1_->GetTitleForDisplay());
// file:/// URLs should only show the filename.
entry1_->SetURL(GURL("file:///foo/bar baz.txt"));
EXPECT_EQ(ASCIIToUTF16("bar baz.txt"), entry1_->GetTitleForDisplay());
+ // file:/// URLs should *not* be wrapped in an LTR embedding.
+ entry1_->SetURL(GURL("file:///foo/%D8%A7%D8%A8 %D8%AC%D8%AF.txt"));
+ EXPECT_EQ(base::WideToUTF16(L"\x0627\x0628"
+ L" \x062c\x062f"
+ L".txt"),
+ entry1_->GetTitleForDisplay());
+
// For file:/// URLs, make sure that slashes after the filename are ignored.
// Regression test for https://crbug.com/503003.
entry1_->SetURL(GURL("file:///foo/bar baz.txt#foo/bar"));
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698