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

Unified Diff: third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp

Issue 2464793004: Mojo C++ bindings: some improvements for String16 struct traits. (Closed)
Patch Set: . Created 4 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
Index: third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp
diff --git a/third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp b/third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp
index 524271ac9f68150651fad20552403a1f8117b2fe..f208d995df1cf793fadda151ce2b6791053c81a4 100644
--- a/third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp
+++ b/third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp
@@ -46,11 +46,18 @@ TEST_F(CommonCustomTypesStructTraitsTest, String16) {
mojo::common::test::blink::TestString16Ptr ptr;
TestString16Impl impl(GetProxy(&ptr));
+ // |str| is 8-bit.
String str = String::fromUTF8("hello world");
String output;
ptr->BounceString16(str, &output);
+ ASSERT_EQ(str, output);
+
+ // Replace the "o"s in "hello world" with "o"s with acute, so that |str| is
+ // 16-bit.
+ str = String::fromUTF8("hell\xC3\xB3 w\xC3\xB3rld");
+ ptr->BounceString16(str, &output);
ASSERT_EQ(str, output);
}

Powered by Google App Engine
This is Rietveld 408576698