diff options
author | lanwei <lanwei@chromium.org> | 2014-09-13 22:24:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-14 05:27:38 +0000 |
commit | b5e408e7bffd3d1e6b60612f65c0538a90329c59 (patch) | |
tree | 9c4c45ed920c9c317d6c151e72c2a0bc581a8c53 /ui/views/touchui/touch_selection_controller_impl_unittest.cc | |
parent | 8dc42c4dbf738d543362385bb0e2e2170a0b5edc (diff) | |
download | chromium_src-b5e408e7bffd3d1e6b60612f65c0538a90329c59.zip chromium_src-b5e408e7bffd3d1e6b60612f65c0538a90329c59.tar.gz chromium_src-b5e408e7bffd3d1e6b60612f65c0538a90329c59.tar.bz2 |
Clean up GestureEventDetails' constructors.
In one of the GestureEventDetails' constructors, the arguments
delta_x, delta_y sometime are not used, so we should make a new
constructor which only takes one argument EventType.
BUG=350942
Review URL: https://codereview.chromium.org/565583005
Cr-Commit-Position: refs/heads/master@{#294760}
Diffstat (limited to 'ui/views/touchui/touch_selection_controller_impl_unittest.cc')
-rw-r--r-- | ui/views/touchui/touch_selection_controller_impl_unittest.cc | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc index acd62ff..b268d2c 100644 --- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc +++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc @@ -252,11 +252,9 @@ TEST_F(TouchSelectionControllerImplTest, SelectionInTextfieldTest) { CreateTextfield(); textfield_->SetText(ASCIIToUTF16("some text")); // Tap the textfield to invoke touch selection. - ui::GestureEvent tap(0, - 0, - 0, - base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); + ui::GestureEventDetails details(ui::ET_GESTURE_TAP); + details.set_tap_count(1); + ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); textfield_->OnGestureEvent(&tap); // Test selecting a range. @@ -287,11 +285,9 @@ TEST_F(TouchSelectionControllerImplTest, SelectionInBidiTextfieldTest) { CreateTextfield(); textfield_->SetText(WideToUTF16(L"abc\x05d0\x05d1\x05d2")); // Tap the textfield to invoke touch selection. - ui::GestureEvent tap(0, - 0, - 0, - base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); + ui::GestureEventDetails details(ui::ET_GESTURE_TAP); + details.set_tap_count(1); + ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); textfield_->OnGestureEvent(&tap); // Test cursor at run boundary and with empty selection. @@ -338,11 +334,9 @@ TEST_F(TouchSelectionControllerImplTest, SelectRectCallbackTest) { CreateTextfield(); textfield_->SetText(ASCIIToUTF16("textfield with selected text")); // Tap the textfield to invoke touch selection. - ui::GestureEvent tap(0, - 0, - 0, - base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); + ui::GestureEventDetails details(ui::ET_GESTURE_TAP); + details.set_tap_count(1); + ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); textfield_->OnGestureEvent(&tap); textfield_->SelectRange(gfx::Range(3, 7)); @@ -379,11 +373,9 @@ TEST_F(TouchSelectionControllerImplTest, SelectRectInBidiCallbackTest) { CreateTextfield(); textfield_->SetText(WideToUTF16(L"abc\x05e1\x05e2\x05e3" L"def")); // Tap the textfield to invoke touch selection. - ui::GestureEvent tap(0, - 0, - 0, - base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); + ui::GestureEventDetails details(ui::ET_GESTURE_TAP); + details.set_tap_count(1); + ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); textfield_->OnGestureEvent(&tap); // Select [c] from left to right. @@ -511,11 +503,9 @@ TEST_F(TouchSelectionControllerImplTest, textfield_->SetText(ASCIIToUTF16(textfield_text)); // Tap the textfield to invoke selection. - ui::GestureEvent tap(0, - 0, - 0, - base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); + ui::GestureEventDetails details(ui::ET_GESTURE_TAP); + details.set_tap_count(1); + ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); textfield_->OnGestureEvent(&tap); // Select some text such that one handle is hidden. |