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

Unified Diff: base/string_util_unittest.cc

Issue 6017001: Move ElideString() from base/string_util.cc to app/text_elider.cc to ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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 | « base/string_util.cc ('k') | chrome/browser/chromeos/external_protocol_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util_unittest.cc
===================================================================
--- base/string_util_unittest.cc (revision 69274)
+++ base/string_util_unittest.cc (working copy)
@@ -1056,33 +1056,6 @@
}
}
-TEST(StringUtilTest, ElideString) {
- struct TestData {
- const wchar_t* input;
- int max_len;
- bool result;
- const wchar_t* output;
- } cases[] = {
- { L"Hello", 0, true, L"" },
- { L"", 0, false, L"" },
- { L"Hello, my name is Tom", 1, true, L"H" },
- { L"Hello, my name is Tom", 2, true, L"He" },
- { L"Hello, my name is Tom", 3, true, L"H.m" },
- { L"Hello, my name is Tom", 4, true, L"H..m" },
- { L"Hello, my name is Tom", 5, true, L"H...m" },
- { L"Hello, my name is Tom", 6, true, L"He...m" },
- { L"Hello, my name is Tom", 7, true, L"He...om" },
- { L"Hello, my name is Tom", 10, true, L"Hell...Tom" },
- { L"Hello, my name is Tom", 100, false, L"Hello, my name is Tom" }
- };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
- std::wstring output;
- EXPECT_EQ(cases[i].result,
- ElideString(cases[i].input, cases[i].max_len, &output));
- EXPECT_TRUE(output == cases[i].output);
- }
-}
-
TEST(StringUtilTest, RemoveChars) {
const char* kRemoveChars = "-/+*";
std::string input = "A-+bc/d!*";
« no previous file with comments | « base/string_util.cc ('k') | chrome/browser/chromeos/external_protocol_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698