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 "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 ash::AccessibilityDelegate* ad = | 27 ash::AccessibilityDelegate* ad = |
28 ash::Shell::GetInstance()->accessibility_delegate(); | 28 ash::Shell::GetInstance()->accessibility_delegate(); |
29 if (on != ad->IsSpokenFeedbackEnabled()) | 29 if (on != ad->IsSpokenFeedbackEnabled()) |
30 ad->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE); | 30 ad->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE); |
31 } | 31 } |
32 | 32 |
33 private: | 33 private: |
34 DISALLOW_COPY_AND_ASSIGN(TouchExplorationTest); | 34 DISALLOW_COPY_AND_ASSIGN(TouchExplorationTest); |
35 }; | 35 }; |
36 | 36 |
37 IN_PROC_BROWSER_TEST_F(TouchExplorationTest, PRE_ToggleOnOff) { | 37 //IN_PROC_BROWSER_TEST_F(TouchExplorationTest, PRE_ToggleOnOff) { |
38 // TODO (mfomitchev): If the test is run by itself, there is a resize at the | 38 // TODO (mfomitchev): If the test is run by itself, there is a resize at the |
39 // very beginning. An in-progress resize creates a "resize lock" in | 39 // very beginning. An in-progress resize creates a "resize lock" in |
40 // RenderWidgetHostViewAura, which calls | 40 // RenderWidgetHostViewAura, which calls |
41 // WindowEventDispatcher::HoldPointerMoves(), which prevents mouse events from | 41 // WindowEventDispatcher::HoldPointerMoves(), which prevents mouse events from |
42 // coming through. Adding a PRE_ test ensures the resize completes before the | 42 // coming through. Adding a PRE_ test ensures the resize completes before the |
43 // actual test is executed. sadrul@ says the resize shouldn't be even | 43 // actual test is executed. sadrul@ says the resize shouldn't be even |
44 // happening, so this needs to be looked at further. | 44 // happening, so this needs to be looked at further. |
45 } | 45 //} |
46 | 46 |
47 // This test turns the touch exploration mode on/off and confirms that events | 47 // This test turns the touch exploration mode on/off and confirms that events |
48 // get rewritten when the touch exploration mode is on, and aren't affected | 48 // get rewritten when the touch exploration mode is on, and aren't affected |
49 // after the touch exploration mode is turned off. | 49 // after the touch exploration mode is turned off. |
50 IN_PROC_BROWSER_TEST_F(TouchExplorationTest, ToggleOnOff) { | 50 IN_PROC_BROWSER_TEST_F(TouchExplorationTest, ToggleOnOff) { |
51 aura::Window* root_window = ash::Shell::GetInstance()->GetPrimaryRootWindow(); | 51 aura::Window* root_window = ash::Shell::GetInstance()->GetPrimaryRootWindow(); |
52 scoped_ptr<ui::test::TestEventHandler> | 52 scoped_ptr<ui::test::TestEventHandler> |
53 event_handler(new ui::test::TestEventHandler()); | 53 event_handler(new ui::test::TestEventHandler()); |
54 root_window->AddPreTargetHandler(event_handler.get()); | 54 root_window->AddPreTargetHandler(event_handler.get()); |
55 SwitchTouchExplorationMode(true); | 55 SwitchTouchExplorationMode(true); |
(...skipping 14 matching lines...) Expand all Loading... |
70 SwitchTouchExplorationMode(true); | 70 SwitchTouchExplorationMode(true); |
71 generator.PressTouchId(2); | 71 generator.PressTouchId(2); |
72 EXPECT_GT(event_handler->num_mouse_events(), 0); | 72 EXPECT_GT(event_handler->num_mouse_events(), 0); |
73 EXPECT_EQ(0, event_handler->num_touch_events()); | 73 EXPECT_EQ(0, event_handler->num_touch_events()); |
74 | 74 |
75 SwitchTouchExplorationMode(false); | 75 SwitchTouchExplorationMode(false); |
76 root_window->RemovePreTargetHandler(event_handler.get()); | 76 root_window->RemovePreTargetHandler(event_handler.get()); |
77 } | 77 } |
78 | 78 |
79 } // namespace ui | 79 } // namespace ui |
OLD | NEW |