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

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: rebase 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/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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 656
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_pressed1); 659 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed1);
660 EXPECT_FALSE(cursor_manager->IsCursorVisible()); 660 EXPECT_FALSE(cursor_manager->IsCursorVisible());
661 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); 661 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
662 EXPECT_TRUE(cursor_manager->IsCursorVisible()); 662 EXPECT_TRUE(cursor_manager->IsCursorVisible());
663 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released1); 663 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released1);
664 EXPECT_TRUE(cursor_manager->IsCursorVisible()); 664 EXPECT_TRUE(cursor_manager->IsCursorVisible());
665 665
666 // If someone else made cursor invisible keep it invisible even after it 666 // If someone else made cursor disabled keep it invisible even after it
667 // received mouse events. 667 // received mouse events.
668 cursor_manager->ShowCursor(false); 668 cursor_manager->EnableCursor(false);
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_pressed2); 671 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2);
672 EXPECT_FALSE(cursor_manager->IsCursorVisible()); 672 EXPECT_FALSE(cursor_manager->IsCursorVisible());
673 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); 673 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
674 EXPECT_FALSE(cursor_manager->IsCursorVisible()); 674 EXPECT_FALSE(cursor_manager->IsCursorVisible());
675 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); 675 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2);
676 EXPECT_FALSE(cursor_manager->IsCursorVisible()); 676 EXPECT_FALSE(cursor_manager->IsCursorVisible());
677 677
678 // Back to normal. 678 // Back to normal.
679 cursor_manager->ShowCursor(true); 679 cursor_manager->EnableCursor(true);
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_pressed2); 682 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2);
683 EXPECT_FALSE(cursor_manager->IsCursorVisible()); 683 EXPECT_FALSE(cursor_manager->IsCursorVisible());
684 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); 684 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
685 EXPECT_TRUE(cursor_manager->IsCursorVisible()); 685 EXPECT_TRUE(cursor_manager->IsCursorVisible());
686 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2); 686 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_released2);
687 EXPECT_TRUE(cursor_manager->IsCursorVisible()); 687 EXPECT_TRUE(cursor_manager->IsCursorVisible());
688 } 688 }
689 689
690 } // namespace ash 690 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698