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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(&web_view_ids); |
257 if (status_tmp.IsError() && status_tmp.code() != kChromeNotReachable) { | 257 if (status_tmp.IsError() && status_tmp.code() != kChromeNotReachable) { |
258 status.AddDetails( | 258 status.AddDetails( |
259 "failed to check if window was closed: " + status_tmp.message()); | 259 "failed to check if window was closed: " + status_tmp.message()); |
260 } else if (!ContainsValue(web_view_ids, session->window)) { | 260 } else if (!base::ContainsValue(web_view_ids, session->window)) { |
261 status = Status(kOk); | 261 status = Status(kOk); |
262 } | 262 } |
263 } | 263 } |
264 if (status.IsError()) { | 264 if (status.IsError()) { |
265 const BrowserInfo* browser_info = session->chrome->GetBrowserInfo(); | 265 const BrowserInfo* browser_info = session->chrome->GetBrowserInfo(); |
266 status.AddDetails("Session info: " + browser_info->browser_name + "=" + | 266 status.AddDetails("Session info: " + browser_info->browser_name + "=" + |
267 browser_info->browser_version); | 267 browser_info->browser_version); |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 namespace internal { | 329 namespace internal { |
330 | 330 |
331 void CreateSessionOnSessionThreadForTesting(const std::string& id) { | 331 void CreateSessionOnSessionThreadForTesting(const std::string& id) { |
332 SetThreadLocalSession(base::WrapUnique(new Session(id))); | 332 SetThreadLocalSession(base::WrapUnique(new Session(id))); |
333 } | 333 } |
334 | 334 |
335 } // namespace internal | 335 } // namespace internal |
OLD | NEW |