summaryrefslogtreecommitdiffstats
path: root/chrome/test/webdriver/commands/create_session.cc
diff options
context:
space:
mode:
authorhnguyen@chromium.org <hnguyen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-17 20:14:20 +0000
committerhnguyen@chromium.org <hnguyen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-17 20:14:20 +0000
commitc4bdfe6586f6dd43c69102e4306872da504a1942 (patch)
tree0dd0299c8870fd65c5b185b8fde5e6156b2edaa2 /chrome/test/webdriver/commands/create_session.cc
parent16f91e72d16cdb3bf529e025ba12ccb7fb6830b0 (diff)
downloadchromium_src-c4bdfe6586f6dd43c69102e4306872da504a1942.zip
chromium_src-c4bdfe6586f6dd43c69102e4306872da504a1942.tar.gz
chromium_src-c4bdfe6586f6dd43c69102e4306872da504a1942.tar.bz2
In ChromeDriver, allow user to specify location of Chrome executable.
BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6982016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/webdriver/commands/create_session.cc')
-rw-r--r--chrome/test/webdriver/commands/create_session.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/test/webdriver/commands/create_session.cc b/chrome/test/webdriver/commands/create_session.cc
index 4c9d51b..c2f37e2 100644
--- a/chrome/test/webdriver/commands/create_session.cc
+++ b/chrome/test/webdriver/commands/create_session.cc
@@ -31,9 +31,9 @@ CreateSession::~CreateSession() {}
bool CreateSession::DoesPost() { return true; }
void CreateSession::ExecutePost(Response* const response) {
- SessionManager* session_manager = SessionManager::GetInstance();
DictionaryValue *added_options = NULL, *desiredCapabilities = NULL;
CommandLine options(CommandLine::NO_PROGRAM);
+ FilePath user_browser_exe;
if (!GetDictionaryParameter("desiredCapabilities", &desiredCapabilities)) {
desiredCapabilities = NULL;
@@ -59,12 +59,14 @@ void CreateSession::ExecutePost(Response* const response) {
}
++i;
}
+ FilePath::StringType path;
+ desiredCapabilities->GetString("chrome.binary", &path);
+ user_browser_exe = FilePath(path);
}
// Session manages its own liftime, so do not call delete.
Session* session = new Session();
- ErrorCode code = session->Init(session_manager->chrome_dir(),
- options);
+ ErrorCode code = session->Init(user_browser_exe, options);
if (code == kBrowserCouldNotBeFound) {
SET_WEBDRIVER_ERROR(response,
@@ -110,6 +112,7 @@ void CreateSession::ExecutePost(Response* const response) {
VLOG(1) << "Created session " << session->id();
std::ostringstream stream;
+ SessionManager* session_manager = SessionManager::GetInstance();
stream << "http://" << session_manager->GetAddress() << "/session/"
<< session->id();
response->SetStatus(kSeeOther);