diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 16:21:28 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 16:21:28 +0000 |
commit | 1d000681ef18ea1ebd39a19bf17a7bfccd3ed352 (patch) | |
tree | ba970b56596e6ea791b260227a8a7d73ffc696e8 /chrome/test/ui_test_utils.h | |
parent | 6679aafaaa6a213759623e4a056281d209158523 (diff) | |
download | chromium_src-1d000681ef18ea1ebd39a19bf17a7bfccd3ed352.zip chromium_src-1d000681ef18ea1ebd39a19bf17a7bfccd3ed352.tar.gz chromium_src-1d000681ef18ea1ebd39a19bf17a7bfccd3ed352.tar.bz2 |
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
Diffstat (limited to 'chrome/test/ui_test_utils.h')
-rw-r--r-- | chrome/test/ui_test_utils.h | 13 |
1 files changed, 12 insertions, 1 deletions
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 <string> #include <set> -#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: |