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

Unified Diff: chrome/test/chromedriver/chrome/adb_impl.cc

Issue 23643005: [chromedriver] Load the automation extension as a component extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 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
« no previous file with comments | « chrome/test/chromedriver/capabilities_unittest.cc ('k') | chrome/test/chromedriver/chrome_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome/adb_impl.cc
diff --git a/chrome/test/chromedriver/chrome/adb_impl.cc b/chrome/test/chromedriver/chrome/adb_impl.cc
index 5432d18f1ef12af3e6d1819b4c4a0252f17b8c62..66c81b3daae3c978d986e0b41c90c91ad3dc59a0 100644
--- a/chrome/test/chromedriver/chrome/adb_impl.cc
+++ b/chrome/test/chromedriver/chrome/adb_impl.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/json/string_escape.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
@@ -118,13 +119,13 @@ Status AdbImpl::SetCommandLineFile(const std::string& device_serial,
const std::string& exec_name,
const std::string& args) {
std::string response;
- if (args.find("'") != std::string::npos)
- return Status(kUnknownError,
- "Chrome command line arguments must not contain single quotes");
+ std::string quoted_command =
+ base::GetDoubleQuotedJson(exec_name + " " + args);
Status status = ExecuteHostShellCommand(
device_serial,
- "echo '" + exec_name +
- " " + args + "'> " + command_line_file + "; echo $?",
+ base::StringPrintf("echo %s > %s; echo $?",
+ quoted_command.c_str(),
+ command_line_file.c_str()),
&response);
if (!status.IsOk())
return status;
« no previous file with comments | « chrome/test/chromedriver/capabilities_unittest.cc ('k') | chrome/test/chromedriver/chrome_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698