| 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 76e8d2d61ac14286df39f62406af7cc1091edbeb..c31127b6b28de0e31be2db91df362eb8bc76243f 100644
|
| --- a/chrome/test/automation/automation_json_requests.cc
|
| +++ b/chrome/test/automation/automation_json_requests.cc
|
| @@ -18,6 +18,9 @@
|
| #include "chrome/common/automation_messages.h"
|
| #include "chrome/test/automation/automation_proxy.h"
|
|
|
| +using base::DictionaryValue;
|
| +using base::ListValue;
|
| +
|
| namespace {
|
|
|
| bool SendAutomationJSONRequest(AutomationMessageSender* sender,
|
| @@ -609,3 +612,39 @@ bool SendGetChromeDriverAutomationVersion(
|
| return false;
|
| return reply_dict.GetInteger("version", version);
|
| }
|
| +
|
| +bool SendGetExtensionsInfoJSONRequest(
|
| + AutomationMessageSender* sender,
|
| + ListValue* extensions_list,
|
| + std::string* error_msg) {
|
| + DictionaryValue dict;
|
| + dict.SetString("command", "GetExtensionsInfo");
|
| + DictionaryValue reply_dict;
|
| + if (!SendAutomationJSONRequest(sender, dict, &reply_dict, error_msg))
|
| + return false;
|
| + ListValue* extensions_list_swap;
|
| + if (!reply_dict.GetList("extensions", &extensions_list_swap)) {
|
| + *error_msg = "Missing or invalid 'extensions'";
|
| + return false;
|
| + }
|
| + extensions_list->Swap(extensions_list_swap);
|
| + return true;
|
| +}
|
| +
|
| +bool SendInstallExtensionJSONRequest(
|
| + AutomationMessageSender* sender,
|
| + const FilePath& path,
|
| + std::string* extension_id,
|
| + std::string* error_msg) {
|
| + DictionaryValue dict;
|
| + dict.SetString("command", "InstallExtension");
|
| + dict.SetString("path", path.value());
|
| + DictionaryValue reply_dict;
|
| + if (!SendAutomationJSONRequest(sender, dict, &reply_dict, error_msg))
|
| + return false;
|
| + if (!reply_dict.GetString("id", extension_id)) {
|
| + *error_msg = "Missing or invalid 'id'";
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
|
|