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

Unified Diff: ash/wm/window_manager_unittest.cc

Issue 10982040: Fix mouse lock on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 8 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/power_button_controller.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_manager_unittest.cc
diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc
index 777d9b95e3d1f511a3dd7721f82ebaecea018ccc..b99bbb841bd58effd0fd5f40d0d4f4d425ea3843 100644
--- a/ash/wm/window_manager_unittest.cc
+++ b/ash/wm/window_manager_unittest.cc
@@ -589,8 +589,6 @@ TEST_F(WindowManagerTest, UpdateCursorVisibility) {
scoped_ptr<aura::Window> window(aura::test::CreateTestWindow(
SK_ColorWHITE, -1, gfx::Rect(0, 0, 500, 500), NULL));
- aura::shared::CompoundEventFilter* env_filter =
- Shell::GetInstance()->env_filter();
ash::CursorManager* cursor_manager =
ash::Shell::GetInstance()->cursor_manager();
@@ -601,7 +599,6 @@ TEST_F(WindowManagerTest, UpdateCursorVisibility) {
ui::TouchEvent touch_pressed2(
ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 1, getTime());
- env_filter->set_update_cursor_visibility(true);
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_TRUE(cursor_manager->cursor_visible());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed1);
@@ -609,12 +606,23 @@ TEST_F(WindowManagerTest, UpdateCursorVisibility) {
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_TRUE(cursor_manager->cursor_visible());
- env_filter->set_update_cursor_visibility(false);
+ // If someone else made cursor invisible keep it invisible even after it
+ // received mouse events.
cursor_manager->ShowCursor(false);
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_FALSE(cursor_manager->cursor_visible());
+ root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2);
+ EXPECT_FALSE(cursor_manager->cursor_visible());
+ root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
+ EXPECT_FALSE(cursor_manager->cursor_visible());
+
+ // Back to normal.
cursor_manager->ShowCursor(true);
+ root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
+ EXPECT_TRUE(cursor_manager->cursor_visible());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2);
+ EXPECT_FALSE(cursor_manager->cursor_visible());
+ root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved);
EXPECT_TRUE(cursor_manager->cursor_visible());
}
« no previous file with comments | « ash/wm/power_button_controller.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