summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/ui_controls.h
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-11 16:40:57 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-11 16:40:57 +0000
commit4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10 (patch)
treeeff001f3129de849da6e8658d45072c2ccf494f6 /chrome/browser/automation/ui_controls.h
parent50f2f629605750f033ef3c766498e42783a785f6 (diff)
downloadchromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.zip
chromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.tar.gz
chromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.tar.bz2
A set of tests to exercise chrome menus as well as parts of bookmark
bar view. These are disabled until we straighten out the buildbot that is always logged in. BUG=1318922 TEST=this is just a bunch of tests. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/ui_controls.h')
-rw-r--r--chrome/browser/automation/ui_controls.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/chrome/browser/automation/ui_controls.h b/chrome/browser/automation/ui_controls.h
index 4a655f5..35c0540 100644
--- a/chrome/browser/automation/ui_controls.h
+++ b/chrome/browser/automation/ui_controls.h
@@ -33,10 +33,22 @@
#include <string>
#include <wtypes.h>
+namespace ChromeViews {
+class View;
+}
+
+class Task;
+
namespace ui_controls {
+// Many of the functions in this class include a variant that takes a Task.
+// The version that takes a Task waits until the generated event is processed.
+// Once the generated event is processed the Task is Run (and deleted).
+
// Send a key press with/without modifier keys.
bool SendKeyPress(wchar_t key, bool control, bool shift, bool alt);
+bool SendKeyPressNotifyWhenDone(wchar_t key, bool control, bool shift,
+ bool alt, Task* task);
// Send a key down event. Use VK_CONTROL for ctrl key,
// VK_MENU for alt key and VK_SHIFT for shift key.
@@ -47,6 +59,7 @@ bool SendKeyUp(wchar_t key);
// Simulate a mouse move. (x,y) are absolute
// screen coordinates.
bool SendMouseMove(long x, long y);
+void SendMouseMoveNotifyWhenDone(long x, long y, Task* task);
enum MouseButton {
LEFT = 0,
@@ -54,9 +67,24 @@ enum MouseButton {
RIGHT,
};
+// Used to indicate the state of the button when generating events.
+enum MouseButtonState {
+ UP = 1,
+ DOWN = 2
+};
+
+// Sends a mouse down and or up message.
+bool SendMouseEvents(MouseButton type, int state);
+void SendMouseEventsNotifyWhenDone(MouseButton type, int state, Task* task);
+
// Simulate a single mouse click with given button type.
bool SendMouseClick(MouseButton type);
+// A combination of SendMouseMove to the middle of the view followed by
+// SendMouseEvents.
+void MoveMouseToCenterAndPress(
+ ChromeViews::View* view, MouseButton button, int state, Task* task);
+
} // ui_controls
#endif // CHROME_BROWSER_AUTOMATION_UI_CONTROLS_H__ \ No newline at end of file