Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: ash/wm/window_manager_unittest.cc

Issue 11412315: Make the cursor have separate mode for disabled mouse events and invisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 652
653 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); 653 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
654 EXPECT_TRUE(cursor_manager->IsCursorVisible()); 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->IsCursorVisible()); 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->IsCursorVisible()); 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->IsCursorVisible()); 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 disabled keep it invisible even after it
663 // received mouse events. 663 // received mouse events.
664 cursor_manager->ShowCursor(false); 664 cursor_manager->EnableCursor(false);
665 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); 665 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
666 EXPECT_FALSE(cursor_manager->IsCursorVisible()); 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->IsCursorVisible()); 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->IsCursorVisible()); 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->IsCursorVisible()); 672 EXPECT_FALSE(cursor_manager->IsCursorVisible());
673 673
674 // Back to normal. 674 // Back to normal.
675 cursor_manager->ShowCursor(true); 675 cursor_manager->EnableCursor(true);
676 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); 676 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
677 EXPECT_TRUE(cursor_manager->IsCursorVisible()); 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->IsCursorVisible()); 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->IsCursorVisible()); 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->IsCursorVisible()); 683 EXPECT_TRUE(cursor_manager->IsCursorVisible());
684 } 684 }
685 685
686 } // namespace ash 686 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698