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

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

Issue 6330012: Cookie commands for the webdriver protocol (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: minor fixes 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
« no previous file with comments | « chrome/test/webdriver/session.h ('k') | chrome/test/webdriver/webdriver_remote_tests.py » ('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 665726ed4ab7c39c5792e946d4cc10176425dfef..b6ea5fd1f97b2329f9b2b52b42d5d7762964a055 100644
--- a/chrome/test/webdriver/session.cc
+++ b/chrome/test/webdriver/session.cc
@@ -23,6 +23,7 @@
#include "chrome/test/test_launcher_utils.h"
#include "chrome/test/webdriver/utility_functions.h"
#include "chrome/test/webdriver/webdriver_key_converter.h"
+#include "googleurl/src/gurl.h"
#include "third_party/webdriver/atoms.h"
namespace webdriver {
@@ -197,6 +198,16 @@ bool Session::GetURL(std::string* url) {
return success;
}
+bool Session::GetURL(GURL* gurl) {
+ bool success = false;
+ RunSessionTask(NewRunnableMethod(
+ automation_.get(),
+ &Automation::GetGURL,
+ gurl,
+ &success));
+ return success;
+}
+
bool Session::GetTabTitle(std::string* tab_title) {
bool success = false;
RunSessionTask(NewRunnableMethod(
@@ -207,6 +218,53 @@ bool Session::GetTabTitle(std::string* tab_title) {
return success;
}
+bool Session::GetCookies(const GURL& url, std::string* cookies) {
+ bool success = false;
+ RunSessionTask(NewRunnableMethod(
+ automation_.get(),
+ &Automation::GetCookies,
+ url,
+ cookies,
+ &success));
+ return success;
+}
+
+bool Session::GetCookieByName(const GURL& url,
+ const std::string& cookie_name,
+ std::string* cookie) {
+ bool success = false;
+ RunSessionTask(NewRunnableMethod(
+ automation_.get(),
+ &Automation::GetCookieByName,
+ url,
+ cookie_name,
+ cookie,
+ &success));
+ return success;
+}
+
+bool Session::DeleteCookie(const GURL& url, const std::string& cookie_name) {
+ bool success = false;
+ RunSessionTask(NewRunnableMethod(
+ automation_.get(),
+ &Automation::DeleteCookie,
+ url,
+ cookie_name,
+ &success));
+ return success;
+}
+
+bool Session::SetCookie(const GURL& url, const std::string& cookie) {
+ bool success = false;
+ RunSessionTask(NewRunnableMethod(
+ automation_.get(),
+ &Automation::SetCookie,
+ url,
+ cookie,
+ &success));
+ return success;
+}
+
void Session::RunSessionTask(Task* task) {
base::WaitableEvent done_event(false, false);
thread_.message_loop_proxy()->PostTask(FROM_HERE, NewRunnableMethod(
« no previous file with comments | « chrome/test/webdriver/session.h ('k') | chrome/test/webdriver/webdriver_remote_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698