From 1d000681ef18ea1ebd39a19bf17a7bfccd3ed352 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Mon, 23 Aug 2010 16:21:28 +0000 Subject: Adds ui_test_utils::SendAndWaitForKeyPress and converts callers (where appropriate) to use it. Hopefully this will help isolate why tests are failing on bot. BUG=none TEST=none; test only change. Review URL: http://codereview.chromium.org/3117030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57064 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/ui_test_utils.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'chrome/test/ui_test_utils.h') diff --git a/chrome/test/ui_test_utils.h b/chrome/test/ui_test_utils.h index 8173348..8ca8b02 100644 --- a/chrome/test/ui_test_utils.h +++ b/chrome/test/ui_test_utils.h @@ -10,8 +10,8 @@ #include #include -#include "gfx/native_widget_types.h" #include "base/basictypes.h" +#include "base/keyboard_codes.h" #include "base/message_loop.h" #include "base/scoped_temp_dir.h" #include "base/string16.h" @@ -21,6 +21,7 @@ #include "chrome/common/notification_type.h" #include "chrome/common/notification_service.h" #include "chrome/test/automation/dom_element_proxy.h" +#include "gfx/native_widget_types.h" class AppModalDialog; class BookmarkModel; @@ -188,6 +189,16 @@ void RegisterAndWait(NotificationObserver* observer, // Blocks until |model| finishes loading. void WaitForBookmarkModelToLoad(BookmarkModel* model); +// Sends a key press blocking until the key press is received or the test times +// out. This uses ui_controls::SendKeyPress, see it for details. Returns true +// if the event was successfully sent and received. +bool SendKeyPressSync(gfx::NativeWindow window, + base::KeyboardCode key, + bool control, + bool shift, + bool alt, + bool command) WARN_UNUSED_RESULT; + // Run a message loop only for the specified amount of time. class TimedMessageLoopRunner { public: -- cgit v1.1