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 "services/ui/ws/window_manager_state.h" | 5 #include "services/ui/ws/window_manager_state.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 ASSERT_EQ(1u, window_server()->display_manager()->displays().size()); | 642 ASSERT_EQ(1u, window_server()->display_manager()->displays().size()); |
643 Display* display = *(window_server()->display_manager()->displays().begin()); | 643 Display* display = *(window_server()->display_manager()->displays().begin()); |
644 DisplayTestApi display_test_api(display); | 644 DisplayTestApi display_test_api(display); |
645 const ClientWindowId child_window_id(11); | 645 const ClientWindowId child_window_id(11); |
646 window_tree()->NewWindow(child_window_id, ServerWindow::Properties()); | 646 window_tree()->NewWindow(child_window_id, ServerWindow::Properties()); |
647 ServerWindow* child_window = | 647 ServerWindow* child_window = |
648 window_tree()->GetWindowByClientId(child_window_id); | 648 window_tree()->GetWindowByClientId(child_window_id); |
649 window_tree()->AddWindow(FirstRootId(window_tree()), child_window_id); | 649 window_tree()->AddWindow(FirstRootId(window_tree()), child_window_id); |
650 child_window->SetVisible(true); | 650 child_window->SetVisible(true); |
651 child_window->SetBounds(gfx::Rect(0, 0, 20, 20)); | 651 child_window->SetBounds(gfx::Rect(0, 0, 20, 20)); |
652 child_window->parent()->SetPredefinedCursor(ui::mojom::CursorType::COPY); | 652 child_window->parent()->SetPredefinedCursor(ui::mojom::CursorType::kCopy); |
653 EXPECT_EQ(ui::mojom::CursorType::COPY, display_test_api.last_cursor()); | 653 EXPECT_EQ(ui::mojom::CursorType::kCopy, display_test_api.last_cursor()); |
654 // Move the mouse outside the bounds of the child, so that the mouse is not | 654 // Move the mouse outside the bounds of the child, so that the mouse is not |
655 // over any valid windows. Cursor should change to POINTER. | 655 // over any valid windows. Cursor should change to POINTER. |
656 ui::PointerEvent move( | 656 ui::PointerEvent move( |
657 ui::ET_POINTER_MOVED, gfx::Point(25, 25), gfx::Point(25, 25), 0, 0, | 657 ui::ET_POINTER_MOVED, gfx::Point(25, 25), gfx::Point(25, 25), 0, 0, |
658 ui::PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, 0), | 658 ui::PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, 0), |
659 base::TimeTicks()); | 659 base::TimeTicks()); |
660 window_manager_state()->ProcessEvent(move, 0); | 660 window_manager_state()->ProcessEvent(move, 0); |
661 // The event isn't over a valid target, which should trigger resetting the | 661 // The event isn't over a valid target, which should trigger resetting the |
662 // cursor to POINTER. | 662 // cursor to POINTER. |
663 EXPECT_EQ(ui::mojom::CursorType::POINTER, display_test_api.last_cursor()); | 663 EXPECT_EQ(ui::mojom::CursorType::kPointer, display_test_api.last_cursor()); |
664 } | 664 } |
665 | 665 |
666 } // namespace test | 666 } // namespace test |
667 } // namespace ws | 667 } // namespace ws |
668 } // namespace ui | 668 } // namespace ui |
OLD | NEW |