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

Side by Side Diff: chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc

Issue 2154523002: Move AccessibilityDelegate ownership to ash::WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setmediadelegate
Patch Set: fix mash_unittests Created 4 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 unified diff | Download patch
« no previous file with comments | « ash/wm/overview/window_selector_unittest.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 "ash/common/accessibility_delegate.h" 7 #include "ash/common/accessibility_delegate.h"
8 #include "ash/common/accessibility_types.h" 8 #include "ash/common/accessibility_types.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 root_window_->AddPreTargetHandler(event_handler_.get()); 51 root_window_->AddPreTargetHandler(event_handler_.get());
52 } 52 }
53 53
54 void TearDownOnMainThread() override { 54 void TearDownOnMainThread() override {
55 SwitchTouchExplorationMode(false); 55 SwitchTouchExplorationMode(false);
56 root_window_->RemovePreTargetHandler(event_handler_.get()); 56 root_window_->RemovePreTargetHandler(event_handler_.get());
57 } 57 }
58 58
59 void SwitchTouchExplorationMode(bool on) { 59 void SwitchTouchExplorationMode(bool on) {
60 ash::AccessibilityDelegate* delegate = 60 ash::AccessibilityDelegate* delegate =
61 ash::WmShell::Get()->GetAccessibilityDelegate(); 61 ash::WmShell::Get()->accessibility_delegate();
62 if (on != delegate->IsSpokenFeedbackEnabled()) 62 if (on != delegate->IsSpokenFeedbackEnabled())
63 delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE); 63 delegate->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE);
64 } 64 }
65 65
66 base::TimeTicks Now() { return simulated_clock_->NowTicks(); } 66 base::TimeTicks Now() { return simulated_clock_->NowTicks(); }
67 67
68 ui::GestureDetector::Config gesture_detector_config_; 68 ui::GestureDetector::Config gesture_detector_config_;
69 base::SimpleTestTickClock* simulated_clock_; 69 base::SimpleTestTickClock* simulated_clock_;
70 aura::Window* root_window_; 70 aura::Window* root_window_;
71 std::unique_ptr<ui::test::TestEventHandler> event_handler_; 71 std::unique_ptr<ui::test::TestEventHandler> event_handler_;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 EXPECT_EQ(2, event_handler_->num_touch_events()); 240 EXPECT_EQ(2, event_handler_->num_touch_events());
241 event_handler_->Reset(); 241 event_handler_->Reset();
242 242
243 // Continuing to move the touch exploration finger should send more mouse 243 // Continuing to move the touch exploration finger should send more mouse
244 // events. 244 // events.
245 generator.MoveTouchId(gfx::Point(509, 609), 1); 245 generator.MoveTouchId(gfx::Point(509, 609), 1);
246 EXPECT_EQ(0, event_handler_->num_touch_events()); 246 EXPECT_EQ(0, event_handler_->num_touch_events());
247 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled()); 247 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled());
248 EXPECT_FALSE(cursor_client->IsCursorVisible()); 248 EXPECT_FALSE(cursor_client->IsCursorVisible());
249 } 249 }
OLDNEW
« no previous file with comments | « ash/wm/overview/window_selector_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698