Index: ui/chromeos/touch_exploration_controller_unittest.cc |
diff --git a/ui/chromeos/touch_exploration_controller_unittest.cc b/ui/chromeos/touch_exploration_controller_unittest.cc |
index 10da4b1f3a7f5a272d86d88d1a10daae2f1d1e22..4312d4d505e9abaa433cb88400f0ad05815f8682 100644 |
--- a/ui/chromeos/touch_exploration_controller_unittest.cc |
+++ b/ui/chromeos/touch_exploration_controller_unittest.cc |
@@ -571,6 +571,7 @@ TEST_F(TouchExplorationTest, SplitTap) { |
EXPECT_TRUE(events[0]->flags() & ui::EF_IS_SYNTHESIZED); |
EXPECT_TRUE(events[0]->flags() & ui::EF_TOUCH_ACCESSIBILITY); |
ClearCapturedEvents(); |
+ EXPECT_TRUE(IsInTouchToMouseMode()); |
// Now tap and release at a different location. This should result in a |
// single touch and release at the location of the first (held) tap, |
@@ -579,10 +580,17 @@ TEST_F(TouchExplorationTest, SplitTap) { |
ui::TouchEvent split_tap_press( |
ui::ET_TOUCH_PRESSED, second_touch_location, 1, Now()); |
generator_->Dispatch(&split_tap_press); |
+ // To simulate the behavior of the real device, we manually disable |
+ // mouse events. To not rely on manually setting the state, this is also |
+ // tested in touch_exploration_controller_browsertest. |
+ cursor_client()->DisableMouseEvents(); |
ui::TouchEvent split_tap_release( |
ui::ET_TOUCH_RELEASED, second_touch_location, 1, Now()); |
generator_->Dispatch(&split_tap_release); |
EXPECT_FALSE(IsInNoFingersDownState()); |
+ // Releasing the second finger should re-enable mouse events putting us |
+ // back into the touch exploration mode. |
+ EXPECT_TRUE(IsInTouchToMouseMode()); |
const ScopedVector<ui::LocatedEvent>& captured_events = GetCapturedEvents(); |
ASSERT_EQ(2U, captured_events.size()); |
@@ -590,6 +598,13 @@ TEST_F(TouchExplorationTest, SplitTap) { |
EXPECT_EQ(initial_touch_location, captured_events[0]->location()); |
EXPECT_EQ(ui::ET_TOUCH_RELEASED, captured_events[1]->type()); |
EXPECT_EQ(initial_touch_location, captured_events[1]->location()); |
+ ClearCapturedEvents(); |
+ |
+ ui::TouchEvent touch_explore_release( |
+ ui::ET_TOUCH_RELEASED, initial_touch_location, 0, Now()); |
+ generator_->Dispatch(&touch_explore_release); |
+ AdvanceSimulatedTimePastTapDelay(); |
+ EXPECT_TRUE(IsInNoFingersDownState()); |
} |
// If split tap is started but the touch explore finger is released first, |
@@ -663,6 +678,9 @@ TEST_F(TouchExplorationTest, SplitTapLongPress) { |
ui::ET_TOUCH_RELEASED, second_touch_location, 1, Now()); |
generator_->Dispatch(&split_tap_release); |
EXPECT_FALSE(IsInNoFingersDownState()); |
+ // This is the added line in the test. TODO: Change the way the cursor |
+ // client is set up so this test will fail. |
mfomitchev
2014/07/03 17:31:55
Need to fix the comment. Also make it so the test
evy
2014/07/07 18:53:42
Done.
mfomitchev
2014/07/09 13:26:01
Does it fail without the fix now? I thought you ne
|
+ EXPECT_TRUE(IsInTouchToMouseMode()); |
const ScopedVector<ui::LocatedEvent>& captured_events = GetCapturedEvents(); |
ASSERT_EQ(2U, captured_events.size()); |