| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 ui::GestureDetector::Config gesture_detector_config_; | 70 ui::GestureDetector::Config gesture_detector_config_; |
| 71 base::SimpleTestTickClock* simulated_clock_; | 71 base::SimpleTestTickClock* simulated_clock_; |
| 72 aura::Window* root_window_; | 72 aura::Window* root_window_; |
| 73 scoped_ptr<ui::test::TestEventHandler> event_handler_; | 73 scoped_ptr<ui::test::TestEventHandler> event_handler_; |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 DISALLOW_COPY_AND_ASSIGN(TouchExplorationTest); | 76 DISALLOW_COPY_AND_ASSIGN(TouchExplorationTest); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #if defined(OS_CHROMEOS) |
| 80 // crbug.com/422943 |
| 81 #define MAYBE_NoRewritingEventsWhenOff DISABLED_NoRewritingEventsWhenOff |
| 82 #else |
| 83 #define MAYBE_NoRewritingEventsWhenOff NoRewritingEventsWhenOff |
| 84 #endif |
| 85 |
| 79 // This test turns the touch exploration mode off and confirms that events | 86 // This test turns the touch exploration mode off and confirms that events |
| 80 // aren't modified. | 87 // aren't modified. |
| 81 IN_PROC_BROWSER_TEST_F(TouchExplorationTest, NoRewritingEventsWhenOff) { | 88 IN_PROC_BROWSER_TEST_F(TouchExplorationTest, MAYBE_NoRewritingEventsWhenOff) { |
| 82 SwitchTouchExplorationMode(false); | 89 SwitchTouchExplorationMode(false); |
| 83 ui::test::EventGenerator generator(root_window_); | 90 ui::test::EventGenerator generator(root_window_); |
| 84 | 91 |
| 85 base::TimeDelta initial_time = Now(); | 92 base::TimeDelta initial_time = Now(); |
| 86 ui::TouchEvent initial_press( | 93 ui::TouchEvent initial_press( |
| 87 ui::ET_TOUCH_PRESSED, gfx::Point(99, 200), 1, initial_time); | 94 ui::ET_TOUCH_PRESSED, gfx::Point(99, 200), 1, initial_time); |
| 88 generator.Dispatch(&initial_press); | 95 generator.Dispatch(&initial_press); |
| 89 | 96 |
| 90 // Since the touch exploration controller doesn't know if the user is | 97 // Since the touch exploration controller doesn't know if the user is |
| 91 // double-tapping or not, touch exploration is only initiated if the | 98 // double-tapping or not, touch exploration is only initiated if the |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 242 |
| 236 // Continuing to move the touch exploration finger should send more mouse | 243 // Continuing to move the touch exploration finger should send more mouse |
| 237 // events. | 244 // events. |
| 238 generator.MoveTouchId(gfx::Point(509, 609), 1); | 245 generator.MoveTouchId(gfx::Point(509, 609), 1); |
| 239 EXPECT_EQ(0, event_handler_->num_touch_events()); | 246 EXPECT_EQ(0, event_handler_->num_touch_events()); |
| 240 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled()); | 247 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled()); |
| 241 EXPECT_FALSE(cursor_client->IsCursorVisible()); | 248 EXPECT_FALSE(cursor_client->IsCursorVisible()); |
| 242 } | 249 } |
| 243 | 250 |
| 244 } // namespace ui | 251 } // namespace ui |
| OLD | NEW |