Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: chrome/browser/automation/ui_controls_win.cc

Issue 174201: More interactive test porting for Linux. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fixes Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/ui_controls_win.cc
===================================================================
--- chrome/browser/automation/ui_controls_win.cc (revision 23880)
+++ chrome/browser/automation/ui_controls_win.cc (working copy)
@@ -219,6 +219,15 @@
}
bool SendMouseMoveImpl(long x, long y, Task* task) {
+ // First check if the mouse is already there.
+ POINT current_pos;
+ ::GetCursorPos(&current_pos);
+ if (x == current_pos.x && y == current_pos.y) {
+ if (task)
+ MessageLoop::current()->PostTask(FROM_HERE, task);
+ return true;
+ }
+
INPUT input = { 0 };
int screen_width = ::GetSystemMetrics(SM_CXSCREEN) - 1;
@@ -318,11 +327,11 @@
return SendMouseEventsImpl(type, state, NULL);
}
-void SendMouseEventsNotifyWhenDone(MouseButton type, int state, Task* task) {
- SendMouseEventsImpl(type, state, task);
+bool SendMouseEventsNotifyWhenDone(MouseButton type, int state, Task* task) {
+ return SendMouseEventsImpl(type, state, task);
}
-bool SendMouseClick(const gfx::Point& point, MouseButton type) {
+bool SendMouseClick(MouseButton type) {
return SendMouseEventsImpl(type, UP | DOWN, NULL);
}

Powered by Google App Engine
This is Rietveld 408576698