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

Unified Diff: chrome_frame/test/simulate_input.cc

Issue 15944007: Fix cross-window focus in Chrome Frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: only open popups once Created 7 years, 7 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
« no previous file with comments | « chrome_frame/test/navigation_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/simulate_input.cc
diff --git a/chrome_frame/test/simulate_input.cc b/chrome_frame/test/simulate_input.cc
index 6317d1419d5957d70dfd2172c206ab28ae91ddea..3dca6f185e6ab793346b5233fe4ec08091e85930 100644
--- a/chrome_frame/test/simulate_input.cc
+++ b/chrome_frame/test/simulate_input.cc
@@ -7,6 +7,8 @@
#include <atlbase.h>
#include <atlwin.h>
+#include "base/test/test_timeouts.h"
+#include "base/threading/platform_thread.h"
#include "chrome_frame/utils.h"
namespace simulate_input {
@@ -191,6 +193,7 @@ void SetKeyboardFocusToWindow(HWND window) {
}
void SendMouseClick(int x, int y, MouseButton button) {
+ const base::TimeDelta kMessageTimeout = TestTimeouts::tiny_timeout();
// TODO(joshia): Fix this. GetSystemMetrics(SM_CXSCREEN) will
// retrieve screen size of the primarary monitor only. And monitors
// arrangement could be pretty arbitrary.
@@ -208,16 +211,15 @@ void SendMouseClick(int x, int y, MouseButton button) {
input_info.mi.dx = static_cast<LONG>(location_x);
input_info.mi.dy = static_cast<LONG>(location_y);
::SendInput(1, &input_info, sizeof(INPUT));
-
- Sleep(10);
+ base::PlatformThread::Sleep(kMessageTimeout);
input_info.mi.dwFlags = button_flag | MOUSEEVENTF_ABSOLUTE;
::SendInput(1, &input_info, sizeof(INPUT));
-
- Sleep(10);
+ base::PlatformThread::Sleep(kMessageTimeout);
input_info.mi.dwFlags = (button_flag << 1) | MOUSEEVENTF_ABSOLUTE;
::SendInput(1, &input_info, sizeof(INPUT));
+ base::PlatformThread::Sleep(kMessageTimeout);
}
void SendMouseClick(HWND window, int x, int y, MouseButton button) {
« no previous file with comments | « chrome_frame/test/navigation_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698