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

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

Issue 7714004: base: Add AsList() function to Value API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos Created 9 years, 4 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
Index: chrome/test/automation/javascript_execution_controller.cc
diff --git a/chrome/test/automation/javascript_execution_controller.cc b/chrome/test/automation/javascript_execution_controller.cc
index 5be6b983fb7647993aa1d6fdae3923c185569679..9a962b68df694edcfd71858473e5a0436268e059 100644
--- a/chrome/test/automation/javascript_execution_controller.cc
+++ b/chrome/test/automation/javascript_execution_controller.cc
@@ -89,11 +89,11 @@ bool JavaScriptExecutionController::ExecuteAndParseHelper(
bool success;
std::string evaluation_error;
Value* evaluation_result_value;
- if (!root_value->IsType(Value::TYPE_LIST)) {
+ ListValue* list = root_value->AsList();
+ if (!list) {
LOG(ERROR) << "JSON response was not in correct format";
return false;
}
- ListValue* list = static_cast<ListValue*>(root_value.get());
if (!list->GetBoolean(0, &success) ||
!list->GetString(1, &evaluation_error) ||
!list->Remove(2, &evaluation_result_value)) {
« no previous file with comments | « chrome/test/automation/automation_json_requests.cc ('k') | chrome/test/automation/javascript_message_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698