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

Unified Diff: ash/drag_drop/drag_drop_controller_unittest.cc

Issue 10825143: aura: Fix a couple of drag drop issues: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 5 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
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
« ash/drag_drop/drag_drop_controller.cc ('K') | « ash/drag_drop/drag_drop_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698