| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h" | 10 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h" |
| 11 #include "mojo/public/cpp/system/message_pipe.h" | 11 #include "mojo/public/cpp/system/message_pipe.h" |
| 12 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h" | 12 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace mojo { | 15 namespace mojo { |
| 16 namespace test { | 16 namespace test { |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 RectPtr MakeRect(int32_t factor = 1) { | 19 RectPtr __declspec(dllexport) MakeRect(int32_t factor = 1) { |
| 20 RectPtr rect(Rect::New()); | 20 RectPtr rect(Rect::New()); |
| 21 rect->x = 1 * factor; | 21 rect->x = 1 * factor; |
| 22 rect->y = 2 * factor; | 22 rect->y = 2 * factor; |
| 23 rect->width = 10 * factor; | 23 rect->width = 10 * factor; |
| 24 rect->height = 20 * factor; | 24 rect->height = 20 * factor; |
| 25 return rect; | 25 return rect; |
| 26 } | 26 } |
| 27 | 27 |
| 28 void CheckRect(const Rect& rect, int32_t factor = 1) { | 28 void CheckRect(const Rect& rect, int32_t factor = 1) { |
| 29 EXPECT_EQ(1 * factor, rect.x); | 29 EXPECT_EQ(1 * factor, rect.x); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 expected_output->f_int32 = 123; | 409 expected_output->f_int32 = 123; |
| 410 | 410 |
| 411 MultiVersionStructV0Ptr output = | 411 MultiVersionStructV0Ptr output = |
| 412 SerializeAndDeserialize<MultiVersionStructV0Ptr>(std::move(input)); | 412 SerializeAndDeserialize<MultiVersionStructV0Ptr>(std::move(input)); |
| 413 EXPECT_TRUE(output); | 413 EXPECT_TRUE(output); |
| 414 EXPECT_TRUE(output->Equals(*expected_output)); | 414 EXPECT_TRUE(output->Equals(*expected_output)); |
| 415 } | 415 } |
| 416 } | 416 } |
| 417 } // namespace test | 417 } // namespace test |
| 418 } // namespace mojo | 418 } // namespace mojo |
| OLD | NEW |