OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "ash/shell_window_ids.h" | 6 #include "ash/shell_window_ids.h" |
7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "ash/test/shell_test_api.h" | 8 #include "ash/test/shell_test_api.h" |
9 #include "ash/test/test_activation_delegate.h" | 9 #include "ash/test/test_activation_delegate.h" |
10 #include "ash/wm/activation_controller.h" | 10 #include "ash/wm/activation_controller.h" |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 EXPECT_TRUE(cursor_manager->IsCursorVisible()); | 664 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
665 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed1); | 665 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed1); |
666 EXPECT_FALSE(cursor_manager->IsCursorVisible()); | 666 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
667 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 667 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
668 EXPECT_TRUE(cursor_manager->IsCursorVisible()); | 668 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
669 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released1); | 669 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released1); |
670 EXPECT_TRUE(cursor_manager->IsCursorVisible()); | 670 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
671 | 671 |
672 // If someone else made cursor invisible keep it invisible even after it | 672 // If someone else made cursor invisible keep it invisible even after it |
673 // received mouse events. | 673 // received mouse events. |
674 cursor_manager->ShowCursor(false); | 674 cursor_manager->DisableMouseEvents(); |
675 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 675 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
676 EXPECT_FALSE(cursor_manager->IsCursorVisible()); | 676 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
677 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); | 677 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); |
678 EXPECT_FALSE(cursor_manager->IsCursorVisible()); | 678 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
679 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 679 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
680 EXPECT_FALSE(cursor_manager->IsCursorVisible()); | 680 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
681 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); | 681 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); |
682 EXPECT_FALSE(cursor_manager->IsCursorVisible()); | 682 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
683 | 683 |
684 // Back to normal. | 684 // Back to normal. |
685 cursor_manager->ShowCursor(true); | 685 cursor_manager->EnableMouseEvents(); |
686 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 686 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
687 EXPECT_TRUE(cursor_manager->IsCursorVisible()); | 687 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
688 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); | 688 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); |
689 EXPECT_FALSE(cursor_manager->IsCursorVisible()); | 689 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
690 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 690 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
691 EXPECT_TRUE(cursor_manager->IsCursorVisible()); | 691 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
692 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); | 692 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); |
693 EXPECT_TRUE(cursor_manager->IsCursorVisible()); | 693 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
694 } | 694 } |
695 | 695 |
696 } // namespace ash | 696 } // namespace ash |
OLD | NEW |