Index: ash/drag_drop/drag_drop_controller_unittest.cc |
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc |
index b56c1a36aeca125ef3c8eab60f25682ea9b2d8e3..77e63808fab3bcab8e72922fc5d8668d639a2e3d 100644 |
--- a/ash/drag_drop/drag_drop_controller_unittest.cc |
+++ b/ash/drag_drop/drag_drop_controller_unittest.cc |
@@ -120,13 +120,6 @@ class TestDragDropController : public internal::DragDropController { |
drag_string_.clear(); |
} |
- bool drag_start_received_; |
- int num_drag_updates_; |
- bool drop_received_; |
- bool drag_canceled_; |
- string16 drag_string_; |
- |
- private: |
int StartDragAndDrop(const ui::OSExchangeData& data, |
const gfx::Point& location, |
int operation) OVERRIDE { |
@@ -135,6 +128,18 @@ class TestDragDropController : public internal::DragDropController { |
return DragDropController::StartDragAndDrop(data, location, operation); |
} |
+ void DragCancel() OVERRIDE { |
+ DragDropController::DragCancel(); |
+ drag_canceled_ = true; |
+ } |
+ |
+ bool drag_start_received_; |
+ int num_drag_updates_; |
+ bool drop_received_; |
+ bool drag_canceled_; |
+ string16 drag_string_; |
+ |
+ private: |
void DragUpdate(aura::Window* target, |
const aura::LocatedEvent& event) OVERRIDE { |
DragDropController::DragUpdate(target, event); |
@@ -146,11 +151,6 @@ class TestDragDropController : public internal::DragDropController { |
drop_received_ = true; |
} |
- void DragCancel() OVERRIDE { |
- DragDropController::DragCancel(); |
- drag_canceled_ = true; |
- } |
- |
DISALLOW_COPY_AND_ASSIGN(TestDragDropController); |
}; |
@@ -671,5 +671,28 @@ TEST_F(DragDropControllerTest, PressingEscapeCancelsDragDrop) { |
EXPECT_TRUE(drag_view->drag_done_received_); |
} |
+TEST_F(DragDropControllerTest, LockCursorWhileInDrag) { |
+ ui::OSExchangeData data; |
+ drag_drop_controller_->StartDragAndDrop(data, gfx::Point(), 0); |
+ |
+ // We should not be able to change cursor |
+ EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->is_cursor_locked()); |
+ EXPECT_FALSE(Shell::GetPrimaryRootWindow()->last_cursor() == |
+ ui::kCursorProgress); |
+ ash::Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorProgress); |
+ EXPECT_FALSE(Shell::GetPrimaryRootWindow()->last_cursor() == |
+ ui::kCursorProgress); |
+ |
+ drag_drop_controller_->DragCancel(); |
+ |
+ // Now we can change cursor |
+ EXPECT_FALSE(ash::Shell::GetInstance()->cursor_manager()->is_cursor_locked()); |
+ EXPECT_FALSE(Shell::GetPrimaryRootWindow()->last_cursor() == |
+ ui::kCursorProgress); |
+ ash::Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorProgress); |
+ EXPECT_TRUE(Shell::GetPrimaryRootWindow()->last_cursor() == |
+ ui::kCursorProgress); |
+} |
+ |
} // namespace test |
} // namespace aura |