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

Unified Diff: base/string_util_unittest.cc

Issue 197018: Strip .plugin off of Mac plugin names when showing the crash info bar. (Closed)
Patch Set: Add a test with the match in the middle Created 11 years, 3 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 | « base/string_util.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util_unittest.cc
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc
index 35c58d6668ac805a643244721ac1e13a59b9b35b..98f64bd1a15245621252e1602479110fb3632de5 100644
--- a/base/string_util_unittest.cc
+++ b/base/string_util_unittest.cc
@@ -1576,6 +1576,21 @@ TEST(StringUtilTest, StartsWith) {
EXPECT_TRUE(StartsWith(L"java", L"", true));
}
+TEST(StringUtilTest, EndsWith) {
+ EXPECT_TRUE(EndsWith(L"Foo.plugin", L".plugin", true));
+ EXPECT_FALSE(EndsWith(L"Foo.Plugin", L".plugin", true));
+ EXPECT_TRUE(EndsWith(L"Foo.plugin", L".plugin", false));
+ EXPECT_TRUE(EndsWith(L"Foo.Plugin", L".plugin", false));
+ EXPECT_FALSE(EndsWith(L".plug", L".plugin", true));
+ EXPECT_FALSE(EndsWith(L".plug", L".plugin", false));
+ EXPECT_FALSE(EndsWith(L"Foo.plugin Bar", L".plugin", true));
+ EXPECT_FALSE(EndsWith(L"Foo.plugin Bar", L".plugin", false));
+ EXPECT_FALSE(EndsWith(L"", L".plugin", false));
+ EXPECT_FALSE(EndsWith(L"", L".plugin", true));
+ EXPECT_TRUE(EndsWith(L"Foo.plugin", L"", false));
+ EXPECT_TRUE(EndsWith(L"Foo.plugin", L"", true));
+}
Mark Mentovai 2009/09/04 18:09:00 I'd also add a few cases to test |str == search|,
+
TEST(StringUtilTest, GetStringFWithOffsets) {
std::vector<string16> subst;
subst.push_back(ASCIIToUTF16("1"));
« no previous file with comments | « base/string_util.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698