summaryrefslogtreecommitdiffstats
path: root/ui/views/touchui/touch_selection_controller_impl_unittest.cc
diff options
context:
space:
mode:
authormohsen <mohsen@chromium.org>2014-12-08 13:06:46 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-08 21:07:39 +0000
commit29fd405ca491a6fcf0dde6277d92d44300cb2926 (patch)
tree23c5800d7f015a9ed1c825f478c561119146db9a /ui/views/touchui/touch_selection_controller_impl_unittest.cc
parent57e80c70462acc1bea10385ee14c0bd31a3997bf (diff)
downloadchromium_src-29fd405ca491a6fcf0dde6277d92d44300cb2926.zip
chromium_src-29fd405ca491a6fcf0dde6277d92d44300cb2926.tar.gz
chromium_src-29fd405ca491a6fcf0dde6277d92d44300cb2926.tar.bz2
Move TouchSelectionController from content to ui
This patch is only moving new unified touch selection files from content/ to ui/touch_selection/. This is the first step to allow Aura use the new unified TouchSelectionController. The only change to TouchSelectionController needed for this move is replacing use of cc::ViewportSelectionBound with ui::SelectionBound. The actual use of the new touch selection for Aura will happen in future CL(s). After that, we can remove current touch selection code from ui/base/touch/. BUG=399721 Review URL: https://codereview.chromium.org/759433002 Cr-Commit-Position: refs/heads/master@{#307336}
Diffstat (limited to 'ui/views/touchui/touch_selection_controller_impl_unittest.cc')
-rw-r--r--ui/views/touchui/touch_selection_controller_impl_unittest.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
index 5d0c693..8f9d8a6 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 {}