| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/commands.h" | 5 #include "chrome/test/chromedriver/commands.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (!session->detach) { | 246 if (!session->detach) { |
| 247 Status quit_status = session->chrome->Quit(); | 247 Status quit_status = session->chrome->Quit(); |
| 248 if (quit_status.IsError()) | 248 if (quit_status.IsError()) |
| 249 message += ", but failed to kill browser:" + quit_status.message(); | 249 message += ", but failed to kill browser:" + quit_status.message(); |
| 250 } | 250 } |
| 251 status = Status(kUnknownError, message, status); | 251 status = Status(kUnknownError, message, status); |
| 252 } else if (status.code() == kDisconnected) { | 252 } else if (status.code() == kDisconnected) { |
| 253 // Some commands, like clicking a button or link which closes the | 253 // Some commands, like clicking a button or link which closes the |
| 254 // window, may result in a kDisconnected error code. | 254 // window, may result in a kDisconnected error code. |
| 255 std::list<std::string> web_view_ids; | 255 std::list<std::string> web_view_ids; |
| 256 Status status_tmp = session->chrome->GetWebViewIds(&web_view_ids); | 256 Status status_tmp = session->chrome->GetWebViewIds( |
| 257 &web_view_ids, session->w3c_compliant); |
| 257 if (status_tmp.IsError() && status_tmp.code() != kChromeNotReachable) { | 258 if (status_tmp.IsError() && status_tmp.code() != kChromeNotReachable) { |
| 258 status.AddDetails( | 259 status.AddDetails( |
| 259 "failed to check if window was closed: " + status_tmp.message()); | 260 "failed to check if window was closed: " + status_tmp.message()); |
| 260 } else if (!base::ContainsValue(web_view_ids, session->window)) { | 261 } else if (!base::ContainsValue(web_view_ids, session->window)) { |
| 261 status = Status(kOk); | 262 status = Status(kOk); |
| 262 } | 263 } |
| 263 } | 264 } |
| 264 if (status.IsError()) { | 265 if (status.IsError()) { |
| 265 const BrowserInfo* browser_info = session->chrome->GetBrowserInfo(); | 266 const BrowserInfo* browser_info = session->chrome->GetBrowserInfo(); |
| 266 status.AddDetails("Session info: " + browser_info->browser_name + "=" + | 267 status.AddDetails("Session info: " + browser_info->browser_name + "=" + |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 } | 327 } |
| 327 } | 328 } |
| 328 | 329 |
| 329 namespace internal { | 330 namespace internal { |
| 330 | 331 |
| 331 void CreateSessionOnSessionThreadForTesting(const std::string& id) { | 332 void CreateSessionOnSessionThreadForTesting(const std::string& id) { |
| 332 SetThreadLocalSession(base::WrapUnique(new Session(id))); | 333 SetThreadLocalSession(base::WrapUnique(new Session(id))); |
| 333 } | 334 } |
| 334 | 335 |
| 335 } // namespace internal | 336 } // namespace internal |
| OLD | NEW |