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

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

Issue 138873003: [chromedriver] Write command line file to both /data/local and /data/local/tmp for Chrome on Androi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sets debug app Created 6 years, 10 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 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 std::string command = "pm clear " + package; 153 std::string command = "pm clear " + package;
154 Status status = ExecuteHostShellCommand(device_serial, command, &response); 154 Status status = ExecuteHostShellCommand(device_serial, command, &response);
155 if (!status.IsOk()) 155 if (!status.IsOk())
156 return status; 156 return status;
157 if (response.find("Success") == std::string::npos) 157 if (response.find("Success") == std::string::npos)
158 return Status(kUnknownError, "Failed to clear data for " + package + 158 return Status(kUnknownError, "Failed to clear data for " + package +
159 " on device " + device_serial + ": " + response); 159 " on device " + device_serial + ": " + response);
160 return Status(kOk); 160 return Status(kOk);
161 } 161 }
162 162
163 Status AdbImpl::SetDebugApp(
164 const std::string& device_serial, const std::string& package) {
165 std::string response;
166 return ExecuteHostShellCommand(
167 device_serial, "am set-debug-app --persistent " + package, &response);
168 }
169
163 Status AdbImpl::Launch( 170 Status AdbImpl::Launch(
164 const std::string& device_serial, const std::string& package, 171 const std::string& device_serial, const std::string& package,
165 const std::string& activity) { 172 const std::string& activity) {
166 std::string response; 173 std::string response;
167 Status status = ExecuteHostShellCommand( 174 Status status = ExecuteHostShellCommand(
168 device_serial, 175 device_serial,
169 "am start -W -n " + package + "/" + activity + " -d data:,", 176 "am start -W -n " + package + "/" + activity + " -d data:,",
170 &response); 177 &response);
171 if (!status.IsOk()) 178 if (!status.IsOk())
172 return status; 179 return status;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 246
240 Status AdbImpl::ExecuteHostShellCommand( 247 Status AdbImpl::ExecuteHostShellCommand(
241 const std::string& device_serial, 248 const std::string& device_serial,
242 const std::string& shell_command, 249 const std::string& shell_command,
243 std::string* response) { 250 std::string* response) {
244 return ExecuteCommand( 251 return ExecuteCommand(
245 "host:transport:" + device_serial + "|shell:" + shell_command, 252 "host:transport:" + device_serial + "|shell:" + shell_command,
246 response); 253 response);
247 } 254 }
248 255
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome/adb_impl.h ('k') | chrome/test/chromedriver/chrome/device_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698