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

Unified Diff: mojo/public/cpp/bindings/tests/wtf_types_unittest.cc

Issue 1953493002: Mojo C++ bindings: custom type mapping for array - part 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@21_simplify
Patch Set: 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
Index: mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc b/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
index ef781bc746617920aa53ecd22a5e662ff99b5f72..223232b07aee25ab7c00f86f959e97a8c39cbd7b 100644
--- a/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
@@ -69,17 +69,18 @@ TEST_F(WTFTypesTest, WTFToWTFSerialization_StringArray) {
WTFArray<WTF::String> cloned_strs = strs.Clone();
mojo::internal::SerializationContext context;
- size_t size = GetSerializedSize_(cloned_strs, &context);
+ size_t size = mojo::internal::PrepareToSerialize<Array<mojo::String>>(
+ cloned_strs, &context);
mojo::internal::FixedBufferForTesting buf(size);
mojo::internal::Array_Data<mojo::internal::String_Data*>* data;
mojo::internal::ArrayValidateParams validate_params(
0, true, new mojo::internal::ArrayValidateParams(0, false, nullptr));
- SerializeArray_(std::move(cloned_strs), &buf, &data, &validate_params,
- &context);
+ mojo::internal::Serialize<Array<mojo::String>>(cloned_strs, &buf, &data,
+ &validate_params, &context);
WTFArray<WTF::String> strs2;
- Deserialize_(data, &strs2, nullptr);
+ mojo::internal::Deserialize<Array<mojo::String>>(data, &strs2, nullptr);
EXPECT_TRUE(strs.Equals(strs2));
}
@@ -88,16 +89,18 @@ TEST_F(WTFTypesTest, WTFToMojoSerialization_StringArray) {
WTFArray<WTF::String> strs = ConstructStringArray();
mojo::internal::SerializationContext context;
- size_t size = GetSerializedSize_(strs, &context);
+ size_t size =
+ mojo::internal::PrepareToSerialize<Array<mojo::String>>(strs, &context);
mojo::internal::FixedBufferForTesting buf(size);
mojo::internal::Array_Data<mojo::internal::String_Data*>* data;
mojo::internal::ArrayValidateParams validate_params(
0, true, new mojo::internal::ArrayValidateParams(0, false, nullptr));
- SerializeArray_(std::move(strs), &buf, &data, &validate_params, &context);
+ mojo::internal::Serialize<Array<mojo::String>>(strs, &buf, &data,
+ &validate_params, &context);
Array<mojo::String> strs2;
- Deserialize_(data, &strs2, nullptr);
+ mojo::internal::Deserialize<Array<mojo::String>>(data, &strs2, nullptr);
ASSERT_EQ(4u, strs2.size());
EXPECT_TRUE(strs2[0].is_null());
« no previous file with comments | « mojo/public/cpp/bindings/tests/union_unittest.cc ('k') | mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698