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

Unified Diff: ui/chromeos/touch_exploration_controller_unittest.cc

Issue 420073003: Two Finger Tap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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: 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 ffe4d090b8b3ce8779e8785a3c7ba77a58577ead..43e5a6ad948a1a7d42fb325baa3767a81f974dad 100644
--- a/ui/chromeos/touch_exploration_controller_unittest.cc
+++ b/ui/chromeos/touch_exploration_controller_unittest.cc
@@ -81,6 +81,8 @@ class MockTouchExplorationControllerDelegate
virtual void SetOutputLevel(int volume) OVERRIDE {
volume_changes_.push_back(volume);
}
+ virtual void SilenceSpokenFeedback() OVERRIDE {
+ }
const std::vector<float> VolumeChanges() { return volume_changes_; }
const size_t NumAdjustSounds() { return num_times_adjust_sound_played_; }
@@ -127,6 +129,11 @@ class TouchExplorationControllerTestApi {
touch_exploration_controller_->SLIDE_GESTURE;
}
+ bool IsInTwoFingerTapStateForTesting() const {
+ return touch_exploration_controller_->state_ ==
+ touch_exploration_controller_->TWO_FINGER_TAP;
+ }
+
gfx::Rect BoundsOfRootWindowInDIPForTesting() const {
return touch_exploration_controller_->root_window_->GetBoundsInScreen();
}
@@ -287,6 +294,10 @@ class TouchExplorationTest : public aura::test::AuraTestBase {
return touch_exploration_controller_->IsInSlideGestureStateForTesting();
}
+ bool IsInTwoFingerTapState() {
+ return touch_exploration_controller_->IsInTwoFingerTapStateForTesting();
+ }
+
gfx::Rect BoundsOfRootWindowInDIP() {
return touch_exploration_controller_->BoundsOfRootWindowInDIPForTesting();
}
@@ -1527,4 +1538,24 @@ TEST_F(TouchExplorationTest, InBoundariesTouchExploration) {
EXPECT_TRUE(IsInTouchToMouseMode());
}
+TEST_F(TouchExplorationTest, TwoFingerTap) {
+ SwitchTouchExplorationMode(true);
+
+ generator_->PressTouchId(1);
+ EXPECT_FALSE(IsInTwoFingerTapState());
+
+ generator_->PressTouchId(2);
+ EXPECT_TRUE(IsInTwoFingerTapState());
aboxhall 2014/07/31 16:49:26 Test for the kTwoFingerTap timeout elapsing?
+
+ const ScopedVector<ui::Event>& captured_events = GetCapturedEvents();
+ ASSERT_EQ(0U, captured_events.size());
+
+ generator_->ReleaseTouchId(1);
+ generator_->ReleaseTouchId(2);
+
+ // Two key events should have been sent to silence the feedback.
+ ASSERT_EQ(2U, captured_events.size());
+
+}
+
} // namespace ui
« ui/chromeos/touch_exploration_controller.cc ('K') | « ui/chromeos/touch_exploration_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698