OLD | NEW |
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/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "base/test/simple_test_tick_clock.h" | 10 #include "base/test/simple_test_tick_clock.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // move events until resize is complete (crbug.com/384342) which | 43 // move events until resize is complete (crbug.com/384342) which |
44 // interferes with this test. | 44 // interferes with this test. |
45 content::WebContents* web_contents = | 45 content::WebContents* web_contents = |
46 browser()->tab_strip_model()->GetActiveWebContents(); | 46 browser()->tab_strip_model()->GetActiveWebContents(); |
47 content::WaitForResizeComplete(web_contents); | 47 content::WaitForResizeComplete(web_contents); |
48 root_window_ = ash::Shell::GetInstance()->GetPrimaryRootWindow(); | 48 root_window_ = ash::Shell::GetInstance()->GetPrimaryRootWindow(); |
49 event_handler_.reset(new ui::test::TestEventHandler()); | 49 event_handler_.reset(new ui::test::TestEventHandler()); |
50 root_window_->AddPreTargetHandler(event_handler_.get()); | 50 root_window_->AddPreTargetHandler(event_handler_.get()); |
51 } | 51 } |
52 | 52 |
53 virtual void CleanUpOnMainThread() OVERRIDE { | 53 virtual void TearDownOnMainThread() OVERRIDE { |
54 SwitchTouchExplorationMode(false); | 54 SwitchTouchExplorationMode(false); |
55 root_window_->RemovePreTargetHandler(event_handler_.get()); | 55 root_window_->RemovePreTargetHandler(event_handler_.get()); |
56 } | 56 } |
57 | 57 |
58 void SwitchTouchExplorationMode(bool on) { | 58 void SwitchTouchExplorationMode(bool on) { |
59 ash::AccessibilityDelegate* ad = | 59 ash::AccessibilityDelegate* ad = |
60 ash::Shell::GetInstance()->accessibility_delegate(); | 60 ash::Shell::GetInstance()->accessibility_delegate(); |
61 if (on != ad->IsSpokenFeedbackEnabled()) | 61 if (on != ad->IsSpokenFeedbackEnabled()) |
62 ad->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE); | 62 ad->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE); |
63 } | 63 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 // Continuing to move the touch exploration finger should send more mouse | 181 // Continuing to move the touch exploration finger should send more mouse |
182 // events. | 182 // events. |
183 generator.MoveTouchId(gfx::Point(509, 609), 1); | 183 generator.MoveTouchId(gfx::Point(509, 609), 1); |
184 EXPECT_EQ(0, event_handler_->num_touch_events()); | 184 EXPECT_EQ(0, event_handler_->num_touch_events()); |
185 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled()); | 185 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled()); |
186 EXPECT_FALSE(cursor_client->IsCursorVisible()); | 186 EXPECT_FALSE(cursor_client->IsCursorVisible()); |
187 } | 187 } |
188 | 188 |
189 } // namespace ui | 189 } // namespace ui |
OLD | NEW |