| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // Session manages its own liftime, so do not call delete. | 67 // Session manages its own liftime, so do not call delete. |
| 68 Session* session = new Session(session_options); | 68 Session* session = new Session(session_options); |
| 69 error = session->Init(browser_options); | 69 error = session->Init(browser_options); |
| 70 if (error) { | 70 if (error) { |
| 71 response->SetError(error); | 71 response->SetError(error); |
| 72 return; | 72 return; |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Install extensions. | 75 // Install extensions. |
| 76 for (size_t i = 0; i < caps.extensions.size(); ++i) { | 76 for (size_t i = 0; i < caps.extensions.size(); ++i) { |
| 77 Error* error = session->InstallExtension(caps.extensions[i]); | 77 Error* error = session->InstallExtensionDeprecated(caps.extensions[i]); |
| 78 if (error) { | 78 if (error) { |
| 79 response->SetError(error); | 79 response->SetError(error); |
| 80 return; | 80 return; |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 LOG(INFO) << "Created session " << session->id(); | 84 LOG(INFO) << "Created session " << session->id(); |
| 85 // Redirect to a relative URI. Although prohibited by the HTTP standard, | 85 // Redirect to a relative URI. Although prohibited by the HTTP standard, |
| 86 // this is what the IEDriver does. Finding the actual IP address is | 86 // this is what the IEDriver does. Finding the actual IP address is |
| 87 // difficult, and returning the hostname causes perf problems with the python | 87 // difficult, and returning the hostname causes perf problems with the python |
| 88 // bindings on Windows. | 88 // bindings on Windows. |
| 89 std::ostringstream stream; | 89 std::ostringstream stream; |
| 90 stream << SessionManager::GetInstance()->url_base() << "/session/" | 90 stream << SessionManager::GetInstance()->url_base() << "/session/" |
| 91 << session->id(); | 91 << session->id(); |
| 92 response->SetStatus(kSeeOther); | 92 response->SetStatus(kSeeOther); |
| 93 response->SetValue(Value::CreateStringValue(stream.str())); | 93 response->SetValue(Value::CreateStringValue(stream.str())); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace webdriver | 96 } // namespace webdriver |
| OLD | NEW |