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

Unified Diff: chrome/test/automation/automation_json_requests.cc

Issue 6705004: Return the full cookie details in TestingAutomationProvider and pass around (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 9 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/automation/automation_json_requests.h ('k') | chrome/test/webdriver/WEBDRIVER_TESTS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/automation_json_requests.cc
diff --git a/chrome/test/automation/automation_json_requests.cc b/chrome/test/automation/automation_json_requests.cc
index 7ac9369c34dbef49cfbaaef2865ad6550a75e5de..cf0f4b5f624d4cc8b2f05a7939789f8a4011e193 100644
--- a/chrome/test/automation/automation_json_requests.cc
+++ b/chrome/test/automation/automation_json_requests.cc
@@ -227,6 +227,26 @@ bool SendGetTabTitleJSONRequest(
bool SendGetCookiesJSONRequest(
AutomationMessageSender* sender,
+ const std::string& url,
+ ListValue** cookies) {
+ DictionaryValue dict;
+ dict.SetString("command", "GetCookies");
+ dict.SetString("url", url);
+ DictionaryValue reply_dict;
+ if (!SendAutomationJSONRequest(sender, dict, &reply_dict))
+ return false;
+ Value* cookies_unscoped_value;
+ if (!reply_dict.Remove("cookies", &cookies_unscoped_value))
+ return false;
+ scoped_ptr<Value> cookies_value(cookies_unscoped_value);
+ if (!cookies_value->IsType(Value::TYPE_LIST))
+ return false;
+ *cookies = static_cast<ListValue*>(cookies_value.release());
+ return true;
+}
+
+bool SendGetCookiesJSONRequestDeprecated(
+ AutomationMessageSender* sender,
int browser_index,
const std::string& url,
std::string* cookies) {
@@ -242,6 +262,18 @@ bool SendGetCookiesJSONRequest(
bool SendDeleteCookieJSONRequest(
AutomationMessageSender* sender,
+ const std::string& url,
+ const std::string& cookie_name) {
+ DictionaryValue dict;
+ dict.SetString("command", "DeleteCookie");
+ dict.SetString("url", url);
+ dict.SetString("name", cookie_name);
+ DictionaryValue reply_dict;
+ return SendAutomationJSONRequest(sender, dict, &reply_dict);
+}
+
+bool SendDeleteCookieJSONRequestDeprecated(
+ AutomationMessageSender* sender,
int browser_index,
const std::string& url,
const std::string& cookie_name) {
@@ -256,6 +288,18 @@ bool SendDeleteCookieJSONRequest(
bool SendSetCookieJSONRequest(
AutomationMessageSender* sender,
+ const std::string& url,
+ DictionaryValue* cookie_dict) {
+ DictionaryValue dict;
+ dict.SetString("command", "SetCookie");
+ dict.SetString("url", url);
+ dict.Set("cookie", cookie_dict->DeepCopy());
+ DictionaryValue reply_dict;
+ return SendAutomationJSONRequest(sender, dict, &reply_dict);
+}
+
+bool SendSetCookieJSONRequestDeprecated(
+ AutomationMessageSender* sender,
int browser_index,
const std::string& url,
const std::string& cookie) {
« no previous file with comments | « chrome/test/automation/automation_json_requests.h ('k') | chrome/test/webdriver/WEBDRIVER_TESTS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698