OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_TEST_BASE_INTERACTIVE_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_BASE_INTERACTIVE_TEST_UTILS_H_ |
6 #define CHROME_TEST_BASE_INTERACTIVE_TEST_UTILS_H_ | 6 #define CHROME_TEST_BASE_INTERACTIVE_TEST_UTILS_H_ |
7 | 7 |
8 #include "chrome/browser/ui/view_ids.h" | 8 #include "chrome/browser/ui/view_ids.h" |
9 #include "chrome/test/base/ui_test_utils.h" | 9 #include "chrome/test/base/ui_test_utils.h" |
10 #include "ui/base/test/ui_controls.h" | 10 #include "ui/base/test/ui_controls.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 | 126 |
127 // A combination of SendMouseMove to the middle of the view followed by | 127 // A combination of SendMouseMove to the middle of the view followed by |
128 // SendMouseEvents. Only exposed for toolkit-views. | 128 // SendMouseEvents. Only exposed for toolkit-views. |
129 // Alternatives: ClickOnView() and ui::test::EventGenerator. | 129 // Alternatives: ClickOnView() and ui::test::EventGenerator. |
130 #if defined(TOOLKIT_VIEWS) | 130 #if defined(TOOLKIT_VIEWS) |
131 void MoveMouseToCenterAndPress(views::View* view, | 131 void MoveMouseToCenterAndPress(views::View* view, |
132 ui_controls::MouseButton button, | 132 ui_controls::MouseButton button, |
133 int state, | 133 int state, |
134 const base::Closure& task); | 134 const base::Closure& task); |
| 135 |
| 136 // Returns the center of |view| in screen coordinates. |
| 137 gfx::Point GetCenterInScreenCoordinates(const views::View* view); |
135 #endif | 138 #endif |
136 | 139 |
137 namespace internal { | 140 namespace internal { |
138 | 141 |
139 // A utility function to send a mouse click event in a closure. It's shared by | 142 // A utility function to send a mouse click event in a closure. It's shared by |
140 // ui_controls_linux.cc and ui_controls_mac.cc | 143 // ui_controls_linux.cc and ui_controls_mac.cc |
141 void ClickTask(ui_controls::MouseButton button, | 144 void ClickTask(ui_controls::MouseButton button, |
142 int state, | 145 int state, |
143 const base::Closure& followup); | 146 const base::Closure& followup); |
144 | 147 |
145 } // namespace internal | 148 } // namespace internal |
146 | 149 |
147 } // namespace ui_test_utils | 150 } // namespace ui_test_utils |
148 | 151 |
149 #endif // CHROME_TEST_BASE_INTERACTIVE_TEST_UTILS_H_ | 152 #endif // CHROME_TEST_BASE_INTERACTIVE_TEST_UTILS_H_ |
OLD | NEW |