X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fui%2Fchromeos%2Ftouch_exploration_controller_unittest.cc;h=c43885ecba68861cfac4be4cedd329ae02d66f5e;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=67861ce10f097be01d62206eee6f3b862c06871a;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/ui/chromeos/touch_exploration_controller_unittest.cc b/src/ui/chromeos/touch_exploration_controller_unittest.cc index 67861ce..c43885e 100644 --- a/src/ui/chromeos/touch_exploration_controller_unittest.cc +++ b/src/ui/chromeos/touch_exploration_controller_unittest.cc @@ -776,7 +776,7 @@ TEST_F(TouchExplorationTest, DoubleTapPassthrough) { generator_->set_current_location(second_tap_location); generator_->PressTouchId(1); // Advance to the finger passing through. - AdvanceSimulatedTimePastPassthroughDelay(); + AdvanceSimulatedTimePastTapDelay(); gfx::Vector2d passthrough_offset = second_tap_location - tap_location; @@ -864,7 +864,7 @@ TEST_F(TouchExplorationTest, DoubleTapLongPress) { generator_->set_current_location(second_tap_location); generator_->PressTouch(); // Advance to the finger passing through, and then to the longpress timeout. - AdvanceSimulatedTimePastPassthroughDelay(); + AdvanceSimulatedTimePastTapDelay(); simulated_clock_->Advance(gesture_detector_config_.longpress_timeout); generator_->ReleaseTouch(); @@ -916,61 +916,6 @@ TEST_F(TouchExplorationTest, SingleTap) { EXPECT_EQ(tap_location, captured_events[3]->location()); } -// Single-tapping and holding should send a touch press and release through to -// the location of the last successful touch exploration. There should be a -// delay between the touch and release events (right click). The user should -// not enter passthrough mode - touch moves should be discarded. -TEST_F(TouchExplorationTest, SingleTapLongPress) { - SwitchTouchExplorationMode(true); - - // Tap once to simulate a mouse moved event. - gfx::Point initial_location(11, 12); - generator_->set_current_location(initial_location); - generator_->PressTouch(); - AdvanceSimulatedTimePastTapDelay(); - ClearCapturedEvents(); - - // Move to another location for single tap - gfx::Point tap_location(22, 23); - generator_->MoveTouch(tap_location); - generator_->ReleaseTouch(); - - std::vector captured_events = GetCapturedLocatedEvents(); - ASSERT_EQ(2U, captured_events.size()); - EXPECT_EQ(ui::ET_MOUSE_MOVED, captured_events[0]->type()); - EXPECT_EQ(ui::ET_MOUSE_MOVED, captured_events[1]->type()); - ClearCapturedEvents(); - - // Tap again for a long press single tap. - gfx::Point final_location(33, 34); - generator_->set_current_location(final_location); - generator_->PressTouch(); - simulated_clock_->Advance(gesture_detector_config_.longpress_timeout); - - captured_events = GetCapturedLocatedEvents(); - ASSERT_EQ(1U, captured_events.size()); - EXPECT_EQ(ui::ET_TOUCH_PRESSED, captured_events[0]->type()); - EXPECT_EQ(tap_location, captured_events[0]->location()); - base::TimeDelta pressed_time = captured_events[0]->time_stamp(); - ClearCapturedEvents(); - - // Touch moves should not send any events through, since the user should be - // in a wait for release state. - gfx::Point move_location(44, 45); - generator_->MoveTouch(move_location); - captured_events = GetCapturedLocatedEvents(); - ASSERT_EQ(0U, captured_events.size()); - - generator_->ReleaseTouch(); - captured_events = GetCapturedLocatedEvents(); - ASSERT_EQ(1U, captured_events.size()); - EXPECT_EQ(ui::ET_TOUCH_RELEASED, captured_events[0]->type()); - EXPECT_EQ(tap_location, captured_events[0]->location()); - base::TimeDelta released_time = captured_events[0]->time_stamp(); - EXPECT_EQ(gesture_detector_config_.longpress_timeout, - released_time - pressed_time); -} - // Double-tapping without coming from touch exploration (no previous touch // exploration event) should not generate any events. TEST_F(TouchExplorationTest, DoubleTapNoTouchExplore) {