| 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/keycodes/dom/dom_code.h" | 8 #include "ui/events/keycodes/dom/dom_code.h" |
| 9 #include "ui/events/mojo/traits_test_service.mojom.h" | 9 #include "ui/events/mojo/traits_test_service.mojom.h" |
| 10 | 10 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 for (size_t i = 0; i < arraysize(kTestData); i++) { | 192 for (size_t i = 0; i < arraysize(kTestData); i++) { |
| 193 std::unique_ptr<Event> output; | 193 std::unique_ptr<Event> output; |
| 194 proxy->EchoEvent(Event::Clone(kTestData[i]), &output); | 194 proxy->EchoEvent(Event::Clone(kTestData[i]), &output); |
| 195 EXPECT_TRUE(output->IsPointerEvent()); | 195 EXPECT_TRUE(output->IsPointerEvent()); |
| 196 | 196 |
| 197 const PointerEvent* output_ptr_event = output->AsPointerEvent(); | 197 const PointerEvent* output_ptr_event = output->AsPointerEvent(); |
| 198 EXPECT_EQ(kTestData[i].type(), output_ptr_event->type()); | 198 EXPECT_EQ(kTestData[i].type(), output_ptr_event->type()); |
| 199 EXPECT_EQ(kTestData[i].flags(), output_ptr_event->flags()); | 199 EXPECT_EQ(kTestData[i].flags(), output_ptr_event->flags()); |
| 200 EXPECT_EQ(kTestData[i].location(), output_ptr_event->location()); | 200 EXPECT_EQ(kTestData[i].location(), output_ptr_event->location()); |
| 201 EXPECT_EQ(kTestData[i].root_location(), output_ptr_event->root_location()); | 201 EXPECT_EQ(kTestData[i].root_location(), output_ptr_event->root_location()); |
| 202 EXPECT_EQ(kTestData[i].pointer_id(), output_ptr_event->pointer_id()); | 202 EXPECT_EQ(kTestData[i].pointer_details().id, |
| 203 output_ptr_event->pointer_details().id); |
| 203 EXPECT_EQ(kTestData[i].changed_button_flags(), | 204 EXPECT_EQ(kTestData[i].changed_button_flags(), |
| 204 output_ptr_event->changed_button_flags()); | 205 output_ptr_event->changed_button_flags()); |
| 205 EXPECT_EQ(kTestData[i].pointer_details(), | 206 EXPECT_EQ(kTestData[i].pointer_details(), |
| 206 output_ptr_event->pointer_details()); | 207 output_ptr_event->pointer_details()); |
| 207 } | 208 } |
| 208 } | 209 } |
| 209 | 210 |
| 210 TEST_F(StructTraitsTest, PointerWheelEvent) { | 211 TEST_F(StructTraitsTest, PointerWheelEvent) { |
| 211 MouseWheelEvent kTestData[] = { | 212 MouseWheelEvent kTestData[] = { |
| 212 {gfx::Vector2d(11, 15), gfx::Point(3, 4), gfx::Point(40, 30), | 213 {gfx::Vector2d(11, 15), gfx::Point(3, 4), gfx::Point(40, 30), |
| (...skipping 16 matching lines...) Expand all Loading... |
| 229 EXPECT_EQ(kTestData[i].flags(), output_pointer_event->flags()); | 230 EXPECT_EQ(kTestData[i].flags(), output_pointer_event->flags()); |
| 230 EXPECT_EQ(kTestData[i].location(), output_pointer_event->location()); | 231 EXPECT_EQ(kTestData[i].location(), output_pointer_event->location()); |
| 231 EXPECT_EQ(kTestData[i].root_location(), | 232 EXPECT_EQ(kTestData[i].root_location(), |
| 232 output_pointer_event->root_location()); | 233 output_pointer_event->root_location()); |
| 233 EXPECT_EQ(kTestData[i].offset(), | 234 EXPECT_EQ(kTestData[i].offset(), |
| 234 output_pointer_event->pointer_details().offset); | 235 output_pointer_event->pointer_details().offset); |
| 235 } | 236 } |
| 236 } | 237 } |
| 237 | 238 |
| 238 } // namespace ui | 239 } // namespace ui |
| OLD | NEW |