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

Unified Diff: chrome/test/webdriver/session.cc

Issue 7055004: File upload API in chromedriver (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixing broken build on Windows Created 9 years, 6 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/test/webdriver/session.h ('k') | chrome/test/webdriver/upload.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/session.cc
diff --git a/chrome/test/webdriver/session.cc b/chrome/test/webdriver/session.cc
index c9febbb8d0f10d9581099f086105701ac948df81..fb7a5c818ee2cc570227e2831501e200665cf349 100644
--- a/chrome/test/webdriver/session.cc
+++ b/chrome/test/webdriver/session.cc
@@ -188,6 +188,20 @@ Error* Session::SendKeys(const WebElementId& element, const string16& keys) {
return error;
}
+Error* Session::DragAndDropFilePaths(
+ const gfx::Point& location,
+ const std::vector<FilePath::StringType>& paths) {
+ Error* error = NULL;
+ RunSessionTask(NewRunnableMethod(
+ automation_.get(),
+ &Automation::DragAndDropFilePaths,
+ current_target_.window_id,
+ location,
+ paths,
+ &error));
+ return error;
+}
+
Error* Session::NavigateToURL(const std::string& url) {
Error* error = NULL;
RunSessionTask(NewRunnableMethod(
@@ -917,6 +931,45 @@ Error* Session::WaitForAllTabsToStopLoading() {
return error;
}
+Error* Session::GetAttribute(const WebElementId& element,
+ const std::string& key, Value** value) {
+ std::string script = base::StringPrintf(
+ "return (%s).apply(null, arguments);", atoms::GET_ATTRIBUTE);
+
+ ListValue args;
+ args.Append(element.ToValue());
+ args.Append(Value::CreateStringValue(key));
+
+ Error* error = ExecuteScript(script, &args, value);
+ if (error) {
+ return error;
+ }
+
+ return NULL;
+}
+
+Error* Session::GetClickableLocation(const WebElementId& element,
+ gfx::Point* location) {
+ Error* error = CheckElementPreconditionsForClicking(element);
+ if (error) {
+ return error;
+ }
+
+ error = GetElementLocationInView(element, location);
+ if (error) {
+ return error;
+ }
+
+ gfx::Size size;
+ error = GetElementSize(current_target(), element, &size);
+ if (error) {
+ return error;
+ }
+
+ location->Offset(size.width() / 2, size.height() / 2);
+ return NULL;
+}
+
const std::string& Session::id() const {
return id_;
}
« no previous file with comments | « chrome/test/webdriver/session.h ('k') | chrome/test/webdriver/upload.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698