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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return w; | 86 return w; |
87 } | 87 } |
88 | 88 |
89 void MoveCursorTo(const gfx::Point& p) { | 89 void MoveCursorTo(const gfx::Point& p) { |
90 DisplayManager* display_manager = window_server_->display_manager(); | 90 DisplayManager* display_manager = window_server_->display_manager(); |
91 ASSERT_EQ(1u, display_manager->displays().size()); | 91 ASSERT_EQ(1u, display_manager->displays().size()); |
92 Display* display = *display_manager->displays().begin(); | 92 Display* display = *display_manager->displays().begin(); |
93 WindowManagerState* active_wms = display->GetActiveWindowManagerState(); | 93 WindowManagerState* active_wms = display->GetActiveWindowManagerState(); |
94 ASSERT_TRUE(active_wms); | 94 ASSERT_TRUE(active_wms); |
95 static_cast<PlatformDisplayDelegate*>(display)->OnEvent(ui::PointerEvent( | 95 static_cast<PlatformDisplayDelegate*>(display)->OnEvent(ui::PointerEvent( |
96 ui::MouseEvent(ui::ET_MOUSE_MOVED, p, p, base::TimeDelta(), 0, 0))); | 96 ui::MouseEvent(ui::ET_MOUSE_MOVED, p, p, base::TimeTicks(), 0, 0))); |
97 active_wms->OnEventAck(active_wms->tree(), mojom::EventResult::HANDLED); | 97 active_wms->OnEventAck(active_wms->tree(), mojom::EventResult::HANDLED); |
98 } | 98 } |
99 | 99 |
100 protected: | 100 protected: |
101 int32_t cursor_id_; | 101 int32_t cursor_id_; |
102 TestPlatformDisplayFactory platform_display_factory_; | 102 TestPlatformDisplayFactory platform_display_factory_; |
103 TestWindowServerDelegate window_server_delegate_; | 103 TestWindowServerDelegate window_server_delegate_; |
104 std::unique_ptr<WindowServer> window_server_; | 104 std::unique_ptr<WindowServer> window_server_; |
105 base::MessageLoop message_loop_; | 105 base::MessageLoop message_loop_; |
106 TestWindowManagerFactory test_window_manager_factory_; | 106 TestWindowManagerFactory test_window_manager_factory_; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 MoveCursorTo(gfx::Point(15, 15)); | 185 MoveCursorTo(gfx::Point(15, 15)); |
186 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, mojom::Cursor(cursor_id_)); | 186 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, mojom::Cursor(cursor_id_)); |
187 | 187 |
188 win->SetBounds(gfx::Rect(0, 0, 30, 30)); | 188 win->SetBounds(gfx::Rect(0, 0, 30, 30)); |
189 EXPECT_EQ(mojom::Cursor::IBEAM, mojom::Cursor(cursor_id_)); | 189 EXPECT_EQ(mojom::Cursor::IBEAM, mojom::Cursor(cursor_id_)); |
190 } | 190 } |
191 | 191 |
192 } // namespace test | 192 } // namespace test |
193 } // namespace ws | 193 } // namespace ws |
194 } // namespace mus | 194 } // namespace mus |
OLD | NEW |