Index: ui/aura/gestures/gesture_recognizer_unittest.cc |
=================================================================== |
--- ui/aura/gestures/gesture_recognizer_unittest.cc (revision 150582) |
+++ ui/aura/gestures/gesture_recognizer_unittest.cc (working copy) |
@@ -6,12 +6,12 @@ |
#include "base/string_number_conversions.h" |
#include "base/timer.h" |
#include "testing/gtest/include/gtest/gtest.h" |
-#include "ui/aura/event.h" |
#include "ui/aura/root_window.h" |
#include "ui/aura/test/aura_test_base.h" |
#include "ui/aura/test/event_generator.h" |
#include "ui/aura/test/test_window_delegate.h" |
#include "ui/aura/test/test_windows.h" |
+#include "ui/base/event.h" |
#include "ui/base/gestures/gesture_configuration.h" |
#include "ui/base/gestures/gesture_recognizer_impl.h" |
#include "ui/base/gestures/gesture_sequence.h" |
@@ -114,7 +114,8 @@ |
const gfx::Rect& bounding_box() const { return bounding_box_; } |
int tap_count() const { return tap_count_; } |
- virtual ui::GestureStatus OnGestureEvent(GestureEvent* gesture) OVERRIDE { |
+ virtual ui::GestureStatus OnGestureEvent( |
+ ui::GestureEventImpl* gesture) OVERRIDE { |
bounding_box_ = gesture->details().bounding_box(); |
switch (gesture->type()) { |
case ui::ET_GESTURE_TAP: |
@@ -213,7 +214,7 @@ |
} |
virtual ~QueueTouchEventDelegate() {} |
- virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) OVERRIDE { |
+ virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* event) OVERRIDE { |
return event->type() == ui::ET_TOUCH_RELEASED ? |
ui::TOUCH_STATUS_QUEUED_END : ui::TOUCH_STATUS_QUEUED; |
} |
@@ -264,7 +265,7 @@ |
bool mouse_release() const { return mouse_release_; } |
bool double_click() const { return double_click_; } |
- virtual bool OnMouseEvent(MouseEvent* event) OVERRIDE { |
+ virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE { |
switch (event->type()) { |
case ui::ET_MOUSE_PRESSED: |
double_click_ = event->flags() & ui::EF_IS_DOUBLE_CLICK; |
@@ -375,8 +376,8 @@ |
x += dx; |
y += dy; |
time = time + base::TimeDelta::FromMilliseconds(time_step); |
- TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), |
- touch_id, time); |
+ ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), |
+ touch_id, time); |
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); |
} |
} |
@@ -387,8 +388,8 @@ |
int touch_id, |
GestureEventConsumeDelegate* delegate) { |
delegate->Reset(); |
- TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), |
- touch_id, GetTime()); |
+ ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(x, y), |
+ touch_id, GetTime()); |
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); |
} |
@@ -408,8 +409,8 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -423,9 +424,9 @@ |
// Make sure there is enough delay before the touch is released so that it is |
// recognized as a tap. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_TRUE(delegate->tap()); |
@@ -455,8 +456,8 @@ |
// Test with no ET_TOUCH_MOVED events. |
{ |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
press.set_radius_x(5); |
press.set_radius_y(12); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
@@ -472,9 +473,9 @@ |
// Make sure there is enough delay before the touch is released so that it |
// is recognized as a tap. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
release.set_radius_x(5); |
release.set_radius_y(12); |
@@ -499,8 +500,8 @@ |
// Test with no ET_TOUCH_MOVED events but different touch points and radii. |
{ |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(365, 290), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(365, 290), |
+ kTouchId, GetTime()); |
press.set_radius_x(8); |
press.set_radius_y(14); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
@@ -514,9 +515,9 @@ |
EXPECT_FALSE(delegate->long_press()); |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(377, 291), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(377, 291), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
release.set_radius_x(20); |
release.set_radius_y(13); |
@@ -541,8 +542,8 @@ |
// Test with a single ET_TOUCH_MOVED event. |
{ |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(46, 205), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(46, 205), |
+ kTouchId, GetTime()); |
press.set_radius_x(6); |
press.set_radius_y(10); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
@@ -556,9 +557,9 @@ |
EXPECT_FALSE(delegate->long_press()); |
delegate->Reset(); |
- TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(52, 200), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(52, 200), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
move.set_radius_x(8); |
move.set_radius_y(12); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); |
@@ -572,9 +573,9 @@ |
EXPECT_FALSE(delegate->long_press()); |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(50, 195), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(50, 195), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
release.set_radius_x(4); |
release.set_radius_y(8); |
@@ -599,8 +600,8 @@ |
// Test with a few ET_TOUCH_MOVED events. |
{ |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(400, 150), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(400, 150), |
+ kTouchId, GetTime()); |
press.set_radius_x(7); |
press.set_radius_y(10); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
@@ -614,9 +615,9 @@ |
EXPECT_FALSE(delegate->long_press()); |
delegate->Reset(); |
- TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(397, 155), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(397, 155), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
move.set_radius_x(13); |
move.set_radius_y(12); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); |
@@ -630,9 +631,9 @@ |
EXPECT_FALSE(delegate->long_press()); |
delegate->Reset(); |
- TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(395, 148), |
- kTouchId, move.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl move1(ui::ET_TOUCH_MOVED, gfx::Point(395, 148), |
+ kTouchId, move.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
move1.set_radius_x(16); |
move1.set_radius_y(16); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); |
@@ -646,9 +647,9 @@ |
EXPECT_FALSE(delegate->long_press()); |
delegate->Reset(); |
- TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(400, 150), |
- kTouchId, move1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(400, 150), |
+ kTouchId, move1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
move2.set_radius_x(14); |
move2.set_radius_y(10); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); |
@@ -662,9 +663,9 @@ |
EXPECT_FALSE(delegate->long_press()); |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(401, 149), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(401, 149), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
release.set_radius_x(8); |
release.set_radius_y(9); |
@@ -699,8 +700,8 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -758,9 +759,9 @@ |
// Release the touch. This should end the scroll. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -789,8 +790,10 @@ |
const int kPositionX = 101; |
const int kPositionY = 201; |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(kPositionX, kPositionY), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, |
+ gfx::Point(kPositionX, kPositionY), |
+ kTouchId, |
+ GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
EXPECT_EQ(gfx::Rect(kPositionX - radius, |
kPositionY - radius, |
@@ -811,10 +814,10 @@ |
// Release the touch. This should end the scroll. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, |
- gfx::Point(kPositionX, kPositionY), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, |
+ gfx::Point(kPositionX, kPositionY), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_EQ(gfx::Rect(kPositionX - radius, |
kPositionY - radius, |
@@ -835,8 +838,8 @@ |
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
delegate.get(), -1234, bounds, NULL)); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
// Move the touch-point horizontally enough that it is considered a |
@@ -852,8 +855,8 @@ |
delegate.get()); |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_TRUE(delegate->scroll_end()); |
@@ -871,8 +874,8 @@ |
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
delegate.get(), -1234, bounds, NULL)); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
// Move the touch-point vertically enough that it is considered a |
@@ -888,8 +891,8 @@ |
delegate.get()); |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_TRUE(delegate->scroll_end()); |
@@ -907,8 +910,8 @@ |
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
delegate.get(), -1234, bounds, NULL)); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
// Move the touch-point such that a non-rail scroll begins |
@@ -922,8 +925,8 @@ |
delegate.get()); |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_TRUE(delegate->scroll_end()); |
@@ -952,8 +955,8 @@ |
root_window()->SetGestureRecognizerForTesting(gesture_recognizer); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
EXPECT_TRUE(delegate->tap_down()); |
EXPECT_TRUE(delegate->begin()); |
@@ -967,8 +970,8 @@ |
EXPECT_EQ(0, delegate->touch_id()); |
delegate->Reset(); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
EXPECT_FALSE(delegate->long_press()); |
} |
@@ -994,8 +997,8 @@ |
root_window()->SetGestureRecognizerForTesting(gesture_recognizer); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -1009,8 +1012,8 @@ |
EXPECT_FALSE(delegate->long_press()); |
delegate->Reset(); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
EXPECT_FALSE(delegate->long_press()); |
} |
@@ -1036,8 +1039,8 @@ |
root_window()->SetGestureRecognizerForTesting(gesture_recognizer); |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
EXPECT_TRUE(delegate->tap_down()); |
EXPECT_TRUE(delegate->begin()); |
@@ -1047,8 +1050,8 @@ |
// Second tap, to cancel the long press |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap. |
EXPECT_TRUE(delegate->begin()); |
@@ -1060,8 +1063,8 @@ |
EXPECT_FALSE(delegate->long_press()); |
delegate->Reset(); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
EXPECT_FALSE(delegate->long_press()); |
EXPECT_TRUE(delegate->two_finger_tap()); |
@@ -1077,8 +1080,8 @@ |
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
delegate.get(), -1234, bounds, NULL)); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
// Move the touch-point horizontally enough that it is considered a |
@@ -1119,8 +1122,8 @@ |
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
delegate.get(), -1234, bounds, NULL)); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
// Move the touch-point vertically enough that it is considered a |
@@ -1163,8 +1166,8 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -1176,9 +1179,9 @@ |
// Make sure there is enough delay before the touch is released so that it is |
// recognized as a tap. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_TRUE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1190,8 +1193,8 @@ |
// Now, do a scroll gesture. Delay it sufficiently so that it doesn't trigger |
// a double-tap. |
delegate->Reset(); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, release.time_stamp() + |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, release.time_stamp() + |
base::TimeDelta::FromMilliseconds(1000)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
EXPECT_FALSE(delegate->tap()); |
@@ -1206,8 +1209,8 @@ |
// The first movement is diagonal, to ensure that we have a free scroll, |
// and not a rail scroll. |
delegate->Reset(); |
- TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(130, 230), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(130, 230), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1220,8 +1223,8 @@ |
// Move some more to generate a few more scroll updates. |
delegate->Reset(); |
- TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(110, 211), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl move1(ui::ET_TOUCH_MOVED, gfx::Point(110, 211), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1233,8 +1236,8 @@ |
EXPECT_EQ(-19, delegate->scroll_y()); |
delegate->Reset(); |
- TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(140, 215), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(140, 215), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1247,8 +1250,8 @@ |
// Release the touch. This should end the scroll. |
delegate->Reset(); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1273,8 +1276,8 @@ |
// Touch down on the window. This should not generate any gesture event. |
queued_delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
EXPECT_FALSE(queued_delegate->tap()); |
EXPECT_FALSE(queued_delegate->tap_down()); |
@@ -1287,9 +1290,9 @@ |
// Introduce some delay before the touch is released so that it is recognized |
// as a tap. However, this still should not create any gesture events. |
queued_delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId1, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId1, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_FALSE(queued_delegate->tap()); |
EXPECT_FALSE(queued_delegate->tap_down()); |
@@ -1307,8 +1310,8 @@ |
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
delegate.get(), -2345, gfx::Rect(0, 0, 50, 50), NULL)); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 20), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 20), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -1319,8 +1322,8 @@ |
EXPECT_FALSE(delegate->scroll_update()); |
EXPECT_FALSE(delegate->scroll_end()); |
- TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); |
// Process the first queued event. |
@@ -1350,8 +1353,8 @@ |
// Start all over. Press on the first window, then press again on the second |
// window. The second press should still go to the first window. |
queued_delegate->Reset(); |
- TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press3(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press3); |
EXPECT_FALSE(queued_delegate->tap()); |
EXPECT_FALSE(queued_delegate->tap_down()); |
@@ -1366,8 +1369,8 @@ |
queued_delegate->Reset(); |
delegate->Reset(); |
- TouchEvent press4(ui::ET_TOUCH_PRESSED, gfx::Point(103, 203), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press4(ui::ET_TOUCH_PRESSED, gfx::Point(103, 203), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press4); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1391,8 +1394,8 @@ |
queued_delegate->Reset(); |
delegate->Reset(); |
int x_move = ui::GestureConfiguration::max_touch_move_in_pixels_for_click(); |
- TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(103 + x_move, 203), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(103 + x_move, 203), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1464,8 +1467,8 @@ |
aura::RootWindow* root = root_window(); |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -1477,8 +1480,8 @@ |
// Move the touch-point enough so that it is considered as a scroll. This |
// should generate both SCROLL_BEGIN and SCROLL_UPDATE gestures. |
delegate->Reset(); |
- TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(130, 301), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(130, 301), |
+ kTouchId1, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1490,8 +1493,8 @@ |
// Press the second finger. It should cause pinch-begin. Note that we will not |
// transition to two finger tap here because the touch points are far enough. |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
+ kTouchId2, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap. |
@@ -1505,8 +1508,8 @@ |
// Move the first finger. |
delegate->Reset(); |
- TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(95, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl move3(ui::ET_TOUCH_MOVED, gfx::Point(95, 201), |
+ kTouchId1, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move3); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1521,8 +1524,8 @@ |
// Now move the second finger. |
delegate->Reset(); |
- TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), |
+ kTouchId2, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1537,9 +1540,9 @@ |
// Release the first finger. This should end pinch. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId1, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId1, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1553,8 +1556,8 @@ |
// Move the second finger. This should still generate a scroll. |
delegate->Reset(); |
- TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), |
+ kTouchId2, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move5); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1578,12 +1581,12 @@ |
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
delegate.get(), -1234, bounds, NULL)); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
// Since the touch points are far enough we will go to pinch rather than two |
// finger tap. |
@@ -1594,8 +1597,8 @@ |
// Pinch has started, now release the second finger |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_TRUE(delegate->pinch_end()); |
@@ -1604,13 +1607,13 @@ |
// Pinch again |
delegate->Reset(); |
- TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press3(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press3); |
// Now the touch points are close. So we will go into two finger tap. |
// Move the touch-point enough to break two-finger-tap and enter pinch. |
- TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 202), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 202), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); |
EXPECT_TRUE(delegate->pinch_begin()); |
@@ -1632,8 +1635,8 @@ |
aura::RootWindow* root = root_window(); |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), |
+ kTouchId1, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -1646,8 +1649,8 @@ |
// Press the second finger far enough to break two finger tap. It should |
// instead cause a scroll-begin and pinch-begin. |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
+ kTouchId2, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap. |
@@ -1661,8 +1664,8 @@ |
// Move the first finger. |
delegate->Reset(); |
- TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(65, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl move3(ui::ET_TOUCH_MOVED, gfx::Point(65, 201), |
+ kTouchId1, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move3); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1677,8 +1680,8 @@ |
// Now move the second finger. |
delegate->Reset(); |
- TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15), |
+ kTouchId2, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1693,9 +1696,9 @@ |
// Release the first finger. This should end pinch. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId1, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId1, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1709,8 +1712,8 @@ |
// Move the second finger. This should still generate a scroll. |
delegate->Reset(); |
- TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10), |
+ kTouchId2, GetTime()); |
root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move5); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1727,8 +1730,8 @@ |
scoped_ptr<GestureEventConsumeDelegate> delegate( |
new GestureEventConsumeDelegate()); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- 6, GetTime()); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ 6, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1765,8 +1768,8 @@ |
windows[i] = CreateTestWindowWithDelegate( |
delegates[i], i, *window_bounds[i], NULL); |
windows[i]->set_id(i); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, window_bounds[i]->origin(), |
- i, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, window_bounds[i]->origin(), |
+ i, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
} |
@@ -1782,11 +1785,11 @@ |
EXPECT_EQ("3", WindowIDAsString(target)); |
// Add a touch in the middle associated with windows[2] |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 500), |
- kNumWindows, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 500), |
+ kNumWindows, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
- TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(250, 250), |
- kNumWindows, GetTime()); |
+ ui::TouchEventImpl move(ui::ET_TOUCH_MOVED, gfx::Point(250, 250), |
+ kNumWindows, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move); |
target = gesture_recognizer->GetTargetForLocation(gfx::Point(250, 250)); |
@@ -1806,8 +1809,8 @@ |
EXPECT_TRUE(target == NULL); |
// Move a touch associated with windows[2] to 1000, 1000 |
- TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(1000, 1000), |
- kNumWindows, GetTime()); |
+ ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(1000, 1000), |
+ kNumWindows, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); |
target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000)); |
@@ -1831,11 +1834,11 @@ |
gesture_recognizer->GetGestureSequenceForTesting(root_window()); |
gfx::Point pos1(-10, -10); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, pos1, 0, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, pos1, 0, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
gfx::Point pos2(1000, 1000); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, pos2, 1, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, pos2, 1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
// As these presses were outside the root window, they should be |
@@ -1854,12 +1857,12 @@ |
delegate->set_window(window.get()); |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
delegate->Reset(); |
@@ -1907,8 +1910,8 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -1920,8 +1923,8 @@ |
EXPECT_FALSE(delegate->two_finger_tap()); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap. |
@@ -1934,11 +1937,11 @@ |
// Little bit of touch move should not affect our state. |
delegate->Reset(); |
- TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(102, 202), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl move1(ui::ET_TOUCH_MOVED, gfx::Point(102, 202), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); |
- TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(131, 202), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(131, 202), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -1952,9 +1955,9 @@ |
// Make sure there is enough delay before the touch is released so that it is |
// recognized as a tap. |
delegate->Reset(); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId1, press1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId1, press1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
EXPECT_FALSE(delegate->tap()); |
@@ -1969,9 +1972,9 @@ |
// Make sure there is enough delay before the touch is released so that it is |
// recognized as a tap. |
delegate->Reset(); |
- TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), |
- kTouchId2, press2.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), |
+ kTouchId2, press2.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); |
EXPECT_FALSE(delegate->tap()); |
@@ -1995,20 +1998,20 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
// Send release event after sufficient delay so that two finger time expires. |
delegate->Reset(); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId1, press1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(1000)); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId1, press1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(1000)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
EXPECT_FALSE(delegate->two_finger_tap()); |
@@ -2017,9 +2020,9 @@ |
// Make sure there is enough delay before the touch is released so that it is |
// recognized as a tap. |
delegate->Reset(); |
- TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), |
- kTouchId2, press2.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201), |
+ kTouchId2, press2.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); |
EXPECT_FALSE(delegate->two_finger_tap()); |
@@ -2040,13 +2043,13 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
SendScrollEvent(root_window(), 130, 230, kTouchId1, delegate.get()); |
@@ -2056,9 +2059,9 @@ |
// Make sure there is enough delay before the touch is released so that it |
// is recognized as a tap. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId2, press1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId2, press1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_FALSE(delegate->two_finger_tap()); |
@@ -2072,13 +2075,13 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
SendScrollEvent(root_window(), 101, 230, kTouchId2, delegate.get()); |
@@ -2088,9 +2091,9 @@ |
// Make sure there is enough delay before the touch is released so that it |
// is recognized as a tap. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId1, press1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId1, press1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_FALSE(delegate->two_finger_tap()); |
@@ -2113,27 +2116,27 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
delegate->Reset(); |
- TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&cancel); |
EXPECT_FALSE(delegate->two_finger_tap()); |
// Make sure there is enough delay before the touch is released so that it |
// is recognized as a tap. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId2, press1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId2, press1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_FALSE(delegate->two_finger_tap()); |
@@ -2146,27 +2149,27 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
delegate->Reset(); |
- TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&cancel); |
EXPECT_FALSE(delegate->two_finger_tap()); |
// Make sure there is enough delay before the touch is released so that it |
// is recognized as a tap. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId1, press1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId1, press1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_FALSE(delegate->two_finger_tap()); |
@@ -2185,8 +2188,8 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -2198,8 +2201,8 @@ |
EXPECT_FALSE(delegate->two_finger_tap()); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(430, 201), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(430, 201), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap. |
@@ -2222,11 +2225,11 @@ |
CreateTestWindowWithDelegate(delegate.get(), 0, bounds, NULL)); |
const int kTouchId1 = 8; |
const int kTouchId2 = 2; |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
- kTouchId1, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), |
+ kTouchId1, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), |
- kTouchId2, GetTime()); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), |
+ kTouchId2, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
window->Hide(); |
EXPECT_EQ(NULL, |
@@ -2253,8 +2256,8 @@ |
root_window()->SetGestureRecognizerForTesting(gesture_recognizer); |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
// Scroll around, to cancel the long press |
SendScrollEvent(root_window(), 130, 230, kTouchId, delegate.get()); |
@@ -2280,7 +2283,7 @@ |
void set_consume_touch_move(bool consume) { consume_touch_move_ = consume; } |
private: |
- virtual ui::TouchStatus OnTouchEvent(TouchEvent* touch) OVERRIDE { |
+ virtual ui::TouchStatus OnTouchEvent(ui::TouchEventImpl* touch) OVERRIDE { |
if (consume_touch_move_ && touch->type() == ui::ET_TOUCH_MOVED) |
return ui::TOUCH_STATUS_CONTINUE; |
return GestureEventConsumeDelegate::OnTouchEvent(touch); |
@@ -2304,8 +2307,8 @@ |
delegate.get(), -1234, bounds, NULL)); |
delegate->Reset(); |
- TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_TRUE(delegate->tap_down()); |
@@ -2372,9 +2375,9 @@ |
// Release the touch. This should end the scroll. |
delegate->Reset(); |
- TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, press.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, press.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release); |
EXPECT_FALSE(delegate->tap()); |
EXPECT_FALSE(delegate->tap_down()); |
@@ -2398,23 +2401,23 @@ |
delegate.get(), -1234, bounds, NULL)); |
// First tap (tested in GestureEventTap) |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(104, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(104, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(104, 201), |
- kTouchId, press1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(104, 201), |
+ kTouchId, press1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
delegate->Reset(); |
// Second tap |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 203), |
- kTouchId, release1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(200)); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 203), |
+ kTouchId, release1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(200)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
- TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206), |
- kTouchId, press2.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206), |
+ kTouchId, press2.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); |
EXPECT_TRUE(delegate->tap()); |
@@ -2441,23 +2444,23 @@ |
delegate.get(), -1234, bounds, NULL)); |
// First tap (tested in GestureEventTap) |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, press1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, press1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
delegate->Reset(); |
// Second tap, close in time but far in distance |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), |
- kTouchId, release1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(200)); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), |
+ kTouchId, release1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(200)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
- TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(201, 201), |
- kTouchId, press2.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(201, 201), |
+ kTouchId, press2.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); |
EXPECT_TRUE(delegate->tap()); |
@@ -2485,23 +2488,23 @@ |
delegate.get(), -1234, bounds, NULL)); |
// First tap (tested in GestureEventTap) |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, GetTime()); |
+ ui::TouchEventImpl press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
- TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, press1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, press1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1); |
delegate->Reset(); |
// Second tap, close in distance but after some delay |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
- kTouchId, release1.time_stamp() + |
- base::TimeDelta::FromMilliseconds(2000)); |
+ ui::TouchEventImpl press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), |
+ kTouchId, release1.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(2000)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
- TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
- kTouchId, press2.time_stamp() + |
- base::TimeDelta::FromMilliseconds(50)); |
+ ui::TouchEventImpl release2(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), |
+ kTouchId, press2.time_stamp() + |
+ base::TimeDelta::FromMilliseconds(50)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2); |
EXPECT_TRUE(delegate->tap()); |
@@ -2529,14 +2532,15 @@ |
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
delegate.get(), -1234, bounds, NULL)); |
- TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, |
- GetTime()); |
+ ui::TouchEventImpl press1( |
+ ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, GetTime()); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1); |
EXPECT_TRUE(delegate->bounding_box().IsEmpty()); |
delegate->Reset(); |
- TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), kTouchId2, |
+ ui::TouchEventImpl press2( |
+ ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), kTouchId2, |
press1.time_stamp() + base::TimeDelta::FromMilliseconds(400)); |
press2.set_radius_x(5); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2); |
@@ -2544,7 +2548,7 @@ |
delegate->Reset(); |
- TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(141, 201), kTouchId, |
+ ui::TouchEventImpl move1(ui::ET_TOUCH_MOVED, gfx::Point(141, 201), kTouchId, |
press1.time_stamp() + base::TimeDelta::FromMilliseconds(40)); |
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1); |
EXPECT_TRUE(delegate->pinch_begin()); |
@@ -2554,7 +2558,7 @@ |
delegate->Reset(); |
// The position doesn't move, but the radius changes. |
- TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 201), kTouchId, |
+ ui::TouchEventImpl move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 201), kTouchId, |
press2.time_stamp() + base::TimeDelta::FromMilliseconds(40)); |
move2.set_radius_x(50); |
move2.set_radius_y(60); |