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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "mojo/message_pump/message_pump_mojo.h" | 8 #include "mojo/message_pump/message_pump_mojo.h" |
| 9 #include "mojo/public/cpp/bindings/array.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" |
| 11 #include "mojo/public/cpp/bindings/lib/array_internal.h" |
| 12 #include "mojo/public/cpp/bindings/lib/array_serialization.h" |
| 13 #include "mojo/public/cpp/bindings/lib/bounds_checker.h" |
| 14 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h" |
| 15 #include "mojo/public/cpp/bindings/string.h" |
| 16 #include "mojo/public/cpp/test_support/test_utils.h" |
| 17 #include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h" |
| 18 #include "mojo/public/interfaces/bindings/tests/test_unions.mojom.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "third_party/mojo/src/mojo/public/cpp/bindings/array.h" | |
11 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | |
12 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/array_internal.h" | |
13 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/array_serialization.
h" | |
14 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/bounds_checker.h" | |
15 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/fixed_buffer.h" | |
16 #include "third_party/mojo/src/mojo/public/cpp/bindings/string.h" | |
17 #include "third_party/mojo/src/mojo/public/cpp/test_support/test_utils.h" | |
18 #include "third_party/mojo/src/mojo/public/interfaces/bindings/tests/test_struct
s.mojom.h" | |
19 #include "third_party/mojo/src/mojo/public/interfaces/bindings/tests/test_unions
.mojom.h" | |
20 | 20 |
21 namespace mojo { | 21 namespace mojo { |
22 namespace test { | 22 namespace test { |
23 | 23 |
24 TEST(UnionTest, PlainOldDataGetterSetter) { | 24 TEST(UnionTest, PlainOldDataGetterSetter) { |
25 PodUnionPtr pod(PodUnion::New()); | 25 PodUnionPtr pod(PodUnion::New()); |
26 | 26 |
27 pod->set_f_int8(10); | 27 pod->set_f_int8(10); |
28 EXPECT_EQ(10, pod->get_f_int8()); | 28 EXPECT_EQ(10, pod->get_f_int8()); |
29 EXPECT_TRUE(pod->is_f_int8()); | 29 EXPECT_TRUE(pod->is_f_int8()); |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 PodUnionPtr pod(PodUnion::New()); | 1122 PodUnionPtr pod(PodUnion::New()); |
1123 pod->set_f_int16(16); | 1123 pod->set_f_int16(16); |
1124 | 1124 |
1125 ptr->Echo(pod.Pass(), | 1125 ptr->Echo(pod.Pass(), |
1126 [](PodUnionPtr out) { EXPECT_EQ(16, out->get_f_int16()); }); | 1126 [](PodUnionPtr out) { EXPECT_EQ(16, out->get_f_int16()); }); |
1127 run_loop.RunUntilIdle(); | 1127 run_loop.RunUntilIdle(); |
1128 } | 1128 } |
1129 | 1129 |
1130 } // namespace test | 1130 } // namespace test |
1131 } // namespace mojo | 1131 } // namespace mojo |
OLD | NEW |