OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webdriver/commands/create_session.h" | 5 #include "chrome/test/webdriver/commands/create_session.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 | 191 |
192 Session::Options session_options; | 192 Session::Options session_options; |
193 Error* error = NULL; | 193 Error* error = NULL; |
194 error = GetBooleanCapability(capabilities, "chrome.nativeEvents", | 194 error = GetBooleanCapability(capabilities, "chrome.nativeEvents", |
195 &session_options.use_native_events); | 195 &session_options.use_native_events); |
196 if (!error) { | 196 if (!error) { |
197 error = GetBooleanCapability(capabilities, "chrome.loadAsync", | 197 error = GetBooleanCapability(capabilities, "chrome.loadAsync", |
198 &session_options.load_async); | 198 &session_options.load_async); |
199 } | 199 } |
| 200 if (!error) { |
| 201 error = GetBooleanCapability(capabilities, "chrome.detach", |
| 202 &browser_options.detach_process); |
| 203 } |
200 if (error) { | 204 if (error) { |
201 response->SetError(error); | 205 response->SetError(error); |
202 return; | 206 return; |
203 } | 207 } |
204 | 208 |
205 // Session manages its own liftime, so do not call delete. | 209 // Session manages its own liftime, so do not call delete. |
206 Session* session = new Session(session_options); | 210 Session* session = new Session(session_options); |
207 error = session->Init(browser_options); | 211 error = session->Init(browser_options); |
208 if (error) { | 212 if (error) { |
209 response->SetError(error); | 213 response->SetError(error); |
(...skipping 15 matching lines...) Expand all Loading... |
225 // difficult, and returning the hostname causes perf problems with the python | 229 // difficult, and returning the hostname causes perf problems with the python |
226 // bindings on Windows. | 230 // bindings on Windows. |
227 std::ostringstream stream; | 231 std::ostringstream stream; |
228 stream << SessionManager::GetInstance()->url_base() << "/session/" | 232 stream << SessionManager::GetInstance()->url_base() << "/session/" |
229 << session->id(); | 233 << session->id(); |
230 response->SetStatus(kSeeOther); | 234 response->SetStatus(kSeeOther); |
231 response->SetValue(Value::CreateStringValue(stream.str())); | 235 response->SetValue(Value::CreateStringValue(stream.str())); |
232 } | 236 } |
233 | 237 |
234 } // namespace webdriver | 238 } // namespace webdriver |
OLD | NEW |