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

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

Issue 330113002: Fixing flaky overscroll and touch exploration mode browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 6 years, 6 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
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/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
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) {
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
40 // RenderWidgetHostViewAura, which calls
41 // WindowEventDispatcher::HoldPointerMoves(), which prevents mouse events from
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
44 // happening, so this needs to be looked at further.
45 }
46
47 // This test turns the touch exploration mode on/off and confirms that events 37 // 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 38 // get rewritten when the touch exploration mode is on, and aren't affected
49 // after the touch exploration mode is turned off. 39 // after the touch exploration mode is turned off.
50 IN_PROC_BROWSER_TEST_F(TouchExplorationTest, ToggleOnOff) { 40 IN_PROC_BROWSER_TEST_F(TouchExplorationTest, ToggleOnOff) {
51 aura::Window* root_window = ash::Shell::GetInstance()->GetPrimaryRootWindow(); 41 aura::Window* root_window = ash::Shell::GetInstance()->GetPrimaryRootWindow();
52 scoped_ptr<ui::test::TestEventHandler> 42 scoped_ptr<ui::test::TestEventHandler>
53 event_handler(new ui::test::TestEventHandler()); 43 event_handler(new ui::test::TestEventHandler());
54 root_window->AddPreTargetHandler(event_handler.get()); 44 root_window->AddPreTargetHandler(event_handler.get());
55 SwitchTouchExplorationMode(true); 45 SwitchTouchExplorationMode(true);
56 aura::test::EventGenerator generator(root_window); 46 aura::test::EventGenerator generator(root_window);
(...skipping 13 matching lines...) Expand all
70 SwitchTouchExplorationMode(true); 60 SwitchTouchExplorationMode(true);
71 generator.PressTouchId(2); 61 generator.PressTouchId(2);
72 EXPECT_GT(event_handler->num_mouse_events(), 0); 62 EXPECT_GT(event_handler->num_mouse_events(), 0);
73 EXPECT_EQ(0, event_handler->num_touch_events()); 63 EXPECT_EQ(0, event_handler->num_touch_events());
74 64
75 SwitchTouchExplorationMode(false); 65 SwitchTouchExplorationMode(false);
76 root_window->RemovePreTargetHandler(event_handler.get()); 66 root_window->RemovePreTargetHandler(event_handler.get());
77 } 67 }
78 68
79 } // namespace ui 69 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | chrome/test/base/in_process_browser_test.cc » ('j') | content/public/test/browser_test_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698