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

Unified Diff: chrome/test/webdriver/automation.h

Issue 6482014: Implement sendKeys webdriver API in ChromeDriver. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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/test/webdriver/automation.h
===================================================================
--- chrome/test/webdriver/automation.h (revision 73909)
+++ chrome/test/webdriver/automation.h (working copy)
@@ -10,12 +10,33 @@
#include "base/task.h"
#include "base/ref_counted.h"
#include "base/scoped_temp_dir.h"
+#include "chrome/common/automation_constants.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/ui_test.h"
+#include "ui/base/keycodes/keyboard_codes.h"
namespace webdriver {
+struct WebKeyEvent {
+ WebKeyEvent(automation::KeyEventTypes type,
+ ui::KeyboardCode key_code,
+ const std::string& unmodified_text,
+ const std::string& modified_text,
+ int modifiers)
+ : type(type),
+ key_code(key_code),
+ unmodified_text(unmodified_text),
+ modified_text(modified_text),
+ modifiers(modifiers) {}
+
+ automation::KeyEventTypes type;
jleyba 2011/02/10 05:52:19 Should these be const?
kkania 2011/02/10 18:17:48 they could be, but I don't see any compelling reas
+ ui::KeyboardCode key_code;
+ std::string unmodified_text;
+ std::string modified_text;
+ int modifiers;
+};
+
// Creates and controls the Chrome instance.
// This class should be created and accessed on a single thread.
// TODO(phajdan.jr): Abstract UITestBase classes, see:
@@ -38,6 +59,10 @@
std::string* result,
bool* success);
+ // Sends a key event to the current browser. Waits until the key has
+ // been processed by the web page.
+ void SendWebKeyEvent(const WebKeyEvent& key_event, bool* success);
+
void NavigateToURL(const std::string& url, bool* success);
void GoForward(bool* success);
void GoBack(bool* success);

Powered by Google App Engine
This is Rietveld 408576698