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

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

Issue 1967703004: Mojo C++ bindings: add StringTraits and ArrayTraits for STL types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@27_update_users
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/struct_traits_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc b/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
index 634c15304e50a7ab6ce1ac9170329eb081615242..e750d397ef6d63ae8feed2814a50806bf2855231 100644
--- a/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
@@ -214,6 +214,11 @@ TEST_F(StructTraitsTest, FieldTypes) {
input.set_uint32(7);
input.set_uint64(42);
input.set_string("hello world!");
+ input.get_mutable_string_array().assign({"hello", "world!"});
+ input.get_mutable_struct().value = 42;
+ input.get_mutable_struct_array().resize(2);
+ input.get_mutable_struct_array()[0].value = 1;
+ input.get_mutable_struct_array()[1].value = 2;
base::RunLoop loop;
TraitsTestServicePtr proxy = GetTraitsTestProxy();
@@ -224,6 +229,9 @@ TEST_F(StructTraitsTest, FieldTypes) {
EXPECT_EQ(input.get_uint32(), passed.get_uint32());
EXPECT_EQ(input.get_uint64(), passed.get_uint64());
EXPECT_EQ(input.get_string(), passed.get_string());
+ EXPECT_EQ(input.get_string_array(), passed.get_string_array());
+ EXPECT_EQ(input.get_struct(), passed.get_struct());
+ EXPECT_EQ(input.get_struct_array(), passed.get_struct_array());
loop.Quit();
});
loop.Run();
« no previous file with comments | « mojo/public/cpp/bindings/string_traits_stl.h ('k') | mojo/public/cpp/bindings/tests/struct_with_traits.typemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698