summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/ui_controls.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 21:16:51 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 21:16:51 +0000
commitc2cb8549159ac80ce1d587445513fae5942e568d (patch)
tree2376250eadf7133a3b3bd8b622c037ccfb88d848 /chrome/browser/automation/ui_controls.h
parent5be7a2069980722b87e8288b3e59a574a80620cc (diff)
downloadchromium_src-c2cb8549159ac80ce1d587445513fae5942e568d.zip
chromium_src-c2cb8549159ac80ce1d587445513fae5942e568d.tar.gz
chromium_src-c2cb8549159ac80ce1d587445513fae5942e568d.tar.bz2
Linux: more interactive tests porting.
The most noteworthy change here is the implementation of SendMouseMove() and SendMouseClick() in ui_controls. I've combed the interwebs and I don't think it's possible to figure out the GdkWindow that is showing for a given (x,y) coordinate pair (except perhaps by delving into X), so we have to just send clicks to wherever the pointer lies. This is unfortunate in that it means we have to move the pointer, wait for it to get where it's going, and only then make the click. But on the bright side there's this super helpful function called gdk_display_warp_pointer() which makes moving the mouse a breeze. BUG=19076 Review URL: http://codereview.chromium.org/174113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23880 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/ui_controls.h')
-rw-r--r--chrome/browser/automation/ui_controls.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/chrome/browser/automation/ui_controls.h b/chrome/browser/automation/ui_controls.h
index 3460ec3..0df639f 100644
--- a/chrome/browser/automation/ui_controls.h
+++ b/chrome/browser/automation/ui_controls.h
@@ -46,15 +46,9 @@ bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, 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.
-// Refer MSDN for more virtual key codes.
-bool SendKeyDown(wchar_t key);
-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);
+bool SendMouseMoveNotifyWhenDone(long x, long y, Task* task);
enum MouseButton {
LEFT = 0,
@@ -73,8 +67,9 @@ 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(gfx::NativeWindow window, const gfx::Point& point,
- MouseButton type);
+// The click will be sent to whichever window is under the cursor, so make sure
+// the cursor is where you want it before calling this.
+bool SendMouseClick(const gfx::Point& point, MouseButton type);
// A combination of SendMouseMove to the middle of the view followed by
// SendMouseEvents.