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

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: fix win_aura 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « ash/wm/session_state_controller_impl2.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698