OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromedriver/session_commands.h" | 5 #include "chrome/test/chromedriver/session_commands.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 } // namespace | 158 } // namespace |
159 | 159 |
160 Status ExecuteInitSession( | 160 Status ExecuteInitSession( |
161 const InitSessionParams& bound_params, | 161 const InitSessionParams& bound_params, |
162 Session* session, | 162 Session* session, |
163 const base::DictionaryValue& params, | 163 const base::DictionaryValue& params, |
164 scoped_ptr<base::Value>* value) { | 164 scoped_ptr<base::Value>* value) { |
165 Status status = InitSessionHelper(bound_params, session, params, value); | 165 Status status = InitSessionHelper(bound_params, session, params, value); |
166 if (status.IsError()) | 166 if (status.IsError()) { |
167 session->quit = true; | 167 session->quit = true; |
| 168 if (session->chrome != NULL) |
| 169 session->chrome->Quit(); |
| 170 } |
168 return status; | 171 return status; |
169 } | 172 } |
170 | 173 |
171 Status ExecuteQuit( | 174 Status ExecuteQuit( |
172 bool allow_detach, | 175 bool allow_detach, |
173 Session* session, | 176 Session* session, |
174 const base::DictionaryValue& params, | 177 const base::DictionaryValue& params, |
175 scoped_ptr<base::Value>* value) { | 178 scoped_ptr<base::Value>* value) { |
176 session->quit = true; | 179 session->quit = true; |
177 if (allow_detach && session->detach) | 180 if (allow_detach && session->detach) |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 } | 603 } |
601 std::string error_msg; | 604 std::string error_msg; |
602 base::FilePath upload; | 605 base::FilePath upload; |
603 Status status = UnzipSoleFile(upload_dir, zip_data, &upload); | 606 Status status = UnzipSoleFile(upload_dir, zip_data, &upload); |
604 if (status.IsError()) | 607 if (status.IsError()) |
605 return Status(kUnknownError, "unable to unzip 'file'", status); | 608 return Status(kUnknownError, "unable to unzip 'file'", status); |
606 | 609 |
607 value->reset(new base::StringValue(upload.value())); | 610 value->reset(new base::StringValue(upload.value())); |
608 return Status(kOk); | 611 return Status(kOk); |
609 } | 612 } |
OLD | NEW |