| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 return w; | 83 return w; |
| 84 } | 84 } |
| 85 | 85 |
| 86 void MoveCursorTo(const gfx::Point& p) { | 86 void MoveCursorTo(const gfx::Point& p) { |
| 87 DisplayManager* display_manager = window_server()->display_manager(); | 87 DisplayManager* display_manager = window_server()->display_manager(); |
| 88 ASSERT_EQ(1u, display_manager->displays().size()); | 88 ASSERT_EQ(1u, display_manager->displays().size()); |
| 89 Display* display = *display_manager->displays().begin(); | 89 Display* display = *display_manager->displays().begin(); |
| 90 WindowManagerDisplayRoot* active_display_root = | 90 WindowManagerDisplayRoot* active_display_root = |
| 91 display->GetActiveWindowManagerDisplayRoot(); | 91 display->GetActiveWindowManagerDisplayRoot(); |
| 92 ASSERT_TRUE(active_display_root); | 92 ASSERT_TRUE(active_display_root); |
| 93 static_cast<PlatformDisplayDelegate*>(display)->OnEvent(PointerEvent( | 93 PointerEvent event( |
| 94 MouseEvent(ET_MOUSE_MOVED, p, p, base::TimeTicks(), 0, 0))); | 94 MouseEvent(ET_MOUSE_MOVED, p, p, base::TimeTicks(), 0, 0)); |
| 95 ignore_result(static_cast<PlatformDisplayDelegate*>(display) |
| 96 ->GetEventSink() |
| 97 ->OnEventFromSource(&event)); |
| 95 WindowManagerState* wms = active_display_root->window_manager_state(); | 98 WindowManagerState* wms = active_display_root->window_manager_state(); |
| 96 wms->OnEventAck(wms->window_tree(), mojom::EventResult::HANDLED); | 99 wms->OnEventAck(wms->window_tree(), mojom::EventResult::HANDLED); |
| 97 } | 100 } |
| 98 | 101 |
| 99 private: | 102 private: |
| 100 WindowServerTestHelper ws_test_helper_; | 103 WindowServerTestHelper ws_test_helper_; |
| 101 TestScreenManager screen_manager_; | 104 TestScreenManager screen_manager_; |
| 102 DISALLOW_COPY_AND_ASSIGN(CursorTest); | 105 DISALLOW_COPY_AND_ASSIGN(CursorTest); |
| 103 }; | 106 }; |
| 104 | 107 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 MoveCursorTo(gfx::Point(15, 15)); | 180 MoveCursorTo(gfx::Point(15, 15)); |
| 178 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, cursor()); | 181 EXPECT_EQ(mojom::Cursor::EAST_RESIZE, cursor()); |
| 179 | 182 |
| 180 win->SetBounds(gfx::Rect(0, 0, 30, 30)); | 183 win->SetBounds(gfx::Rect(0, 0, 30, 30)); |
| 181 EXPECT_EQ(mojom::Cursor::COPY, cursor()); | 184 EXPECT_EQ(mojom::Cursor::COPY, cursor()); |
| 182 } | 185 } |
| 183 | 186 |
| 184 } // namespace test | 187 } // namespace test |
| 185 } // namespace ws | 188 } // namespace ws |
| 186 } // namespace ui | 189 } // namespace ui |
| OLD | NEW |