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

Side by Side Diff: ui/chromeos/touch_exploration_controller_unittest.cc

Issue 2584063002: Re-land: Toggle spoken feedback if two fingers are held down. (Closed)
Patch Set: Only toggle spoken feedback on CFM devices Created 4 years 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 unified diff | Download patch
« no previous file with comments | « ui/chromeos/touch_exploration_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/chromeos/touch_exploration_controller.h" 5 #include "ui/chromeos/touch_exploration_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 void SuppressVLOGs(bool suppress) { 291 void SuppressVLOGs(bool suppress) {
292 touch_exploration_controller_->SuppressVLOGsForTesting(suppress); 292 touch_exploration_controller_->SuppressVLOGsForTesting(suppress);
293 } 293 }
294 294
295 void SwitchTouchExplorationMode(bool on) { 295 void SwitchTouchExplorationMode(bool on) {
296 if (!on && touch_exploration_controller_.get()) { 296 if (!on && touch_exploration_controller_.get()) {
297 touch_exploration_controller_.reset(); 297 touch_exploration_controller_.reset();
298 } else if (on && !touch_exploration_controller_.get()) { 298 } else if (on && !touch_exploration_controller_.get()) {
299 touch_exploration_controller_.reset( 299 touch_exploration_controller_.reset(
300 new ui::TouchExplorationControllerTestApi( 300 new ui::TouchExplorationControllerTestApi(
301 new TouchExplorationController(root_window(), &delegate_))); 301 new TouchExplorationController(root_window(), &delegate_,
302 nullptr)));
302 cursor_client()->ShowCursor(); 303 cursor_client()->ShowCursor();
303 cursor_client()->DisableMouseEvents(); 304 cursor_client()->DisableMouseEvents();
304 } 305 }
305 } 306 }
306 307
307 void EnterTouchExplorationModeAtLocation(gfx::Point tap_location) { 308 void EnterTouchExplorationModeAtLocation(gfx::Point tap_location) {
308 ui::TouchEvent touch_press(ui::ET_TOUCH_PRESSED, tap_location, 0, Now()); 309 ui::TouchEvent touch_press(ui::ET_TOUCH_PRESSED, tap_location, 0, Now());
309 generator_->Dispatch(&touch_press); 310 generator_->Dispatch(&touch_press);
310 AdvanceSimulatedTimePastTapDelay(); 311 AdvanceSimulatedTimePastTapDelay();
311 EXPECT_TRUE(IsInTouchToMouseMode()); 312 EXPECT_TRUE(IsInTouchToMouseMode());
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 AdvanceSimulatedTimePastTapDelay(); 1934 AdvanceSimulatedTimePastTapDelay();
1934 EXPECT_TRUE(IsInNoFingersDownState()); 1935 EXPECT_TRUE(IsInNoFingersDownState());
1935 1936
1936 ASSERT_EQ(1U, GetCapturedEvents().size()); 1937 ASSERT_EQ(1U, GetCapturedEvents().size());
1937 EXPECT_EQ(ui::ET_MOUSE_MOVED, GetCapturedEvents()[0]->type()); 1938 EXPECT_EQ(ui::ET_MOUSE_MOVED, GetCapturedEvents()[0]->type());
1938 ClearCapturedEvents(); 1939 ClearCapturedEvents();
1939 } 1940 }
1940 } 1941 }
1941 1942
1942 } // namespace ui 1943 } // namespace ui
OLDNEW
« no previous file with comments | « ui/chromeos/touch_exploration_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698