Commit 1049876a authored by Kevin Schoedel's avatar Kevin Schoedel Committed by Commit Bot

Use raw screen coordinates for rewritten events.

Events at the RewriteEvent() interface are in raw screen coordinates,
but TouchExplorationController internally uses DIP coordinates.
Some rewritten events were incorrectly generated using DIP coordinates.

Bug: b/73383411
Test: manual
Change-Id: Ib126692e51aaf034a95cd9b50b599e4bd76cbcac
Reviewed-on: https://chromium-review.googlesource.com/1117469
Commit-Queue: Kevin Schoedel <kpschoedel@chromium.org>
Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571150}
parent 5d087fbb
...@@ -266,7 +266,7 @@ ui::EventRewriteStatus TouchExplorationController::RewriteEvent( ...@@ -266,7 +266,7 @@ ui::EventRewriteStatus TouchExplorationController::RewriteEvent(
status = InTwoFingerTap(touch_event_dip, rewritten_event); status = InTwoFingerTap(touch_event_dip, rewritten_event);
break; break;
case EDGE_PASSTHROUGH: case EDGE_PASSTHROUGH:
status = InEdgePassthrough(touch_event, rewritten_event); status = InEdgePassthrough(touch_event_dip, rewritten_event);
break; break;
} }
if (status == ui::EVENT_REWRITE_REWRITTEN) { if (status == ui::EVENT_REWRITE_REWRITTEN) {
...@@ -292,16 +292,6 @@ ui::EventRewriteStatus TouchExplorationController::InNoFingersDown( ...@@ -292,16 +292,6 @@ ui::EventRewriteStatus TouchExplorationController::InNoFingersDown(
return ui::EVENT_REWRITE_CONTINUE; return ui::EVENT_REWRITE_CONTINUE;
} }
// If the user enters the screen from the edge then send an earcon,
// and enter passthrough mode so that the system gesture handle can
// handle it.
int edge = FindEdgesWithinInset(event.location(), kLeavingScreenEdge);
if (edge != NO_EDGE) {
delegate_->PlayEnterScreenEarcon();
SET_STATE(EDGE_PASSTHROUGH);
return ui::EVENT_REWRITE_CONTINUE;
}
int location = FindEdgesWithinInset(event.location(), kSlopDistanceFromEdge); int location = FindEdgesWithinInset(event.location(), kSlopDistanceFromEdge);
// If the press was at a corner, the user might go into corner passthrough // If the press was at a corner, the user might go into corner passthrough
// instead. // instead.
...@@ -311,7 +301,18 @@ ui::EventRewriteStatus TouchExplorationController::InNoFingersDown( ...@@ -311,7 +301,18 @@ ui::EventRewriteStatus TouchExplorationController::InNoFingersDown(
passthrough_timer_.Start( passthrough_timer_.Start(
FROM_HERE, gesture_detector_config_.longpress_timeout, this, FROM_HERE, gesture_detector_config_.longpress_timeout, this,
&TouchExplorationController::OnPassthroughTimerFired); &TouchExplorationController::OnPassthroughTimerFired);
} else {
// If the user enters the screen from the edge then send an earcon,
// and enter passthrough mode so that the system gesture handle can
// handle it.
int edge = FindEdgesWithinInset(event.location(), kLeavingScreenEdge);
if (edge != NO_EDGE) {
delegate_->PlayEnterScreenEarcon();
SET_STATE(EDGE_PASSTHROUGH);
return ui::EVENT_REWRITE_CONTINUE;
}
} }
initial_press_ = std::make_unique<ui::TouchEvent>(event); initial_press_ = std::make_unique<ui::TouchEvent>(event);
most_recent_press_timestamp_ = initial_press_->time_stamp(); most_recent_press_timestamp_ = initial_press_->time_stamp();
initial_presses_[event.pointer_details().id] = event.location(); initial_presses_[event.pointer_details().id] = event.location();
...@@ -509,12 +510,9 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploration( ...@@ -509,12 +510,9 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploration(
} }
// Rewrite as a mouse-move event. // Rewrite as a mouse-move event.
gfx::Point location_dip = event.location();
// |event| locations are in DIP; see |RewriteEvent|. We need to dispatch // |event| locations are in DIP; see |RewriteEvent|. We need to dispatch
// |screen coords. // |screen coords.
root_window_->GetHost()->ConvertDIPToScreenInPixels(&location_dip); gfx::PointF location_f(ConvertDIPToScreenInPixels(event.location_f()));
gfx::PointF location_f(location_dip.x(), location_dip.y());
*rewritten_event = CreateMouseMoveEvent(location_f, event.flags()); *rewritten_event = CreateMouseMoveEvent(location_f, event.flags());
last_touch_exploration_ = std::make_unique<ui::TouchEvent>(event); last_touch_exploration_ = std::make_unique<ui::TouchEvent>(event);
if (anchor_point_state_ != ANCHOR_POINT_EXPLICITLY_SET) if (anchor_point_state_ != ANCHOR_POINT_EXPLICITLY_SET)
...@@ -543,7 +541,8 @@ ui::EventRewriteStatus TouchExplorationController::InCornerPassthrough( ...@@ -543,7 +541,8 @@ ui::EventRewriteStatus TouchExplorationController::InCornerPassthrough(
// If the first finger has left the corner, then exit passthrough. // If the first finger has left the corner, then exit passthrough.
if (event.pointer_details().id == initial_press_->pointer_details().id) { if (event.pointer_details().id == initial_press_->pointer_details().id) {
int edges = FindEdgesWithinInset(event.location(), kSlopDistanceFromEdge); int edges =
FindEdgesWithinInset(event.location(), kSlopDistanceFromEdge);
bool in_a_bottom_corner = bool in_a_bottom_corner =
(edges == BOTTOM_LEFT_CORNER) || (edges == BOTTOM_RIGHT_CORNER); (edges == BOTTOM_LEFT_CORNER) || (edges == BOTTOM_RIGHT_CORNER);
if (type == ui::ET_TOUCH_MOVED && in_a_bottom_corner) if (type == ui::ET_TOUCH_MOVED && in_a_bottom_corner)
...@@ -557,10 +556,13 @@ ui::EventRewriteStatus TouchExplorationController::InCornerPassthrough( ...@@ -557,10 +556,13 @@ ui::EventRewriteStatus TouchExplorationController::InCornerPassthrough(
return ui::EVENT_REWRITE_DISCARD; return ui::EVENT_REWRITE_DISCARD;
} }
// |event| locations are in DIP; see |RewriteEvent|. We need to dispatch
// screen coordinates.
gfx::PointF location_f(ConvertDIPToScreenInPixels(event.location_f()));
std::unique_ptr<ui::TouchEvent> new_event(new ui::TouchEvent( std::unique_ptr<ui::TouchEvent> new_event(new ui::TouchEvent(
type, gfx::Point(), event.time_stamp(), event.pointer_details())); type, gfx::Point(), event.time_stamp(), event.pointer_details()));
new_event->set_location_f(event.location_f()); new_event->set_location_f(location_f);
new_event->set_root_location_f(event.location_f()); new_event->set_root_location_f(location_f);
new_event->set_flags(event.flags()); new_event->set_flags(event.flags());
*rewritten_event = std::move(new_event); *rewritten_event = std::move(new_event);
...@@ -579,10 +581,14 @@ ui::EventRewriteStatus TouchExplorationController::InOneFingerPassthrough( ...@@ -579,10 +581,14 @@ ui::EventRewriteStatus TouchExplorationController::InOneFingerPassthrough(
} }
return ui::EVENT_REWRITE_DISCARD; return ui::EVENT_REWRITE_DISCARD;
} }
// |event| locations are in DIP; see |RewriteEvent|. We need to dispatch
// screen coordinates.
gfx::PointF location_f(ConvertDIPToScreenInPixels(event.location_f()) -
passthrough_offset_);
std::unique_ptr<ui::TouchEvent> new_event(new ui::TouchEvent( std::unique_ptr<ui::TouchEvent> new_event(new ui::TouchEvent(
event.type(), gfx::Point(), event.time_stamp(), event.pointer_details())); event.type(), gfx::Point(), event.time_stamp(), event.pointer_details()));
new_event->set_location_f(event.location_f() - passthrough_offset_); new_event->set_location_f(location_f);
new_event->set_root_location_f(event.location_f() - passthrough_offset_); new_event->set_root_location_f(location_f);
new_event->set_flags(event.flags()); new_event->set_flags(event.flags());
*rewritten_event = std::move(new_event); *rewritten_event = std::move(new_event);
if (current_touch_ids_.size() == 0) { if (current_touch_ids_.size() == 0) {
...@@ -604,8 +610,11 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploreSecondPress( ...@@ -604,8 +610,11 @@ ui::EventRewriteStatus TouchExplorationController::InTouchExploreSecondPress(
ui::ET_TOUCH_CANCELLED, gfx::Point(), event.time_stamp(), ui::ET_TOUCH_CANCELLED, gfx::Point(), event.time_stamp(),
initial_press_->pointer_details())); initial_press_->pointer_details()));
// TODO(dmazzoni): fix for multiple displays. http://crbug.com/616793 // TODO(dmazzoni): fix for multiple displays. http://crbug.com/616793
new_event->set_location_f(anchor_point_dip_); // |event| locations are in DIP; see |RewriteEvent|. We need to dispatch
new_event->set_root_location_f(anchor_point_dip_); // screen coordinates.
gfx::PointF location_f(ConvertDIPToScreenInPixels(anchor_point_dip_));
new_event->set_location_f(location_f);
new_event->set_root_location_f(location_f);
new_event->set_flags(event.flags()); new_event->set_flags(event.flags());
*rewritten_event = std::move(new_event); *rewritten_event = std::move(new_event);
SET_STATE(WAIT_FOR_NO_FINGERS); SET_STATE(WAIT_FOR_NO_FINGERS);
...@@ -678,22 +687,21 @@ void TouchExplorationController::SendSimulatedClickOrTap() { ...@@ -678,22 +687,21 @@ void TouchExplorationController::SendSimulatedClickOrTap() {
} }
void TouchExplorationController::SendSimulatedTap() { void TouchExplorationController::SendSimulatedTap() {
gfx::Point screen_point(anchor_point_dip_.x(), anchor_point_dip_.y()); gfx::PointF screen_point(ConvertDIPToScreenInPixels(anchor_point_dip_));
root_window_->GetHost()->ConvertDIPToScreenInPixels(&screen_point);
std::unique_ptr<ui::TouchEvent> touch_press; std::unique_ptr<ui::TouchEvent> touch_press;
touch_press.reset(new ui::TouchEvent(ui::ET_TOUCH_PRESSED, gfx::Point(), touch_press.reset(new ui::TouchEvent(ui::ET_TOUCH_PRESSED, gfx::Point(),
Now(), Now(),
initial_press_->pointer_details())); initial_press_->pointer_details()));
touch_press->set_location(screen_point); touch_press->set_location_f(screen_point);
touch_press->set_root_location(screen_point); touch_press->set_root_location_f(screen_point);
DispatchEvent(touch_press.get()); DispatchEvent(touch_press.get());
std::unique_ptr<ui::TouchEvent> touch_release; std::unique_ptr<ui::TouchEvent> touch_release;
touch_release.reset(new ui::TouchEvent(ui::ET_TOUCH_RELEASED, gfx::Point(), touch_release.reset(new ui::TouchEvent(ui::ET_TOUCH_RELEASED, gfx::Point(),
Now(), Now(),
initial_press_->pointer_details())); initial_press_->pointer_details()));
touch_release->set_location(screen_point); touch_release->set_location_f(screen_point);
touch_release->set_root_location(screen_point); touch_release->set_root_location_f(screen_point);
DispatchEvent(touch_release.get()); DispatchEvent(touch_release.get());
} }
...@@ -748,10 +756,13 @@ ui::EventRewriteStatus TouchExplorationController::InEdgePassthrough( ...@@ -748,10 +756,13 @@ ui::EventRewriteStatus TouchExplorationController::InEdgePassthrough(
if (current_touch_ids_.size() == 0) { if (current_touch_ids_.size() == 0) {
SET_STATE(NO_FINGERS_DOWN); SET_STATE(NO_FINGERS_DOWN);
} }
// |event| locations are in DIP; see |RewriteEvent|. We need to dispatch
// screen coordinates.
gfx::PointF location_f(ConvertDIPToScreenInPixels(event.location_f()));
std::unique_ptr<ui::TouchEvent> new_event(new ui::TouchEvent( std::unique_ptr<ui::TouchEvent> new_event(new ui::TouchEvent(
event.type(), gfx::Point(), event.time_stamp(), event.pointer_details())); event.type(), gfx::Point(), event.time_stamp(), event.pointer_details()));
new_event->set_location_f(event.location_f()); new_event->set_location_f(location_f);
new_event->set_root_location_f(event.location_f()); new_event->set_root_location_f(location_f);
new_event->set_flags(event.flags()); new_event->set_flags(event.flags());
*rewritten_event = std::move(new_event); *rewritten_event = std::move(new_event);
return ui::EVENT_REWRITE_REWRITTEN; return ui::EVENT_REWRITE_REWRITTEN;
...@@ -1168,5 +1179,12 @@ float TouchExplorationController::GetSplitTapTouchSlop() { ...@@ -1168,5 +1179,12 @@ float TouchExplorationController::GetSplitTapTouchSlop() {
return gesture_detector_config_.touch_slop * 3; return gesture_detector_config_.touch_slop * 3;
} }
gfx::PointF TouchExplorationController::ConvertDIPToScreenInPixels(
const gfx::PointF& location_f) {
gfx::Point location(gfx::ToFlooredPoint(location_f));
root_window_->GetHost()->ConvertDIPToScreenInPixels(&location);
return gfx::PointF(location);
}
} // namespace shell } // namespace shell
} // namespace chromecast } // namespace chromecast
...@@ -310,10 +310,10 @@ class TouchExplorationController : public ui::EventRewriter, ...@@ -310,10 +310,10 @@ class TouchExplorationController : public ui::EventRewriter,
// Within this many dips of the screen edge, the release event generated will // Within this many dips of the screen edge, the release event generated will
// reset the state to NoFingersDown. // reset the state to NoFingersDown.
const float kLeavingScreenEdge = 12; // TODO: Unify with identical value in CastSystemGestureEventHandler.
const float kLeavingScreenEdge = 35;
// Swipe/scroll gestures within these bounds (in DIPs) will change preset // Touch within this distance from a corner can invoke corner passthrough.
// settings.
const float kMaxDistanceFromEdge = 75; const float kMaxDistanceFromEdge = 75;
// After a slide gesture has been triggered, if the finger is still within // After a slide gesture has been triggered, if the finger is still within
...@@ -324,6 +324,9 @@ class TouchExplorationController : public ui::EventRewriter, ...@@ -324,6 +324,9 @@ class TouchExplorationController : public ui::EventRewriter,
// fingers in place is a bit harder. // fingers in place is a bit harder.
float GetSplitTapTouchSlop(); float GetSplitTapTouchSlop();
// Convert a gfx::PointF from DIP back to raw screen coordinates.
gfx::PointF ConvertDIPToScreenInPixels(const gfx::PointF& location);
enum State { enum State {
// No fingers are down and no events are pending. // No fingers are down and no events are pending.
NO_FINGERS_DOWN, NO_FINGERS_DOWN,
......
...@@ -529,13 +529,13 @@ TEST_F(TouchExplorationTest, ActualMouseMovesUnaffected) { ...@@ -529,13 +529,13 @@ TEST_F(TouchExplorationTest, ActualMouseMovesUnaffected) {
SwitchTouchExplorationMode(true); SwitchTouchExplorationMode(true);
gfx::Point location_start(111, 112); gfx::Point location_start(111, 112);
gfx::Point location_end(13, 14); gfx::Point location_end(213, 214);
generator_->set_current_location(location_start); generator_->set_current_location(location_start);
generator_->PressTouch(); generator_->PressTouch();
AdvanceSimulatedTimePastTapDelay(); AdvanceSimulatedTimePastTapDelay();
generator_->MoveTouch(location_end); generator_->MoveTouch(location_end);
gfx::Point location_real_mouse_move(15, 16); gfx::Point location_real_mouse_move(215, 216);
ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, location_real_mouse_move, ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, location_real_mouse_move,
location_real_mouse_move, ui::EventTimeForNow(), 0, location_real_mouse_move, ui::EventTimeForNow(), 0,
0); 0);
...@@ -620,7 +620,7 @@ TEST_F(TouchExplorationTest, TurnOnMidTouch) { ...@@ -620,7 +620,7 @@ TEST_F(TouchExplorationTest, TurnOnMidTouch) {
ClearCapturedEvents(); ClearCapturedEvents();
// The move and release from the second finger should get rewritten. // The move and release from the second finger should get rewritten.
generator_->MoveTouchId(gfx::Point(13, 14), 2); generator_->MoveTouchId(gfx::Point(213, 214), 2);
generator_->ReleaseTouchId(2); generator_->ReleaseTouchId(2);
AdvanceSimulatedTimePastTapDelay(); AdvanceSimulatedTimePastTapDelay();
captured_events = GetCapturedLocatedEvents(); captured_events = GetCapturedLocatedEvents();
...@@ -713,7 +713,7 @@ TEST_F(TouchExplorationTest, DoubleTap) { ...@@ -713,7 +713,7 @@ TEST_F(TouchExplorationTest, DoubleTap) {
// Now double-tap at a different location. This should result in // Now double-tap at a different location. This should result in
// a single touch press and release at the location of the tap, // a single touch press and release at the location of the tap,
// not at the location of the double-tap. // not at the location of the double-tap.
gfx::Point double_tap_location(33, 34); gfx::Point double_tap_location(133, 134);
generator_->set_current_location(double_tap_location); generator_->set_current_location(double_tap_location);
generator_->PressTouch(); generator_->PressTouch();
generator_->ReleaseTouch(); generator_->ReleaseTouch();
...@@ -754,7 +754,7 @@ TEST_F(TouchExplorationTest, DoubleTapTiming) { ...@@ -754,7 +754,7 @@ TEST_F(TouchExplorationTest, DoubleTapTiming) {
ClearCapturedEvents(); ClearCapturedEvents();
// The press of the second tap happens in time, but the release does not. // The press of the second tap happens in time, but the release does not.
gfx::Point double_tap_location(33, 34); gfx::Point double_tap_location(133, 134);
generator_->set_current_location(double_tap_location); generator_->set_current_location(double_tap_location);
generator_->PressTouch(); generator_->PressTouch();
generator_->ReleaseTouch(); generator_->ReleaseTouch();
...@@ -795,7 +795,7 @@ TEST_F(TouchExplorationTest, DoubleTapWithExplicitAnchorPoint) { ...@@ -795,7 +795,7 @@ TEST_F(TouchExplorationTest, DoubleTapWithExplicitAnchorPoint) {
// Now double-tap at a different location. This should result in // Now double-tap at a different location. This should result in
// a click gesture. // a click gesture.
gfx::Point double_tap_location(33, 34); gfx::Point double_tap_location(133, 134);
generator_->set_current_location(double_tap_location); generator_->set_current_location(double_tap_location);
generator_->PressTouch(); generator_->PressTouch();
generator_->ReleaseTouch(); generator_->ReleaseTouch();
...@@ -833,11 +833,11 @@ TEST_F(TouchExplorationTest, DoubleTapPassthrough) { ...@@ -833,11 +833,11 @@ TEST_F(TouchExplorationTest, DoubleTapPassthrough) {
// Now double-tap and hold at a different location. // Now double-tap and hold at a different location.
// This should result in a single touch press at the location of the tap, // This should result in a single touch press at the location of the tap,
// not at the location of the double-tap. // not at the location of the double-tap.
gfx::Point first_tap_location(13, 14); gfx::Point first_tap_location(213, 214);
generator_->set_current_location(first_tap_location); generator_->set_current_location(first_tap_location);
generator_->PressTouchId(1); generator_->PressTouchId(1);
generator_->ReleaseTouchId(1); generator_->ReleaseTouchId(1);
gfx::Point second_tap_location(15, 16); gfx::Point second_tap_location(215, 216);
generator_->set_current_location(second_tap_location); generator_->set_current_location(second_tap_location);
generator_->PressTouchId(1); generator_->PressTouchId(1);
// Advance to the finger passing through. // Advance to the finger passing through.
...@@ -876,7 +876,7 @@ TEST_F(TouchExplorationTest, DoubleTapPassthrough) { ...@@ -876,7 +876,7 @@ TEST_F(TouchExplorationTest, DoubleTapPassthrough) {
// Events for other fingers should do nothing. // Events for other fingers should do nothing.
generator_->PressTouchId(2); generator_->PressTouchId(2);
generator_->PressTouchId(3); generator_->PressTouchId(3);
generator_->MoveTouchId(gfx::Point(34, 36), 2); generator_->MoveTouchId(gfx::Point(134, 136), 2);
generator_->ReleaseTouchId(2); generator_->ReleaseTouchId(2);
captured_events = GetCapturedLocatedEvents(); captured_events = GetCapturedLocatedEvents();
ASSERT_EQ(0U, captured_events.size()); ASSERT_EQ(0U, captured_events.size());
...@@ -923,11 +923,11 @@ TEST_F(TouchExplorationTest, DoubleTapLongPress) { ...@@ -923,11 +923,11 @@ TEST_F(TouchExplorationTest, DoubleTapLongPress) {
// This should result in a single touch long press and release // This should result in a single touch long press and release
// at the location of the tap, not at the location of the double-tap. // at the location of the tap, not at the location of the double-tap.
// There should be a time delay between the touch press and release. // There should be a time delay between the touch press and release.
gfx::Point first_tap_location(33, 34); gfx::Point first_tap_location(133, 134);
generator_->set_current_location(first_tap_location); generator_->set_current_location(first_tap_location);
generator_->PressTouch(); generator_->PressTouch();
generator_->ReleaseTouch(); generator_->ReleaseTouch();
gfx::Point second_tap_location(23, 24); gfx::Point second_tap_location(123, 124);
generator_->set_current_location(second_tap_location); generator_->set_current_location(second_tap_location);
generator_->PressTouch(); generator_->PressTouch();
// Advance to the finger passing through, and then to the longpress timeout. // Advance to the finger passing through, and then to the longpress timeout.
...@@ -963,13 +963,13 @@ TEST_F(TouchExplorationTest, SingleTap) { ...@@ -963,13 +963,13 @@ TEST_F(TouchExplorationTest, SingleTap) {
ClearCapturedEvents(); ClearCapturedEvents();
// Move to another location for single tap // Move to another location for single tap
gfx::Point tap_location(22, 23); gfx::Point tap_location(222, 223);
generator_->MoveTouch(tap_location); generator_->MoveTouch(tap_location);
generator_->ReleaseTouch(); generator_->ReleaseTouch();
// Allow time to pass within the grace period of releasing before // Allow time to pass within the grace period of releasing before
// tapping again. // tapping again.
gfx::Point final_location(33, 34); gfx::Point final_location(133, 134);
generator_->set_current_location(final_location); generator_->set_current_location(final_location);
simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(250)); simulated_clock_.Advance(base::TimeDelta::FromMilliseconds(250));
generator_->PressTouch(); generator_->PressTouch();
...@@ -998,7 +998,7 @@ TEST_F(TouchExplorationTest, DoubleTapNoTouchExplore) { ...@@ -998,7 +998,7 @@ TEST_F(TouchExplorationTest, DoubleTapNoTouchExplore) {
// Touch exploration mode has not been entered, so there is no previous // Touch exploration mode has not been entered, so there is no previous
// touch exploration event. The double-tap should be discarded, and no events // touch exploration event. The double-tap should be discarded, and no events
// should be generated at all. // should be generated at all.
gfx::Point double_tap_location(33, 34); gfx::Point double_tap_location(133, 134);
generator_->set_current_location(double_tap_location); generator_->set_current_location(double_tap_location);
generator_->PressTouch(); generator_->PressTouch();
generator_->ReleaseTouch(); generator_->ReleaseTouch();
...@@ -1021,7 +1021,7 @@ TEST_F(TouchExplorationTest, DoubleTapNoTouchExplore) { ...@@ -1021,7 +1021,7 @@ TEST_F(TouchExplorationTest, DoubleTapNoTouchExplore) {
TEST_F(TouchExplorationTest, SplitTap) { TEST_F(TouchExplorationTest, SplitTap) {
SwitchTouchExplorationMode(true); SwitchTouchExplorationMode(true);
gfx::Point initial_touch_location(111, 112); gfx::Point initial_touch_location(111, 112);
gfx::Point second_touch_location(33, 34); gfx::Point second_touch_location(133, 134);
// Tap and hold at one location, and get a mouse move event in touch explore. // Tap and hold at one location, and get a mouse move event in touch explore.
EnterTouchExplorationModeAtLocation(initial_touch_location); EnterTouchExplorationModeAtLocation(initial_touch_location);
...@@ -1562,7 +1562,7 @@ TEST_F(TouchExplorationTest, GestureAddedFinger) { ...@@ -1562,7 +1562,7 @@ TEST_F(TouchExplorationTest, GestureAddedFinger) {
// Generate a second press, but time out past the gesture period so that // Generate a second press, but time out past the gesture period so that
// gestures are prevented from continuing to go through. // gestures are prevented from continuing to go through.
ui::TouchEvent second_press( ui::TouchEvent second_press(
ui::ET_TOUCH_PRESSED, gfx::Point(20, 21), Now(), ui::ET_TOUCH_PRESSED, gfx::Point(220, 221), Now(),
ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1)); ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1));
generator_->Dispatch(&second_press); generator_->Dispatch(&second_press);
AdvanceSimulatedTimePastTapDelay(); AdvanceSimulatedTimePastTapDelay();
...@@ -1751,18 +1751,14 @@ TEST_F(TouchExplorationTest, EnterEarconPlays) { ...@@ -1751,18 +1751,14 @@ TEST_F(TouchExplorationTest, EnterEarconPlays) {
gfx::Point upper_left_corner(0, 0); gfx::Point upper_left_corner(0, 0);
gfx::Point upper_right_corner(window.right(), 0); gfx::Point upper_right_corner(window.right(), 0);
gfx::Point lower_left_corner(0, window.bottom()); gfx::Point left_edge(0, 140);
gfx::Point lower_right_corner(window.right(), window.bottom()); gfx::Point right_edge(window.right(), 140);
gfx::Point left_edge(0, 30); gfx::Point top_edge(140, 0);
gfx::Point right_edge(window.right(), 30); gfx::Point bottom_edge(140, window.bottom());
gfx::Point top_edge(30, 0);
gfx::Point bottom_edge(30, window.bottom());
std::vector<gfx::Point> locations; std::vector<gfx::Point> locations;
locations.push_back(upper_left_corner); locations.push_back(upper_left_corner);
locations.push_back(upper_right_corner); locations.push_back(upper_right_corner);
locations.push_back(lower_left_corner);
locations.push_back(lower_right_corner);
locations.push_back(left_edge); locations.push_back(left_edge);
locations.push_back(right_edge); locations.push_back(right_edge);
locations.push_back(top_edge); locations.push_back(top_edge);
...@@ -1796,10 +1792,10 @@ TEST_F(TouchExplorationTest, ExitEarconPlays) { ...@@ -1796,10 +1792,10 @@ TEST_F(TouchExplorationTest, ExitEarconPlays) {
gfx::Point upper_right_corner(window.right(), 0); gfx::Point upper_right_corner(window.right(), 0);
gfx::Point lower_left_corner(0, window.bottom()); gfx::Point lower_left_corner(0, window.bottom());
gfx::Point lower_right_corner(window.right(), window.bottom()); gfx::Point lower_right_corner(window.right(), window.bottom());
gfx::Point left_edge(0, 30); gfx::Point left_edge(0, 40);
gfx::Point right_edge(window.right(), 30); gfx::Point right_edge(window.right(), 40);
gfx::Point top_edge(30, 0); gfx::Point top_edge(40, 0);
gfx::Point bottom_edge(30, window.bottom()); gfx::Point bottom_edge(40, window.bottom());
std::vector<gfx::Point> locations; std::vector<gfx::Point> locations;
locations.push_back(upper_left_corner); locations.push_back(upper_left_corner);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment