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

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

Issue 2012693002: Generate a templated Clone method for all mojo structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « no previous file | mojo/public/interfaces/bindings/tests/struct_with_traits.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 38fbaf11cfbd04fd4ac5d4744dcc0e3fd8893535..e0d4736a686bcc27cf774dff0e0bc39cf531a74e 100644
--- a/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
@@ -242,6 +242,16 @@ TEST_F(StructTraitsTest, EchoStructWithTraits) {
loop.Run();
}
+TEST_F(StructTraitsTest, CloneStructWithTraitsContainer) {
+ StructWithTraitsContainerPtr container = StructWithTraitsContainer::New();
+ container->f_struct.set_uint32(7);
+ container->f_struct.set_uint64(42);
+ StructWithTraitsContainerPtr cloned_container = container.Clone();
+ EXPECT_EQ(7u, cloned_container->f_struct.get_uint32());
+ EXPECT_EQ(42u, cloned_container->f_struct.get_uint64());
+
+}
+
TEST_F(StructTraitsTest, EchoPassByValueStructWithTraits) {
MessagePipe mp;
PassByValueStructWithTraitsImpl input;
« no previous file with comments | « no previous file | mojo/public/interfaces/bindings/tests/struct_with_traits.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698