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

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

Issue 2033503002: Add StringView::toAtomicString(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests. Created 4 years, 7 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/StringView.cpp ('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/StringViewTest.cpp
diff --git a/third_party/WebKit/Source/wtf/text/StringViewTest.cpp b/third_party/WebKit/Source/wtf/text/StringViewTest.cpp
index 6c56f43feda9c01e3bf84674755f5071f3fe1d79..05c781d3dc6db475059dbe366054506ae323453a 100644
--- a/third_party/WebKit/Source/wtf/text/StringViewTest.cpp
+++ b/third_party/WebKit/Source/wtf/text/StringViewTest.cpp
@@ -323,6 +323,15 @@ TEST(StringViewTest, ToString)
// NOTE: All the construction tests also check toString().
}
+TEST(StringViewTest, ToAtomicString)
+{
+ EXPECT_EQ(AtomicString(), nullAtom);
+ EXPECT_EQ(AtomicString(""), emptyAtom);
+ EXPECT_EQ(AtomicString("12"), StringView(kChars8, 2).toAtomicString());
+ // AtomicString will convert to 8bit if possible when creating the string.
+ EXPECT_EQ(AtomicString("12"), StringView(kChars16, 2).toAtomicString());
+}
+
TEST(StringViewTest, NullString)
{
EXPECT_TRUE(StringView().isNull());
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698