Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(681)

Unified Diff: chrome/test/webdriver/commands/create_session.cc

Issue 6507015: Implement the target locator commands for ChromeDriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 d8f51120cbe67b9812282ed0f9676837634b47a5..e052bb27819c5e558e65433dcceda07ed642597b 100644
--- a/chrome/test/webdriver/commands/create_session.cc
+++ b/chrome/test/webdriver/commands/create_session.cc
@@ -16,28 +16,19 @@
namespace webdriver {
void CreateSession::ExecutePost(Response* const response) {
- SessionManager* session_manager = SessionManager::GetInstance();
- Session* session = session_manager->Create();
- if (!session) {
- SET_WEBDRIVER_ERROR(response,
- "Failed to create session",
- kInternalServerError);
- return;
- }
-
- std::string session_id = session->id();
+ Session* session = new Session();
if (!session->Init()) {
- session_manager->Delete(session_id);
SET_WEBDRIVER_ERROR(response,
"Failed to initialize session",
kInternalServerError);
return;
}
- VLOG(1) << "Created session " << session_id;
+ SessionManager* session_manager = SessionManager::GetInstance();
+ VLOG(1) << "Created session " << session->id();
std::ostringstream stream;
stream << "http://" << session_manager->GetAddress() << "/session/"
- << session_id;
+ << session->id();
response->set_status(kSeeOther);
response->set_value(Value::CreateStringValue(stream.str()));
}

Powered by Google App Engine
This is Rietveld 408576698