summaryrefslogtreecommitdiffstats
path: root/app/gfx/text_elider_unittest.cc
diff options
context:
space:
mode:
authorxji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-16 17:21:13 +0000
committerxji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-16 17:21:13 +0000
commit48c70517e3bb914c4157e27fb0d70492f4f76cbe (patch)
treea4f31a59aaf2f2133dacc5440b285b9e6070ae6b /app/gfx/text_elider_unittest.cc
parent873043ae174de16897b9c9ff84ecd0e4f07ae516 (diff)
downloadchromium_src-48c70517e3bb914c4157e27fb0d70492f4f76cbe.zip
chromium_src-48c70517e3bb914c4157e27fb0d70492f4f76cbe.tar.gz
chromium_src-48c70517e3bb914c4157e27fb0d70492f4f76cbe.tar.bz2
This CL fixes issue 10860 - RTL: Hebrew file names should have forced LTR
directionality in download shelf. File names in download shelf are forced to be LTR in DownloadItemView and through ElideFileName(). BUG=http://crbug.com/10860 TEST=1. Open chrome with Hebrew UI. 2. Right click a link and chose Save As... (4th item from the top for non-Hebrew speakers) 3. In the save as dialog name the file קובץ.html 4. In the download shelf the filename should display as קובץ.html (not html.קובץ) Review URL: http://codereview.chromium.org/131001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/gfx/text_elider_unittest.cc')
-rw-r--r--app/gfx/text_elider_unittest.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/gfx/text_elider_unittest.cc b/app/gfx/text_elider_unittest.cc
index abb7c23..fb6e7523 100644
--- a/app/gfx/text_elider_unittest.cc
+++ b/app/gfx/text_elider_unittest.cc
@@ -4,6 +4,7 @@
#include "app/gfx/font.h"
#include "app/gfx/text_elider.h"
+#include "app/l10n_util.h"
#include "base/file_path.h"
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
@@ -176,7 +177,10 @@ TEST(TextEliderTest, TestFilenameEliding) {
static const gfx::Font font;
for (size_t i = 0; i < arraysize(testcases); ++i) {
FilePath filepath(testcases[i].input);
- EXPECT_EQ(testcases[i].output, ElideFilename(filepath,
+ std::wstring expected = testcases[i].output;
+ if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
+ l10n_util::WrapStringWithLTRFormatting(&expected);
+ EXPECT_EQ(expected, ElideFilename(filepath,
font,
font.GetStringWidth(testcases[i].output)));
}