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

Unified Diff: chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc

Issue 359453003: Added accurate TouchToMouseMode testing to SplitTap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: An old and new test that fail without the new added line. Created 6 years, 6 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
Index: chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
diff --git a/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc b/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
index 43ef9138f037c1cfb05a14ddd36db9d836f23ff6..26a18b8294e17a15d0f928ae4d4bf79fcea750ce 100644
--- a/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
@@ -84,4 +84,39 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, ToggleOnOff) {
root_window->RemovePreTargetHandler(event_handler.get());
}
+// This test makes sure that after the user clicks with split tap,
mfomitchev 2014/06/27 19:15:46 One more thing: I've just realized that a change I
evy 2014/06/30 23:28:46 Done.
+// they continue to touch exploration mode if the original touch exploration
+// finger is still on the screen.
+IN_PROC_BROWSER_TEST_F(TouchExplorationTest, SplitTapExplore) {
mfomitchev 2014/06/27 16:36:05 Can you please add validation for the cursor clien
evy 2014/06/27 18:03:00 Done. Though it turns out that mouse events aren't
mfomitchev 2014/06/27 19:15:46 Right, that actually makes sense because the contr
evy 2014/06/30 23:28:46 Working on it. Turns out this is more complicated
+ aura::Window* root_window = ash::Shell::GetInstance()->GetPrimaryRootWindow();
+ scoped_ptr<ui::test::TestEventHandler>
+ event_handler(new ui::test::TestEventHandler());
+ root_window->AddPreTargetHandler(event_handler.get());
+ SwitchTouchExplorationMode(true);
+ aura::test::EventGenerator generator(root_window);
+
+ generator.set_current_location(gfx::Point(100, 200));
+ generator.PressTouchId(1);
+ // Initiate touch explore by moving out of the slop.
+ generator.MoveTouchId(gfx::Point(109, 209), 1);
tdanderson 2014/06/27 17:01:07 Add EXPECT_EQ(1, event_handler->num_touch_events()
evy 2014/06/27 18:03:00 There actually aren't any touch events passed thro
+ event_handler->Reset();
+
+ // Press and release with a second finger for split tap. This should send
+ // touch press and release events which should send a click press and release.
tdanderson 2014/06/27 17:01:07 For documentation's sake, it would be good to ment
evy 2014/06/27 18:03:00 Yup! This is tested in the SplitTap unit test. Sho
+ generator.set_current_location(gfx::Point(102, 202));
+ generator.PressTouchId(2);
+ generator.ReleaseTouchId(2);
+ EXPECT_EQ(2, event_handler->num_touch_events());
+ event_handler->Reset();
+
+ // Continuing to move the touch exploration finger should send more mouse
+ // events.
+ generator.MoveTouchId(gfx::Point(509, 609), 1);
+ EXPECT_GT(event_handler->num_mouse_events(), 0);
tdanderson 2014/06/27 17:01:07 It's better to use EXPECT_EQ if you know how many
evy 2014/06/27 18:03:00 I noticed a comment above in another test: // Numb
+ EXPECT_EQ(0, event_handler->num_touch_events());
+
+ SwitchTouchExplorationMode(false);
+ root_window->RemovePreTargetHandler(event_handler.get());
+}
+
} // namespace ui
« no previous file with comments | « no previous file | ui/chromeos/touch_exploration_controller.cc » ('j') | ui/chromeos/touch_exploration_controller_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698