Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: chrome/test/chromedriver/commands.cc

Issue 12321057: [chromedriver] Implement reconnection to DevTools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698