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

Unified Diff: ui/views/touchui/touch_selection_controller_impl_unittest.cc

Issue 759433002: Reland: Move TouchSelectionController from content to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Excluded ui/touch_selection from Windows GN build Created 6 years 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 | « ui/views/touchui/touch_selection_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/touchui/touch_selection_controller_impl_unittest.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
index 5d0c6934d2cb0aff4064300e338abb18032c2515..8f9d8a674eca1f470acfac62de693020e0a7b056 100644
--- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc
+++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -46,12 +46,13 @@ const int kMenuCommandCount = 3;
// the same location.
int CompareTextSelectionBounds(const ui::SelectionBound& b1,
const ui::SelectionBound& b2) {
- if ((b1.edge_top.y() < b2.edge_top.y()) || b1.edge_top.x() < b2.edge_top.x())
+ if (b1.edge_top().y() < b2.edge_top().y() ||
+ b1.edge_top().x() < b2.edge_top().x()) {
return -1;
- else if (b1 == b2)
+ }
+ if (b1 == b2)
return 0;
- else
- return 1;
+ return 1;
}
} // namespace
@@ -258,14 +259,14 @@ class TouchSelectionControllerImplTest : public ViewsTestBase {
}
if (check_direction) {
if (CompareTextSelectionBounds(anchor, focus) < 0) {
- EXPECT_EQ(ui::SelectionBound::LEFT, anchor.type) << from_str;
- EXPECT_EQ(ui::SelectionBound::RIGHT, focus.type) << from_str;
+ EXPECT_EQ(ui::SelectionBound::LEFT, anchor.type()) << from_str;
+ EXPECT_EQ(ui::SelectionBound::RIGHT, focus.type()) << from_str;
} else if (CompareTextSelectionBounds(anchor, focus) > 0) {
- EXPECT_EQ(ui::SelectionBound::LEFT, focus.type) << from_str;
- EXPECT_EQ(ui::SelectionBound::RIGHT, anchor.type) << from_str;
+ EXPECT_EQ(ui::SelectionBound::LEFT, focus.type()) << from_str;
+ EXPECT_EQ(ui::SelectionBound::RIGHT, anchor.type()) << from_str;
} else {
- EXPECT_EQ(ui::SelectionBound::CENTER, focus.type) << from_str;
- EXPECT_EQ(ui::SelectionBound::CENTER, anchor.type) << from_str;
+ EXPECT_EQ(ui::SelectionBound::CENTER, focus.type()) << from_str;
+ EXPECT_EQ(ui::SelectionBound::CENTER, anchor.type()) << from_str;
}
}
}
@@ -613,9 +614,8 @@ class TestTouchEditable : public ui::TouchEditable {
}
void set_cursor_rect(const gfx::Rect& cursor_rect) {
- cursor_bound_.edge_top = cursor_rect.origin();
- cursor_bound_.edge_bottom = cursor_rect.bottom_left();
- cursor_bound_.type = ui::SelectionBound::Type::CENTER;
+ cursor_bound_.SetEdge(cursor_rect.origin(), cursor_rect.bottom_left());
+ cursor_bound_.set_type(ui::SelectionBound::Type::CENTER);
}
~TestTouchEditable() override {}
« no previous file with comments | « ui/views/touchui/touch_selection_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698