diff options
author | stuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 19:12:37 +0000 |
---|---|---|
committer | stuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 19:12:37 +0000 |
commit | 996fd703fb7229e931203edc77df436aea9bc9a5 (patch) | |
tree | e52458f9e43ec4762ce58c3b15a235ad31e3d667 /base/string_util_unittest.cc | |
parent | f62a8906648ddfcee0ffa9604939d4c7f66891aa (diff) | |
download | chromium_src-996fd703fb7229e931203edc77df436aea9bc9a5.zip chromium_src-996fd703fb7229e931203edc77df436aea9bc9a5.tar.gz chromium_src-996fd703fb7229e931203edc77df436aea9bc9a5.tar.bz2 |
Strip .plugin off of Mac plugin names when showing the crash info bar.
BUG=21029
TEST=Kill a plugin process; the plugin crash info bar shouldn't have ".plugin" in the plugin name.
Review URL: http://codereview.chromium.org/197018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util_unittest.cc')
-rw-r--r-- | base/string_util_unittest.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc index 35c58d6..b11a999 100644 --- a/base/string_util_unittest.cc +++ b/base/string_util_unittest.cc @@ -1576,6 +1576,25 @@ 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)); + EXPECT_TRUE(EndsWith(L".plugin", L".plugin", false)); + EXPECT_TRUE(EndsWith(L".plugin", L".plugin", true)); + EXPECT_TRUE(EndsWith(L"", L"", false)); + EXPECT_TRUE(EndsWith(L"", L"", true)); +} + TEST(StringUtilTest, GetStringFWithOffsets) { std::vector<string16> subst; subst.push_back(ASCIIToUTF16("1")); |