| OLD | NEW |
| 1 // Copyright (c) 2010 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/session_manager.h" | 5 #include "chrome/test/webdriver/session_manager.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 27 namespace webdriver { | 27 namespace webdriver { |
| 28 | 28 |
| 29 Session::Session(const std::string& id) | 29 Session::Session(const std::string& id) |
| 30 : thread_(id.c_str()), | 30 : thread_(id.c_str()), |
| 31 id_(id), | 31 id_(id), |
| 32 window_num_(0), | 32 window_num_(0), |
| 33 implicit_wait_(0), | 33 implicit_wait_(0), |
| 34 current_frame_xpath_("") { | 34 current_frame_xpath_("") { |
| 35 } | 35 } |
| 36 | 36 |
| 37 Session::~Session() {} |
| 38 |
| 37 bool Session::Init() { | 39 bool Session::Init() { |
| 38 if (!thread_.Start()) { | 40 if (!thread_.Start()) { |
| 39 LOG(ERROR) << "Cannot start session thread"; | 41 LOG(ERROR) << "Cannot start session thread"; |
| 40 return false; | 42 return false; |
| 41 } | 43 } |
| 42 | 44 |
| 43 bool success = false; | 45 bool success = false; |
| 44 RunSessionTask(NewRunnableMethod( | 46 RunSessionTask(NewRunnableMethod( |
| 45 this, | 47 this, |
| 46 &Session::InitOnSessionThread, | 48 &Session::InitOnSessionThread, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 automation_.reset(new Automation()); | 205 automation_.reset(new Automation()); |
| 204 automation_->Init(success); | 206 automation_->Init(success); |
| 205 } | 207 } |
| 206 | 208 |
| 207 void Session::TerminateOnSessionThread() { | 209 void Session::TerminateOnSessionThread() { |
| 208 automation_->Terminate(); | 210 automation_->Terminate(); |
| 209 automation_.reset(); | 211 automation_.reset(); |
| 210 } | 212 } |
| 211 | 213 |
| 212 } // namespace webdriver | 214 } // namespace webdriver |
| OLD | NEW |