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 c05770b023341dc81068215efe1f080aa0522064..80e58410d18fa3af8800276ccf8c6e6405793f5f 100644 |
--- a/chrome/test/automation/automation_json_requests.cc |
+++ b/chrome/test/automation/automation_json_requests.cc |
@@ -29,11 +29,12 @@ bool SendAutomationJSONRequest(AutomationMessageSender* sender, |
bool success = false; |
int timeout_ms = TestTimeouts::action_max_timeout_ms(); |
base::Time before_sending = base::Time::Now(); |
+ std::string command; |
+ request_dict.GetString("command", &command); |
+ LOG(INFO) << "Sending '" << command << "' command."; |
if (!SendAutomationJSONRequest( |
sender, request, timeout_ms, &reply, &success)) { |
int64 elapsed_ms = (base::Time::Now() - before_sending).InMilliseconds(); |
- std::string command; |
- request_dict.GetString("command", &command); |
if (elapsed_ms >= timeout_ms) { |
*error_msg = base::StringPrintf( |
"Chrome did not respond to '%s'. Request may have timed out. " |
@@ -55,15 +56,12 @@ bool SendAutomationJSONRequest(AutomationMessageSender* sender, |
} |
scoped_ptr<Value> value(base::JSONReader::Read(reply, true)); |
if (!value.get() || !value->IsType(Value::TYPE_DICTIONARY)) { |
- std::string command; |
- request_dict.GetString("command", &command); |
LOG(ERROR) << "JSON request did not return dict: " << command << "\n"; |
return false; |
} |
DictionaryValue* dict = static_cast<DictionaryValue*>(value.get()); |
if (!success) { |
- std::string command, error; |
- request_dict.GetString("command", &command); |
+ std::string error; |
dict->GetString("error", &error); |
*error_msg = base::StringPrintf( |
"Internal Chrome error during '%s': (%s). Request details: (%s).", |