| 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 "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/environment.h" | 8 #include "base/environment.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return Status(kSessionNotCreatedException, status.message()); | 130 return Status(kSessionNotCreatedException, status.message()); |
| 131 | 131 |
| 132 std::list<WebView*> web_views; | 132 std::list<WebView*> web_views; |
| 133 status = chrome->GetWebViews(&web_views); | 133 status = chrome->GetWebViews(&web_views); |
| 134 if (status.IsError() || web_views.empty()) { | 134 if (status.IsError() || web_views.empty()) { |
| 135 chrome->Quit(); | 135 chrome->Quit(); |
| 136 return status.IsError() ? status : | 136 return status.IsError() ? status : |
| 137 Status(kUnknownError, "unable to discover open window in chrome"); | 137 Status(kUnknownError, "unable to discover open window in chrome"); |
| 138 } | 138 } |
| 139 WebView* default_web_view = web_views.front(); | 139 WebView* default_web_view = web_views.front(); |
| 140 status = default_web_view->EnsureAlive(); |
| 141 if (status.IsError()) |
| 142 return status; |
| 140 | 143 |
| 141 std::string chrome_version; | 144 std::string chrome_version; |
| 142 status = CheckChromeVersion(default_web_view, &chrome_version); | 145 status = CheckChromeVersion(default_web_view, &chrome_version); |
| 143 if (status.IsError()) { | 146 if (status.IsError()) { |
| 144 chrome->Quit(); | 147 chrome->Quit(); |
| 145 return status; | 148 return status; |
| 146 } | 149 } |
| 147 | 150 |
| 148 std::string new_id = session_id; | 151 std::string new_id = session_id; |
| 149 if (new_id.empty()) | 152 if (new_id.empty()) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 172 std::string* out_session_id) { | 175 std::string* out_session_id) { |
| 173 std::vector<std::string> session_ids; | 176 std::vector<std::string> session_ids; |
| 174 session_map->GetKeys(&session_ids); | 177 session_map->GetKeys(&session_ids); |
| 175 for (size_t i = 0; i < session_ids.size(); ++i) { | 178 for (size_t i = 0; i < session_ids.size(); ++i) { |
| 176 scoped_ptr<base::Value> unused_value; | 179 scoped_ptr<base::Value> unused_value; |
| 177 std::string unused_session_id; | 180 std::string unused_session_id; |
| 178 quit_command.Run(params, session_ids[i], &unused_value, &unused_session_id); | 181 quit_command.Run(params, session_ids[i], &unused_value, &unused_session_id); |
| 179 } | 182 } |
| 180 return Status(kOk); | 183 return Status(kOk); |
| 181 } | 184 } |
| OLD | NEW |