| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return false; | 117 return false; |
| 118 | 118 |
| 119 return *details.ptr() == my_details && !testing::Test::HasFatalFailure(); | 119 return *details.ptr() == my_details && !testing::Test::HasFatalFailure(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // A combination of SendMouseMove to the middle of the view followed by | 122 // A combination of SendMouseMove to the middle of the view followed by |
| 123 // SendMouseEvents. | 123 // SendMouseEvents. |
| 124 void MoveMouseToCenterAndPress( | 124 void MoveMouseToCenterAndPress( |
| 125 #if defined(TOOLKIT_VIEWS) | 125 #if defined(TOOLKIT_VIEWS) |
| 126 views::View* view, | 126 views::View* view, |
| 127 #elif defined(TOOLKIT_GTK) | |
| 128 GtkWidget* widget, | |
| 129 #elif defined(OS_IOS) | 127 #elif defined(OS_IOS) |
| 130 UIView* view, | 128 UIView* view, |
| 131 #elif defined(OS_MACOSX) | 129 #elif defined(OS_MACOSX) |
| 132 NSView* view, | 130 NSView* view, |
| 133 #endif | 131 #endif |
| 134 ui_controls::MouseButton button, | 132 ui_controls::MouseButton button, |
| 135 int state, | 133 int state, |
| 136 const base::Closure& task); | 134 const base::Closure& task); |
| 137 | 135 |
| 138 namespace internal { | 136 namespace internal { |
| 139 | 137 |
| 140 // A utility function to send a mouse click event in a closure. It's shared by | 138 // A utility function to send a mouse click event in a closure. It's shared by |
| 141 // ui_controls_linux.cc and ui_controls_mac.cc | 139 // ui_controls_linux.cc and ui_controls_mac.cc |
| 142 void ClickTask(ui_controls::MouseButton button, | 140 void ClickTask(ui_controls::MouseButton button, |
| 143 int state, | 141 int state, |
| 144 const base::Closure& followup); | 142 const base::Closure& followup); |
| 145 | 143 |
| 146 } // namespace internal | 144 } // namespace internal |
| 147 | 145 |
| 148 } // namespace ui_test_utils | 146 } // namespace ui_test_utils |
| 149 | 147 |
| 150 #endif // CHROME_TEST_BASE_INTERACTIVE_TEST_UTILS_H_ | 148 #endif // CHROME_TEST_BASE_INTERACTIVE_TEST_UTILS_H_ |
| OLD | NEW |