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

Unified Diff: third_party/WebKit/Source/wtf/text/WTFStringTest.cpp

Issue 1845363003: String replaceWithLiteral should just use strlen, also rename to replace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another NUL fix. Created 4 years, 9 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 | « third_party/WebKit/Source/wtf/text/WTFString.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/WTFStringTest.cpp
diff --git a/third_party/WebKit/Source/wtf/text/WTFStringTest.cpp b/third_party/WebKit/Source/wtf/text/WTFStringTest.cpp
index 8f072c3b5ad4b4bf1dc696be932cb14551d9c86f..fde96af01d2e4335370e34847e1ccbbaa5998d66 100644
--- a/third_party/WebKit/Source/wtf/text/WTFStringTest.cpp
+++ b/third_party/WebKit/Source/wtf/text/WTFStringTest.cpp
@@ -116,39 +116,39 @@ TEST(StringTest, ReplaceWithLiteral)
// Cases for 8Bit source.
String testString = "1224";
EXPECT_TRUE(testString.is8Bit());
- testString.replaceWithLiteral('2', "");
+ testString.replace('2', "");
EXPECT_STREQ("14", testString.utf8().data());
testString = "1224";
EXPECT_TRUE(testString.is8Bit());
- testString.replaceWithLiteral('2', "3");
+ testString.replace('2', "3");
EXPECT_STREQ("1334", testString.utf8().data());
testString = "1224";
EXPECT_TRUE(testString.is8Bit());
- testString.replaceWithLiteral('2', "555");
+ testString.replace('2', "555");
EXPECT_STREQ("15555554", testString.utf8().data());
testString = "1224";
EXPECT_TRUE(testString.is8Bit());
- testString.replaceWithLiteral('3', "NotFound");
+ testString.replace('3', "NotFound");
EXPECT_STREQ("1224", testString.utf8().data());
// Cases for 16Bit source.
// U+00E9 (=0xC3 0xA9 in UTF-8) is e with accent.
testString = String::fromUTF8("r\xC3\xA9sum\xC3\xA9");
EXPECT_FALSE(testString.is8Bit());
- testString.replaceWithLiteral(UChar(0x00E9), "e");
+ testString.replace(UChar(0x00E9), "e");
EXPECT_STREQ("resume", testString.utf8().data());
testString = String::fromUTF8("r\xC3\xA9sum\xC3\xA9");
EXPECT_FALSE(testString.is8Bit());
- testString.replaceWithLiteral(UChar(0x00E9), "");
+ testString.replace(UChar(0x00E9), "");
EXPECT_STREQ("rsum", testString.utf8().data());
testString = String::fromUTF8("r\xC3\xA9sum\xC3\xA9");
EXPECT_FALSE(testString.is8Bit());
- testString.replaceWithLiteral('3', "NotFound");
+ testString.replace('3', "NotFound");
EXPECT_STREQ("r\xC3\xA9sum\xC3\xA9", testString.utf8().data());
}
« no previous file with comments | « third_party/WebKit/Source/wtf/text/WTFString.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698