summaryrefslogtreecommitdiffstats
path: root/ui/views/touchui/touch_selection_controller_impl_unittest.cc
diff options
context:
space:
mode:
authorDirk Pranke <dpranke@chromium.org>2014-09-17 16:09:37 -0700
committerDirk Pranke <dpranke@chromium.org>2014-09-17 23:09:53 +0000
commit7df86c9b0d0c7dccd3de837eb8b75fb77ee68232 (patch)
tree774798a316a3d8ed19d187df493714434c9d0f6c /ui/views/touchui/touch_selection_controller_impl_unittest.cc
parent5610afddb52fcc4e4d8ec52f567326044441bb7a (diff)
downloadchromium_src-7df86c9b0d0c7dccd3de837eb8b75fb77ee68232.zip
chromium_src-7df86c9b0d0c7dccd3de837eb8b75fb77ee68232.tar.gz
chromium_src-7df86c9b0d0c7dccd3de837eb8b75fb77ee68232.tar.bz2
Revert "Clean up GestureEventDetails constructors and fix unit tests."
This reverts commit b44589c531098bbe739ccc7066f41e17fc5b9287. > Clean up GestureEventDetails constructors and fix unit tests. > > A new version of Issue 565583005: Clean up GestureEventDetails > constructors > https://codereview.chromium.org/565583005/ > BUG=350942 > TBR=tdresser@chromium.org, jdduke@chromium.org, sadrul@chromium.org Patch set 9ec877c2d256a538b1c9af2fbed736aad8406e66 was reverted recently, but without that fix, this change doesn't work right (i.e., both patches needed to be reverted). TBR=dbeam@chromium.org, erg@chromium.org, lanwei@chromium.org BUG=350954 Review URL: https://codereview.chromium.org/576373002 Cr-Commit-Position: refs/heads/master@{#295370}
Diffstat (limited to 'ui/views/touchui/touch_selection_controller_impl_unittest.cc')
-rw-r--r--ui/views/touchui/touch_selection_controller_impl_unittest.cc40
1 files changed, 25 insertions, 15 deletions
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
index b268d2c..acd62ff 100644
--- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc
+++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -252,9 +252,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectionInTextfieldTest) {
CreateTextfield();
textfield_->SetText(ASCIIToUTF16("some text"));
// Tap the textfield to invoke touch selection.
- ui::GestureEventDetails details(ui::ET_GESTURE_TAP);
- details.set_tap_count(1);
- ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details);
+ ui::GestureEvent tap(0,
+ 0,
+ 0,
+ base::TimeDelta(),
+ ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f));
textfield_->OnGestureEvent(&tap);
// Test selecting a range.
@@ -285,9 +287,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectionInBidiTextfieldTest) {
CreateTextfield();
textfield_->SetText(WideToUTF16(L"abc\x05d0\x05d1\x05d2"));
// Tap the textfield to invoke touch selection.
- ui::GestureEventDetails details(ui::ET_GESTURE_TAP);
- details.set_tap_count(1);
- ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details);
+ ui::GestureEvent tap(0,
+ 0,
+ 0,
+ base::TimeDelta(),
+ ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f));
textfield_->OnGestureEvent(&tap);
// Test cursor at run boundary and with empty selection.
@@ -334,9 +338,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectRectCallbackTest) {
CreateTextfield();
textfield_->SetText(ASCIIToUTF16("textfield with selected text"));
// Tap the textfield to invoke touch selection.
- ui::GestureEventDetails details(ui::ET_GESTURE_TAP);
- details.set_tap_count(1);
- ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details);
+ ui::GestureEvent tap(0,
+ 0,
+ 0,
+ base::TimeDelta(),
+ ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f));
textfield_->OnGestureEvent(&tap);
textfield_->SelectRange(gfx::Range(3, 7));
@@ -373,9 +379,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectRectInBidiCallbackTest) {
CreateTextfield();
textfield_->SetText(WideToUTF16(L"abc\x05e1\x05e2\x05e3" L"def"));
// Tap the textfield to invoke touch selection.
- ui::GestureEventDetails details(ui::ET_GESTURE_TAP);
- details.set_tap_count(1);
- ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details);
+ ui::GestureEvent tap(0,
+ 0,
+ 0,
+ base::TimeDelta(),
+ ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f));
textfield_->OnGestureEvent(&tap);
// Select [c] from left to right.
@@ -503,9 +511,11 @@ TEST_F(TouchSelectionControllerImplTest,
textfield_->SetText(ASCIIToUTF16(textfield_text));
// Tap the textfield to invoke selection.
- ui::GestureEventDetails details(ui::ET_GESTURE_TAP);
- details.set_tap_count(1);
- ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details);
+ ui::GestureEvent tap(0,
+ 0,
+ 0,
+ base::TimeDelta(),
+ ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f));
textfield_->OnGestureEvent(&tap);
// Select some text such that one handle is hidden.