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

Unified Diff: services/ui/ws/drag_controller_unittest.cc

Issue 2784663003: mus: Rename mojom::Cursor to mojom::CursorType. (Closed)
Patch Set: Created 3 years, 9 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 | « services/ui/ws/drag_controller.cc ('k') | services/ui/ws/event_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/drag_controller_unittest.cc
diff --git a/services/ui/ws/drag_controller_unittest.cc b/services/ui/ws/drag_controller_unittest.cc
index 47e043ec8dcb73b0df55af4ae9cd9407ff84d34b..335264077dbcef9711bb96d7d71b59b7979cdfba 100644
--- a/services/ui/ws/drag_controller_unittest.cc
+++ b/services/ui/ws/drag_controller_unittest.cc
@@ -162,7 +162,7 @@ class DragControllerTest : public testing::Test,
// It would be nice if we could just let the observer method fire, but it
// fires during the constructor when we haven't assigned the unique_ptr
// yet.
- cursor_ = ui::mojom::Cursor(drag_operation_->current_cursor());
+ cursor_ = ui::mojom::CursorType(drag_operation_->current_cursor());
}
void DispatchDrag(DragTestWindow* window,
@@ -204,7 +204,7 @@ class DragControllerTest : public testing::Test,
return drag_completed_value_;
}
- ui::mojom::Cursor cursor() { return cursor_; }
+ ui::mojom::CursorType cursor() { return cursor_; }
private:
// Overridden from testing::Test:
@@ -232,7 +232,7 @@ class DragControllerTest : public testing::Test,
// Overridden from DragCursorUpdater:
void OnDragCursorUpdated() override {
if (drag_operation_)
- cursor_ = ui::mojom::Cursor(drag_operation_->current_cursor());
+ cursor_ = ui::mojom::CursorType(drag_operation_->current_cursor());
}
// Overridden from DragControllerSource:
@@ -260,7 +260,7 @@ class DragControllerTest : public testing::Test,
int window_id_ = 3;
- ui::mojom::Cursor cursor_;
+ ui::mojom::CursorType cursor_;
std::map<WindowId, ServerWindow*> server_window_by_id_;
std::map<ServerWindow*, DragTargetConnection*> connection_by_window_;
@@ -282,14 +282,14 @@ TEST_F(DragControllerTest, SimpleDragDrop) {
std::unique_ptr<DragTestWindow> window = BuildWindow();
StartDragOperation(window.get(), ui::mojom::kDropEffectMove);
- EXPECT_EQ(ui::mojom::Cursor::NO_DROP, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::NO_DROP, cursor());
DispatchDrag(window.get(), false, ui::EF_LEFT_MOUSE_BUTTON, gfx::Point(1, 1));
EXPECT_EQ(QueuedType::ENTER, window->queue_response_type());
window->Respond(true);
// (Even though we're doing a move, the cursor name is COPY.)
- EXPECT_EQ(ui::mojom::Cursor::COPY, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::COPY, cursor());
DispatchDrag(window.get(), false, ui::EF_LEFT_MOUSE_BUTTON, gfx::Point(2, 2));
EXPECT_EQ(QueuedType::OVER, window->queue_response_type());
@@ -538,7 +538,7 @@ TEST_F(DragControllerTest, TargetWindowClosedResetsCursor) {
std::unique_ptr<DragTestWindow> window1 = BuildWindow();
std::unique_ptr<DragTestWindow> window2 = BuildWindow();
StartDragOperation(window1.get(), ui::mojom::kDropEffectMove);
- EXPECT_EQ(ui::mojom::Cursor::NO_DROP, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::NO_DROP, cursor());
// Send some events to |window|.
DispatchDrag(window2.get(), false, ui::EF_LEFT_MOUSE_BUTTON,
@@ -548,13 +548,13 @@ TEST_F(DragControllerTest, TargetWindowClosedResetsCursor) {
DispatchDrag(window2.get(), false, ui::EF_LEFT_MOUSE_BUTTON,
gfx::Point(1, 1));
window2->Respond(true);
- EXPECT_EQ(ui::mojom::Cursor::COPY, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::COPY, cursor());
// Force the destruction of |window.window|.
window2.reset();
// The cursor no loner indicates that it can drop on |window2|.
- EXPECT_EQ(ui::mojom::Cursor::NO_DROP, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::NO_DROP, cursor());
}
TEST_F(DragControllerTest, SourceWindowClosedWhileDrag) {
@@ -640,20 +640,20 @@ TEST_F(DragControllerTest, RejectingWindowHasProperCursor) {
std::unique_ptr<DragTestWindow> window = BuildWindow();
StartDragOperation(window.get(), ui::mojom::kDropEffectMove);
- EXPECT_EQ(ui::mojom::Cursor::NO_DROP, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::NO_DROP, cursor());
DispatchDrag(window.get(), false, ui::EF_LEFT_MOUSE_BUTTON, gfx::Point(1, 1));
EXPECT_EQ(QueuedType::ENTER, window->queue_response_type());
window->Respond(true);
- EXPECT_EQ(ui::mojom::Cursor::COPY, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::COPY, cursor());
DispatchDrag(window.get(), false, ui::EF_LEFT_MOUSE_BUTTON, gfx::Point(2, 2));
EXPECT_EQ(QueuedType::OVER, window->queue_response_type());
// At this point, we respond with no available drag actions at this pixel.
window->Respond(false);
- EXPECT_EQ(ui::mojom::Cursor::NO_DROP, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::NO_DROP, cursor());
}
TEST_F(DragControllerTest, ResopnseFromOtherWindowDoesntChangeCursor) {
@@ -668,7 +668,7 @@ TEST_F(DragControllerTest, ResopnseFromOtherWindowDoesntChangeCursor) {
DispatchDrag(window2.get(), false, ui::EF_LEFT_MOUSE_BUTTON,
gfx::Point(1, 1));
- EXPECT_EQ(ui::mojom::Cursor::NO_DROP, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::NO_DROP, cursor());
// Now enter |window1|, and respond.
DispatchDrag(window1.get(), false, ui::EF_LEFT_MOUSE_BUTTON,
@@ -676,13 +676,13 @@ TEST_F(DragControllerTest, ResopnseFromOtherWindowDoesntChangeCursor) {
EXPECT_EQ(QueuedType::ENTER, window1->queue_response_type());
window1->Respond(true);
- EXPECT_EQ(ui::mojom::Cursor::COPY, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::COPY, cursor());
// Window 2 responding negatively to its queued messages shouldn't change the
// cursor.
window2->Respond(false);
- EXPECT_EQ(ui::mojom::Cursor::COPY, cursor());
+ EXPECT_EQ(ui::mojom::CursorType::COPY, cursor());
}
} // namespace ws
« no previous file with comments | « services/ui/ws/drag_controller.cc ('k') | services/ui/ws/event_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698