Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 // Session manages its own liftime, so do not call delete. | 31 // Session manages its own liftime, so do not call delete. |
| 32 Session* session = new Session(); | 32 Session* session = new Session(); |
| 33 if (!session->Init(session_manager->chrome_dir())) { | 33 if (!session->Init(session_manager->chrome_dir())) { |
| 34 SET_WEBDRIVER_ERROR(response, | 34 SET_WEBDRIVER_ERROR(response, |
| 35 "Failed to initialize session", | 35 "Failed to initialize session", |
| 36 kInternalServerError); | 36 kInternalServerError); |
| 37 return; | 37 return; |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool screenshot_on_error; | |
|
kkania
2011/03/17 18:35:11
default to false
Joe
2011/03/18 00:33:32
Done.
| |
| 41 DictionaryValue* capabilities = NULL; | |
| 42 if (GetDictionaryParameter("desiredCapabilities", &capabilities)) { | |
| 43 capabilities->GetBoolean("takeScreenshotOnError", &screenshot_on_error); | |
| 44 } | |
|
kkania
2011/03/17 18:35:11
I didn't mean for you to delete the part of sessio
Joe
2011/03/18 00:33:32
Sorry I mistook the comment as to remove the abili
| |
| 45 | |
| 40 VLOG(1) << "Created session " << session->id(); | 46 VLOG(1) << "Created session " << session->id(); |
| 41 std::ostringstream stream; | 47 std::ostringstream stream; |
| 42 stream << "http://" << session_manager->GetAddress() << "/session/" | 48 stream << "http://" << session_manager->GetAddress() << "/session/" |
| 43 << session->id(); | 49 << session->id(); |
| 44 response->SetStatus(kSeeOther); | 50 response->SetStatus(kSeeOther); |
| 45 response->SetValue(Value::CreateStringValue(stream.str())); | 51 response->SetValue(Value::CreateStringValue(stream.str())); |
| 46 } | 52 } |
| 47 | 53 |
| 48 } // namespace webdriver | 54 } // namespace webdriver |
| OLD | NEW |