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

Unified Diff: ash/wm/workspace/workspace_window_resizer_unittest.cc

Issue 67403003: Don't lock the cursor when dragging or resizing a window with touch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 7 years, 1 month 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/workspace/workspace_window_resizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_window_resizer_unittest.cc
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index 999a17dc054b234d43143603d88191ff54cc7f5b..693b04264f504530187316f2148bc56693374d98 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -556,6 +556,43 @@ TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_3_Compress) {
EXPECT_EQ("20,366 100x134", window3_->bounds().ToString());
}
+// Tests that touch-dragging a window does not lock the mouse cursor
+// and therefore shows the cursor on a mousemove.
+TEST_F(WorkspaceWindowResizerTest, MouseMoveWithTouchDrag) {
+ window_->SetBounds(gfx::Rect(0, 300, 400, 300));
+ window2_->SetBounds(gfx::Rect(400, 200, 100, 200));
+
+ Shell* shell = Shell::GetInstance();
+ aura::test::EventGenerator generator(window_->GetRootWindow());
+
+ // The cursor should not be locked initially.
+ EXPECT_FALSE(shell->cursor_manager()->IsCursorLocked());
+
+ std::vector<aura::Window*> windows;
+ windows.push_back(window2_.get());
+ scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create(
+ window_.get(), gfx::Point(), HTRIGHT,
+ aura::client::WINDOW_MOVE_SOURCE_TOUCH, windows));
+ ASSERT_TRUE(resizer.get());
+
+ // Creating a WorkspaceWindowResizer should not lock the cursor.
+ EXPECT_FALSE(shell->cursor_manager()->IsCursorLocked());
+
+ // The cursor should be hidden after touching the screen and
+ // starting a drag.
+ EXPECT_TRUE(shell->cursor_manager()->IsCursorVisible());
+ generator.PressTouch();
+ resizer->Drag(CalculateDragPoint(*resizer, 100, 10), 0);
+ EXPECT_FALSE(shell->cursor_manager()->IsCursorVisible());
+ EXPECT_FALSE(shell->cursor_manager()->IsCursorLocked());
+
+ // Moving the mouse should show the cursor.
+ generator.MoveMouseBy(1, 1);
+ EXPECT_TRUE(shell->cursor_manager()->IsCursorVisible());
+ EXPECT_FALSE(shell->cursor_manager()->IsCursorLocked());
+
+ resizer->RevertDrag();
+}
// Assertions around dragging to the left/right edge of the screen.
TEST_F(WorkspaceWindowResizerTest, Edge) {
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698