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

Unified Diff: base/string_util_unittest.cc

Issue 8885: Implementation of the UI part of the autofill (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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/render_view_host.h » ('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 4621)
+++ base/string_util_unittest.cc (working copy)
@@ -1219,11 +1219,27 @@
}
TEST(StringUtilTest, StartsWith) {
- EXPECT_EQ(true, StartsWithASCII("javascript:url", "javascript", true));
- EXPECT_EQ(true, StartsWithASCII("javascript:url", "javascript", false));
- EXPECT_EQ(true, StartsWithASCII("JavaScript:url", "javascript", false));
- EXPECT_EQ(false, StartsWithASCII("java", "javascript", true));
- EXPECT_EQ(false, StartsWithASCII("java", "javascript", false));
+ EXPECT_TRUE(StartsWithASCII("javascript:url", "javascript", true));
+ EXPECT_FALSE(StartsWithASCII("JavaScript:url", "javascript", true));
+ EXPECT_TRUE(StartsWithASCII("javascript:url", "javascript", false));
+ EXPECT_TRUE(StartsWithASCII("JavaScript:url", "javascript", false));
+ EXPECT_FALSE(StartsWithASCII("java", "javascript", true));
+ EXPECT_FALSE(StartsWithASCII("java", "javascript", false));
+ EXPECT_FALSE(StartsWithASCII("", "javascript", false));
+ EXPECT_FALSE(StartsWithASCII("", "javascript", true));
+ EXPECT_TRUE(StartsWithASCII("java", "", false));
+ EXPECT_TRUE(StartsWithASCII("java", "", true));
+
+ EXPECT_TRUE(StartsWith(L"javascript:url", L"javascript", true));
+ EXPECT_FALSE(StartsWith(L"JavaScript:url", L"javascript", true));
+ EXPECT_TRUE(StartsWith(L"javascript:url", L"javascript", false));
+ EXPECT_TRUE(StartsWith(L"JavaScript:url", L"javascript", false));
+ EXPECT_FALSE(StartsWith(L"java", L"javascript", true));
+ EXPECT_FALSE(StartsWith(L"java", L"javascript", false));
+ EXPECT_FALSE(StartsWith(L"", L"javascript", false));
+ EXPECT_FALSE(StartsWith(L"", L"javascript", true));
+ EXPECT_TRUE(StartsWith(L"java", L"", false));
+ EXPECT_TRUE(StartsWith(L"java", L"", true));
}
TEST(StringUtilTest, GetStringFWithOffsets) {
« no previous file with comments | « base/string_util.cc ('k') | chrome/browser/render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698