| 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/test_activation_delegate.h" | 8 #include "ash/test/test_activation_delegate.h" |
| 9 #include "ash/wm/activation_controller.h" | 9 #include "ash/wm/activation_controller.h" |
| 10 #include "ash/wm/cursor_manager.h" | 10 #include "ash/wm/cursor_manager.h" |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 ui::TouchEvent touch_pressed1( | 644 ui::TouchEvent touch_pressed1( |
| 645 ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, getTime()); | 645 ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, getTime()); |
| 646 ui::TouchEvent touch_pressed2( | 646 ui::TouchEvent touch_pressed2( |
| 647 ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 1, getTime()); | 647 ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 1, getTime()); |
| 648 ui::TouchEvent touch_released1( | 648 ui::TouchEvent touch_released1( |
| 649 ui::ET_TOUCH_RELEASED, gfx::Point(0, 0), 0, getTime()); | 649 ui::ET_TOUCH_RELEASED, gfx::Point(0, 0), 0, getTime()); |
| 650 ui::TouchEvent touch_released2( | 650 ui::TouchEvent touch_released2( |
| 651 ui::ET_TOUCH_RELEASED, gfx::Point(0, 0), 1, getTime()); | 651 ui::ET_TOUCH_RELEASED, gfx::Point(0, 0), 1, getTime()); |
| 652 | 652 |
| 653 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 653 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
| 654 EXPECT_TRUE(cursor_manager->cursor_visible()); | 654 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
| 655 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed1); | 655 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed1); |
| 656 EXPECT_FALSE(cursor_manager->cursor_visible()); | 656 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
| 657 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 657 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
| 658 EXPECT_TRUE(cursor_manager->cursor_visible()); | 658 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
| 659 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released1); | 659 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released1); |
| 660 EXPECT_TRUE(cursor_manager->cursor_visible()); | 660 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
| 661 | 661 |
| 662 // If someone else made cursor invisible keep it invisible even after it | 662 // If someone else made cursor invisible keep it invisible even after it |
| 663 // received mouse events. | 663 // received mouse events. |
| 664 cursor_manager->ShowCursor(false); | 664 cursor_manager->ShowCursor(false); |
| 665 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 665 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
| 666 EXPECT_FALSE(cursor_manager->cursor_visible()); | 666 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
| 667 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); | 667 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); |
| 668 EXPECT_FALSE(cursor_manager->cursor_visible()); | 668 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
| 669 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 669 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
| 670 EXPECT_FALSE(cursor_manager->cursor_visible()); | 670 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
| 671 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); | 671 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); |
| 672 EXPECT_FALSE(cursor_manager->cursor_visible()); | 672 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
| 673 | 673 |
| 674 // Back to normal. | 674 // Back to normal. |
| 675 cursor_manager->ShowCursor(true); | 675 cursor_manager->ShowCursor(true); |
| 676 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 676 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
| 677 EXPECT_TRUE(cursor_manager->cursor_visible()); | 677 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
| 678 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); | 678 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); |
| 679 EXPECT_FALSE(cursor_manager->cursor_visible()); | 679 EXPECT_FALSE(cursor_manager->IsCursorVisible()); |
| 680 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 680 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
| 681 EXPECT_TRUE(cursor_manager->cursor_visible()); | 681 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
| 682 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); | 682 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); |
| 683 EXPECT_TRUE(cursor_manager->cursor_visible()); | 683 EXPECT_TRUE(cursor_manager->IsCursorVisible()); |
| 684 } | 684 } |
| 685 | 685 |
| 686 } // namespace ash | 686 } // namespace ash |
| OLD | NEW |