summaryrefslogtreecommitdiffstats
path: root/chrome/test/base/ui_test_utils.h
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 09:30:33 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 09:30:33 +0000
commit536f8082c8e8b492086e7f675bdb477005f770cb (patch)
tree5b22096c355bf4e8327bde51b7dcde0de2e5617b /chrome/test/base/ui_test_utils.h
parent644a10733be94786e8169d035d7f527b105ee529 (diff)
downloadchromium_src-536f8082c8e8b492086e7f675bdb477005f770cb.zip
chromium_src-536f8082c8e8b492086e7f675bdb477005f770cb.tar.gz
chromium_src-536f8082c8e8b492086e7f675bdb477005f770cb.tar.bz2
Original CL (http://codereview.chromium.org/9390038/) somehow got screwed and CQ couldn't patch it. This is exact copy of the original CL to land.
* Move automation/ui_controls to ui/ui_controls * Refactored aura impl so that ui/ui_controls doesn't depend on aura. * Moved MoveMouseToCenterAndPress to ui_test_util.h as it depends on views and can't be declared in ui. * a couple of cleanups: - Renamed gtk_screen_utils.h to _util.h to match other util.h files. - indent fix - remove unnecessary includes. This CL allows a test to use ui_controls without depending on chrome. TBR=sky@chromium.org,erg@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org/9699098 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127138 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/base/ui_test_utils.h')
-rw-r--r--chrome/test/base/ui_test_utils.h34
1 files changed, 31 insertions, 3 deletions
diff --git a/chrome/test/base/ui_test_utils.h b/chrome/test/base/ui_test_utils.h
index d407f08..bdcc21a 100644
--- a/chrome/test/base/ui_test_utils.h
+++ b/chrome/test/base/ui_test_utils.h
@@ -17,7 +17,6 @@
#include "base/process.h"
#include "base/scoped_temp_dir.h"
#include "base/string16.h"
-#include "chrome/browser/automation/ui_controls.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/test/automation/dom_element_proxy.h"
#include "content/public/browser/browser_thread.h"
@@ -28,12 +27,17 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/ui_controls/ui_controls.h"
#include "webkit/glue/window_open_disposition.h"
#if defined(OS_WIN)
#include "base/win/scoped_handle.h"
#endif
+#if defined(TOOLKIT_VIEWS)
+#include "ui/views/view.h"
+#endif
+
class AppModalDialog;
class BookmarkModel;
class Browser;
@@ -268,8 +272,8 @@ bool SendKeyPressAndWait(const Browser* browser,
WARN_UNUSED_RESULT;
// Sends a move event blocking until received. Returns true if the event was
-// successfully received. This uses ui_controls::SendMouse***NotifyWhenDone, see
-// it for details.
+// successfully received. This uses ui_controls::SendMouse***NotifyWhenDone,
+// see it for details.
bool SendMouseMoveSync(const gfx::Point& location) WARN_UNUSED_RESULT;
bool SendMouseEventsSync(ui_controls::MouseButton type,
int state) WARN_UNUSED_RESULT;
@@ -587,6 +591,30 @@ bool TakeRenderWidgetSnapshot(content::RenderWidgetHost* rwh,
bool TakeEntirePageSnapshot(content::RenderViewHost* rvh,
SkBitmap* bitmap) WARN_UNUSED_RESULT;
+// A combination of SendMouseMove to the middle of the view followed by
+// SendMouseEvents.
+void MoveMouseToCenterAndPress(
+#if defined(TOOLKIT_VIEWS)
+ views::View* view,
+#elif defined(TOOLKIT_GTK)
+ GtkWidget* widget,
+#elif defined(OS_MACOSX)
+ NSView* view,
+#endif
+ ui_controls::MouseButton button,
+ int state,
+ const base::Closure& task);
+
+namespace internal {
+
+// A utility function to send a mouse click event in a closure. It's shared by
+// ui_controls_linux.cc and ui_controls_mac.cc
+void ClickTask(ui_controls::MouseButton button,
+ int state,
+ const base::Closure& followup);
+
+} // namespace internal
+
} // namespace ui_test_utils
#endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_