| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gtest/gtest.h" |
| 5 #include "mojo/public/cpp/bindings/array.h" | 6 #include "mojo/public/cpp/bindings/array.h" |
| 6 #include "mojo/public/cpp/bindings/lib/array_serialization.h" | 7 #include "mojo/public/cpp/bindings/lib/array_serialization.h" |
| 7 #include "mojo/public/cpp/bindings/lib/validation_errors.h" | 8 #include "mojo/public/cpp/bindings/lib/validation_errors.h" |
| 8 #include "mojo/public/cpp/system/message_pipe.h" | 9 #include "mojo/public/cpp/system/message_pipe.h" |
| 9 #include "mojo/public/interfaces/bindings/tests/rect.mojom.h" | 10 #include "mojo/public/interfaces/bindings/tests/rect.mojom.h" |
| 10 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h" | 11 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | |
| 12 | 12 |
| 13 namespace mojo { | 13 namespace mojo { |
| 14 namespace test { | 14 namespace test { |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 class StructSerializationAPITest : public testing::Test { | 17 class StructSerializationAPITest : public testing::Test { |
| 18 public: | 18 public: |
| 19 // We Serialize and Deserialize the given |Type|, and expect the given | 19 // We Serialize and Deserialize the given |Type|, and expect the given |
| 20 // serialization warnings. We also validate (and expect a given error) in | 20 // serialization warnings. We also validate (and expect a given error) in |
| 21 // between serialization and deserialization. | 21 // between serialization and deserialization. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // don't Validate. | 196 // don't Validate. |
| 197 co_data->header_.num_bytes = 0u; | 197 co_data->header_.num_bytes = 0u; |
| 198 co.DeserializeWithoutValidation(buf); | 198 co.DeserializeWithoutValidation(buf); |
| 199 EXPECT_EQ(kMagic, co_data->other); | 199 EXPECT_EQ(kMagic, co_data->other); |
| 200 EXPECT_EQ(0u, co_data->header_.num_bytes); | 200 EXPECT_EQ(0u, co_data->header_.num_bytes); |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace | 203 } // namespace |
| 204 } // namespace test | 204 } // namespace test |
| 205 } // namespace mojo | 205 } // namespace mojo |
| OLD | NEW |