summaryrefslogtreecommitdiffstats
path: root/ui/views/touchui/touch_selection_controller_impl_unittest.cc
diff options
context:
space:
mode:
authorrsleevi <rsleevi@chromium.org>2014-12-08 13:53:27 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-08 21:54:29 +0000
commit6b150518257d898af57991939f9481bc3e95b5e7 (patch)
tree5ba251ef3a87bdd2b90b4a13c0c8e1b7a1733ada /ui/views/touchui/touch_selection_controller_impl_unittest.cc
parent629d7c940346b6e707f35d55f7a50e99a650e5c0 (diff)
downloadchromium_src-6b150518257d898af57991939f9481bc3e95b5e7.zip
chromium_src-6b150518257d898af57991939f9481bc3e95b5e7.tar.gz
chromium_src-6b150518257d898af57991939f9481bc3e95b5e7.tar.bz2
Revert of Move TouchSelectionController from content to ui (patchset #12 id:600001 of https://codereview.chromium.org/759433002/)
Reason for revert: Suspected of causing Win8 GN failure http://build.chromium.org/p/chromium.win/builders/Win8%20GN/builds/1552/steps/compile/logs/stdio#error1 FAILED: ninja -t msvc -e environment.x86 -- "C:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/ui/base/dragdrop/ui_base_unittests.os_exchange_data_provider_aurax11_unittest.obj.rsp /c ../../ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc /Foobj/ui/base/dragdrop/ui_base_unittests.os_exchange_data_provider_aurax11_unittest.obj /Fdobj/ui/base/ui_base_unittests_cc.pdb c:\b\build\slave\win8_gn\build\src\ui\base\dragdrop\os_exchange_data_provider_aurax11.h(8) : fatalerror C1083: Cannot open include file: 'X11/Xlib.h': No such file or directory Original issue's description: > 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 > > Committed: https://crrev.com/29fd405ca491a6fcf0dde6277d92d44300cb2926 > Cr-Commit-Position: refs/heads/master@{#307336} TBR=jdduke@chromium.org,mfomitchev@chromium.org,sadrul@chromium.org,boliu@chromium.org,jam@chromium.org,mohsen@chromium.org NOTREECHECKS=true NOTRY=true BUG=399721 Review URL: https://codereview.chromium.org/754963007 Cr-Commit-Position: refs/heads/master@{#307344}
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 8f9d8a6..5d0c693 100644
--- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc
+++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -46,13 +46,12 @@ 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;
- }
- if (b1 == b2)
+ else if (b1 == b2)
return 0;
- return 1;
+ else
+ return 1;
}
} // namespace
@@ -259,14 +258,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;
}
}
}
@@ -614,8 +613,9 @@ class TestTouchEditable : public ui::TouchEditable {
}
void set_cursor_rect(const gfx::Rect& cursor_rect) {
- cursor_bound_.SetEdge(cursor_rect.origin(), cursor_rect.bottom_left());
- cursor_bound_.set_type(ui::SelectionBound::Type::CENTER);
+ cursor_bound_.edge_top = cursor_rect.origin();
+ cursor_bound_.edge_bottom = cursor_rect.bottom_left();
+ cursor_bound_.type = ui::SelectionBound::Type::CENTER;
}
~TestTouchEditable() override {}