| 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 <linux/input.h> | 5 #include <linux/input.h> |
| 6 #include <wayland-server.h> | 6 #include <wayland-server.h> |
| 7 | 7 |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 wl::MockPointer* pointer; | 38 wl::MockPointer* pointer; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 DISALLOW_COPY_AND_ASSIGN(WaylandPointerTest); | 41 DISALLOW_COPY_AND_ASSIGN(WaylandPointerTest); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 TEST_F(WaylandPointerTest, Leave) { | 44 TEST_F(WaylandPointerTest, Leave) { |
| 45 MockPlatformWindowDelegate other_delegate; | 45 MockPlatformWindowDelegate other_delegate; |
| 46 WaylandWindow other_window(&other_delegate, &display, | 46 WaylandWindow other_window(&other_delegate, &connection, |
| 47 gfx::Rect(0, 0, 10, 10)); | 47 gfx::Rect(0, 0, 10, 10)); |
| 48 gfx::AcceleratedWidget other_widget = gfx::kNullAcceleratedWidget; | 48 gfx::AcceleratedWidget other_widget = gfx::kNullAcceleratedWidget; |
| 49 EXPECT_CALL(other_delegate, OnAcceleratedWidgetAvailable(_, _)) | 49 EXPECT_CALL(other_delegate, OnAcceleratedWidgetAvailable(_, _)) |
| 50 .WillOnce(SaveArg<0>(&other_widget)); | 50 .WillOnce(SaveArg<0>(&other_widget)); |
| 51 ASSERT_TRUE(other_window.Initialize()); | 51 ASSERT_TRUE(other_window.Initialize()); |
| 52 ASSERT_NE(other_widget, gfx::kNullAcceleratedWidget); | 52 ASSERT_NE(other_widget, gfx::kNullAcceleratedWidget); |
| 53 | 53 |
| 54 Sync(); | 54 Sync(); |
| 55 | 55 |
| 56 wl::MockSurface* other_surface = | 56 wl::MockSurface* other_surface = |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 auto mouse_wheel_event = static_cast<MouseWheelEvent*>(event.get()); | 223 auto mouse_wheel_event = static_cast<MouseWheelEvent*>(event.get()); |
| 224 EXPECT_EQ(gfx::Vector2d(MouseWheelEvent::kWheelDelta, 0), | 224 EXPECT_EQ(gfx::Vector2d(MouseWheelEvent::kWheelDelta, 0), |
| 225 mouse_wheel_event->offset()); | 225 mouse_wheel_event->offset()); |
| 226 EXPECT_EQ(EF_LEFT_MOUSE_BUTTON, mouse_wheel_event->button_flags()); | 226 EXPECT_EQ(EF_LEFT_MOUSE_BUTTON, mouse_wheel_event->button_flags()); |
| 227 EXPECT_EQ(0, mouse_wheel_event->changed_button_flags()); | 227 EXPECT_EQ(0, mouse_wheel_event->changed_button_flags()); |
| 228 EXPECT_EQ(gfx::PointF(50, 75), mouse_wheel_event->location_f()); | 228 EXPECT_EQ(gfx::PointF(50, 75), mouse_wheel_event->location_f()); |
| 229 EXPECT_EQ(gfx::PointF(50, 75), mouse_wheel_event->root_location_f()); | 229 EXPECT_EQ(gfx::PointF(50, 75), mouse_wheel_event->root_location_f()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace ui | 232 } // namespace ui |
| OLD | NEW |