Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Unified Diff: trunk/src/ui/chromeos/touch_exploration_controller_unittest.cc

Issue 483443002: Revert 290001 because it's causing test failures: (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/ui/chromeos/touch_exploration_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/chromeos/touch_exploration_controller_unittest.cc
===================================================================
--- trunk/src/ui/chromeos/touch_exploration_controller_unittest.cc (revision 290089)
+++ trunk/src/ui/chromeos/touch_exploration_controller_unittest.cc (working copy)
@@ -776,7 +776,7 @@
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 @@
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 @@
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<ui::LocatedEvent*> 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) {
« no previous file with comments | « trunk/src/ui/chromeos/touch_exploration_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698