| Index: mojo/public/cpp/bindings/tests/struct_unittest.cc
|
| diff --git a/mojo/public/cpp/bindings/tests/struct_unittest.cc b/mojo/public/cpp/bindings/tests/struct_unittest.cc
|
| index 13ba507e153ed1792f6bf2dae90ff7e7995c9ea2..a6870527065dc9aa906f07d1775c4e760cee4725 100644
|
| --- a/mojo/public/cpp/bindings/tests/struct_unittest.cc
|
| +++ b/mojo/public/cpp/bindings/tests/struct_unittest.cc
|
| @@ -9,6 +9,7 @@
|
|
|
| #include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
|
| #include "mojo/public/cpp/system/message_pipe.h"
|
| +#include "mojo/public/interfaces/bindings/tests/test_export2.mojom.h"
|
| #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -435,7 +436,7 @@ TEST_F(StructTest, Serialization_PublicAPI) {
|
|
|
| // Initialize it to non-null.
|
| RectPtr output(Rect::New());
|
| - ASSERT_TRUE(Rect::Deserialize(std::move(data), &output));
|
| + ASSERT_TRUE(Rect::Deserialize(data, &output));
|
| EXPECT_TRUE(output.is_null());
|
| }
|
|
|
| @@ -446,7 +447,7 @@ TEST_F(StructTest, Serialization_PublicAPI) {
|
| EXPECT_FALSE(data.empty());
|
|
|
| EmptyStructPtr output;
|
| - ASSERT_TRUE(EmptyStruct::Deserialize(std::move(data), &output));
|
| + ASSERT_TRUE(EmptyStruct::Deserialize(data, &output));
|
| EXPECT_FALSE(output.is_null());
|
| }
|
|
|
| @@ -457,7 +458,7 @@ TEST_F(StructTest, Serialization_PublicAPI) {
|
| auto data = Rect::Serialize(&rect);
|
|
|
| RectPtr output;
|
| - ASSERT_TRUE(Rect::Deserialize(std::move(data), &output));
|
| + ASSERT_TRUE(Rect::Deserialize(data, &output));
|
| EXPECT_TRUE(output.Equals(cloned_rect));
|
| }
|
|
|
| @@ -475,7 +476,7 @@ TEST_F(StructTest, Serialization_PublicAPI) {
|
| // Make sure that the serialized result gets pointers encoded properly.
|
| auto cloned_data = data;
|
| NamedRegionPtr output;
|
| - ASSERT_TRUE(NamedRegion::Deserialize(std::move(cloned_data), &output));
|
| + ASSERT_TRUE(NamedRegion::Deserialize(cloned_data, &output));
|
| EXPECT_TRUE(output.Equals(cloned_region));
|
| }
|
|
|
| @@ -485,7 +486,17 @@ TEST_F(StructTest, Serialization_PublicAPI) {
|
| auto data = Rect::Serialize(&rect);
|
|
|
| NamedRegionPtr output;
|
| - EXPECT_FALSE(NamedRegion::Deserialize(std::move(data), &output));
|
| + EXPECT_FALSE(NamedRegion::Deserialize(data, &output));
|
| + }
|
| +
|
| + {
|
| + // A struct from another component.
|
| + auto pair = test_export2::StringPair::New("hello", "world");
|
| + auto data = test_export2::StringPair::Serialize(&pair);
|
| +
|
| + test_export2::StringPairPtr output;
|
| + ASSERT_TRUE(test_export2::StringPair::Deserialize(data, &output));
|
| + EXPECT_TRUE(output.Equals(pair));
|
| }
|
| }
|
|
|
|
|