OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "mojo/public/cpp/bindings/binding_set.h" | 6 #include "mojo/public/cpp/bindings/binding_set.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/events/event.h" | 8 #include "ui/events/event.h" |
9 #include "ui/events/keycodes/dom/dom_code.h" | 9 #include "ui/events/keycodes/dom/dom_code.h" |
10 #include "ui/events/mojo/event.mojom.h" | 10 #include "ui/events/mojo/event.mojom.h" |
11 #include "ui/events/mojo/event_struct_traits.h" | 11 #include "ui/events/mojo/event_struct_traits.h" |
| 12 #include "ui/events/mojo/traits_test_service.mojom.h" |
| 13 #include "ui/latency/mojo/latency_info_struct_traits.h" |
12 | 14 |
13 namespace ui { | 15 namespace ui { |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 class StructTraitsTest : public testing::Test, public mojom::TraitsTestService { | 19 class StructTraitsTest : public testing::Test, public mojom::TraitsTestService { |
18 public: | 20 public: |
19 StructTraitsTest() {} | 21 StructTraitsTest() {} |
20 | 22 |
21 protected: | 23 protected: |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 std::unique_ptr<Event> event_ptr = Event::Clone(key_event); | 181 std::unique_ptr<Event> event_ptr = Event::Clone(key_event); |
180 std::unique_ptr<Event> deserialized; | 182 std::unique_ptr<Event> deserialized; |
181 ASSERT_TRUE(mojom::Event::Deserialize(mojom::Event::Serialize(&event_ptr), | 183 ASSERT_TRUE(mojom::Event::Deserialize(mojom::Event::Serialize(&event_ptr), |
182 &deserialized)); | 184 &deserialized)); |
183 ASSERT_TRUE(deserialized->IsKeyEvent()); | 185 ASSERT_TRUE(deserialized->IsKeyEvent()); |
184 ASSERT_TRUE(deserialized->AsKeyEvent()->properties()); | 186 ASSERT_TRUE(deserialized->AsKeyEvent()->properties()); |
185 EXPECT_EQ(properties, *(deserialized->AsKeyEvent()->properties())); | 187 EXPECT_EQ(properties, *(deserialized->AsKeyEvent()->properties())); |
186 } | 188 } |
187 | 189 |
188 } // namespace ui | 190 } // namespace ui |
OLD | NEW |