| Index: chrome/test/webdriver/commands/create_session.cc
|
| diff --git a/chrome/test/webdriver/commands/create_session.cc b/chrome/test/webdriver/commands/create_session.cc
|
| index 60b7809e0541436085df9d7abe49f5890bbc5035..adc8d28d4e955d92560679b775700e2126131d1c 100644
|
| --- a/chrome/test/webdriver/commands/create_session.cc
|
| +++ b/chrome/test/webdriver/commands/create_session.cc
|
| @@ -73,7 +73,11 @@ void CreateSession::ExecutePost(Response* const response) {
|
| return;
|
| }
|
|
|
| - CommandLine command_line_options(CommandLine::NO_PROGRAM);
|
| + Automation::BrowserOptions browser_options;
|
| + FilePath::StringType path;
|
| + if (capabilities->GetStringWithoutPathExpansion("chrome.binary", &path))
|
| + browser_options.cmdline = CommandLine(FilePath(path));
|
| +
|
| ListValue* switches = NULL;
|
| const char* kCustomSwitchesKey = "chrome.switches";
|
| if (capabilities->GetListWithoutPathExpansion(kCustomSwitchesKey,
|
| @@ -93,11 +97,11 @@ void CreateSession::ExecutePost(Response* const response) {
|
| kBadRequest, "Custom switch is not a string"));
|
| return;
|
| }
|
| - command_line_options.AppendSwitchNative(
|
| + browser_options.cmdline.AppendSwitchNative(
|
| switch_string.substr(0, separator_index),
|
| switch_string_native.substr(separator_index + 1));
|
| } else {
|
| - command_line_options.AppendSwitch(switch_string);
|
| + browser_options.cmdline.AppendSwitch(switch_string);
|
| }
|
| }
|
| } else if (capabilities->HasKey(kCustomSwitchesKey)) {
|
| @@ -105,14 +109,16 @@ void CreateSession::ExecutePost(Response* const response) {
|
| kBadRequest, "Custom switches must be a list"));
|
| return;
|
| }
|
| +
|
| Value* verbose_value;
|
| if (capabilities->GetWithoutPathExpansion("chrome.verbose", &verbose_value)) {
|
| - bool verbose;
|
| - if (verbose_value->GetAsBoolean(&verbose) && verbose) {
|
| + bool verbose = false;
|
| + if (verbose_value->GetAsBoolean(&verbose)) {
|
| // Since logging is shared among sessions, if any session requests verbose
|
| // logging, verbose logging will be enabled for all sessions. It is not
|
| // possible to turn it off.
|
| - logging::SetMinLogLevel(logging::LOG_INFO);
|
| + if (verbose)
|
| + logging::SetMinLogLevel(logging::LOG_INFO);
|
| } else {
|
| response->SetError(new Error(
|
| kBadRequest, "verbose must be a boolean true or false"));
|
| @@ -120,10 +126,8 @@ void CreateSession::ExecutePost(Response* const response) {
|
| }
|
| }
|
|
|
| - FilePath browser_exe;
|
| - FilePath::StringType path;
|
| - if (capabilities->GetStringWithoutPathExpansion("chrome.binary", &path))
|
| - browser_exe = FilePath(path);
|
| + capabilities->GetStringWithoutPathExpansion(
|
| + "chrome.channel", &browser_options.channel_id);
|
|
|
| ScopedTempDir temp_profile_dir;
|
| FilePath temp_user_data_dir;
|
| @@ -186,13 +190,13 @@ void CreateSession::ExecutePost(Response* const response) {
|
| return;
|
| }
|
|
|
| - Session::Options options;
|
| + Session::Options session_options;
|
| Error* error = NULL;
|
| error = GetBooleanCapability(capabilities, "chrome.nativeEvents",
|
| - &options.use_native_events);
|
| + &session_options.use_native_events);
|
| if (!error) {
|
| error = GetBooleanCapability(capabilities, "chrome.loadAsync",
|
| - &options.load_async);
|
| + &session_options.load_async);
|
| }
|
| if (error) {
|
| response->SetError(error);
|
| @@ -200,10 +204,8 @@ void CreateSession::ExecutePost(Response* const response) {
|
| }
|
|
|
| // Session manages its own liftime, so do not call delete.
|
| - Session* session = new Session(options);
|
| - error = session->Init(browser_exe,
|
| - temp_user_data_dir,
|
| - command_line_options);
|
| + Session* session = new Session(session_options);
|
| + error = session->Init(browser_options);
|
| if (error) {
|
| response->SetError(error);
|
| return;
|
|
|