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

Side by Side Diff: chrome/test/chromedriver/chrome/adb_impl.cc

Issue 106793004: Revert of Stop doing unnecessary UTF-8 to UTF-16 conversions in JSONWriter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/chromedriver/chrome/adb_impl.h" 5 #include "chrome/test/chromedriver/chrome/adb_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/json/string_escape.h" 9 #include "base/json/string_escape.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 return Status(kUnknownError, "Failed to forward ports to device " + 112 return Status(kUnknownError, "Failed to forward ports to device " +
113 device_serial + ": " + response); 113 device_serial + ": " + response);
114 } 114 }
115 115
116 Status AdbImpl::SetCommandLineFile(const std::string& device_serial, 116 Status AdbImpl::SetCommandLineFile(const std::string& device_serial,
117 const std::string& command_line_file, 117 const std::string& command_line_file,
118 const std::string& exec_name, 118 const std::string& exec_name,
119 const std::string& args) { 119 const std::string& args) {
120 std::string response; 120 std::string response;
121 std::string quoted_command = 121 std::string quoted_command =
122 base::GetQuotedJSONString(exec_name + " " + args); 122 base::GetDoubleQuotedJson(exec_name + " " + args);
123 Status status = ExecuteHostShellCommand( 123 Status status = ExecuteHostShellCommand(
124 device_serial, 124 device_serial,
125 base::StringPrintf("echo %s > %s; echo $?", 125 base::StringPrintf("echo %s > %s; echo $?",
126 quoted_command.c_str(), 126 quoted_command.c_str(),
127 command_line_file.c_str()), 127 command_line_file.c_str()),
128 &response); 128 &response);
129 if (!status.IsOk()) 129 if (!status.IsOk())
130 return status; 130 return status;
131 if (response.find("0") == std::string::npos) 131 if (response.find("0") == std::string::npos)
132 return Status(kUnknownError, "Failed to set command line file " + 132 return Status(kUnknownError, "Failed to set command line file " +
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 Status AdbImpl::ExecuteHostShellCommand( 240 Status AdbImpl::ExecuteHostShellCommand(
241 const std::string& device_serial, 241 const std::string& device_serial,
242 const std::string& shell_command, 242 const std::string& shell_command,
243 std::string* response) { 243 std::string* response) {
244 return ExecuteCommand( 244 return ExecuteCommand(
245 "host:transport:" + device_serial + "|shell:" + shell_command, 245 "host:transport:" + device_serial + "|shell:" + shell_command,
246 response); 246 response);
247 } 247 }
248 248
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/capabilities.cc ('k') | components/plugins/renderer/plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698