Commit 1d66aed8 authored by evy@chromium.org's avatar evy@chromium.org

Fixed NOTREACHED() bug in touch_exploration_controller.

Now when double tapping with no last touch exploration location, the tap timer is no longer fired, which was previously entering no fingers down state when a finger was actually down.

TEST=TouchExplorationTest.DoubleTapNoTouchExplore
BUG=397296

Review URL: https://codereview.chromium.org/419923002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285693 0039d316-1c4b-4281-b951-d872f2087c98
parent 5eaf9a2c
...@@ -243,15 +243,12 @@ TouchExplorationController::InSingleTapOrTouchExploreReleased( ...@@ -243,15 +243,12 @@ TouchExplorationController::InSingleTapOrTouchExploreReleased(
state_ = WAIT_FOR_RELEASE; state_ = WAIT_FOR_RELEASE;
return ui::EVENT_REWRITE_DISCARD; return ui::EVENT_REWRITE_DISCARD;
} }
// If there is no touch exploration yet, discard.
if (!last_touch_exploration_ || type == ui::ET_TOUCH_RELEASED) {
if (current_touch_ids_.size() == 0) {
ResetToNoFingersDown();
}
return ui::EVENT_REWRITE_DISCARD;
}
if (type == ui::ET_TOUCH_PRESSED) { if (type == ui::ET_TOUCH_PRESSED) {
// If there is no touch exploration yet, we can't send a click, so discard.
if (!last_touch_exploration_) {
tap_timer_.Stop();
return ui::EVENT_REWRITE_DISCARD;
}
// This is the second tap in a double-tap (or double tap-hold). // This is the second tap in a double-tap (or double tap-hold).
// Rewrite at location of last touch exploration. // Rewrite at location of last touch exploration.
rewritten_event->reset( rewritten_event->reset(
......
...@@ -752,7 +752,13 @@ TEST_F(TouchExplorationTest, DoubleTapNoTouchExplore) { ...@@ -752,7 +752,13 @@ TEST_F(TouchExplorationTest, DoubleTapNoTouchExplore) {
generator_->PressTouch(); generator_->PressTouch();
generator_->ReleaseTouch(); generator_->ReleaseTouch();
generator_->PressTouch(); generator_->PressTouch();
// Since the state stays in single_tap_released, we need to make sure the
// tap timer doesn't fire and set the state to no fingers down (since there
// is still a finger down).
AdvanceSimulatedTimePastPotentialTapDelay();
EXPECT_FALSE(IsInNoFingersDownState());
generator_->ReleaseTouch(); generator_->ReleaseTouch();
EXPECT_TRUE(IsInNoFingersDownState());
std::vector<ui::LocatedEvent*> captured_events = GetCapturedLocatedEvents(); std::vector<ui::LocatedEvent*> captured_events = GetCapturedLocatedEvents();
ASSERT_EQ(0U, captured_events.size()); ASSERT_EQ(0U, captured_events.size());
......
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