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

Unified Diff: chrome/test/nacl/nacl_browsertest_util.cc

Issue 2503453003: Remove all calls to domAutomationController.setAutomationId.
Patch Set: Fix nacl_browsertest_util.cc Created 3 years, 5 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/nacl/nacl_browsertest_util.cc
diff --git a/chrome/test/nacl/nacl_browsertest_util.cc b/chrome/test/nacl/nacl_browsertest_util.cc
index 1b2730f454f272fa3c792c4620ebef78919c8882..24e8494aed459517bc5d8b684e975ebbcb9a410d 100644
--- a/chrome/test/nacl/nacl_browsertest_util.cc
+++ b/chrome/test/nacl/nacl_browsertest_util.cc
@@ -25,26 +25,14 @@ typedef content::TestMessageHandler::MessageResponse MessageResponse;
MessageResponse StructuredMessageHandler::HandleMessage(
const std::string& json) {
base::JSONReader reader(base::JSON_ALLOW_TRAILING_COMMAS);
- // Automation messages are stringified before they are sent because the
- // automation channel cannot handle arbitrary objects. This means we
- // need to decode the json twice to get the original message.
std::unique_ptr<base::Value> value = reader.ReadToValue(json);
if (!value.get())
return InternalError("Could parse automation JSON: " + json +
" because " + reader.GetErrorMessage());
- std::string temp;
- if (!value->GetAsString(&temp))
- return InternalError("Message was not a string: " + json);
-
- value = reader.ReadToValue(temp);
- if (!value.get())
- return InternalError("Could not parse message JSON: " + temp +
- " because " + reader.GetErrorMessage());
-
base::DictionaryValue* msg;
if (!value->GetAsDictionary(&msg))
- return InternalError("Message was not an object: " + temp);
+ return InternalError("Message was not an object: " + json);
std::string type;
if (!msg->GetString("type", &type))

Powered by Google App Engine
This is Rietveld 408576698