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

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

Issue 331943003: [ChromeDriver] Added CommandListener interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
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 <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 Status(return_ok_without_session ? kOk : kNoSuchSession), 144 Status(return_ok_without_session ? kOk : kNoSuchSession),
145 base::Passed(scoped_ptr<base::Value>()), 145 base::Passed(scoped_ptr<base::Value>()),
146 std::string())); 146 std::string()));
147 return; 147 return;
148 } 148 }
149 149
150 if (IsVLogOn(0)) { 150 if (IsVLogOn(0)) {
151 VLOG(0) << "COMMAND " << command_name << " " 151 VLOG(0) << "COMMAND " << command_name << " "
152 << FormatValueForDisplay(*params); 152 << FormatValueForDisplay(*params);
153 } 153 }
154
155 Status status = session->OnCommand(std::string(command_name));
klm 2014/06/16 16:11:29 I am concerned that this is only done on session c
johnmoore 2014/06/16 17:28:34 I believe that the window and element commands do
156
157 if (status.IsError())
158 LOG(ERROR) << "Error when notifying listeners of command";
159
154 scoped_ptr<base::Value> value; 160 scoped_ptr<base::Value> value;
155 Status status = command.Run(session, *params, &value); 161 status = command.Run(session, *params, &value);
156 162
157 if (status.IsError() && session->chrome) { 163 if (status.IsError() && session->chrome) {
158 if (!session->quit && session->chrome->HasCrashedWebView()) { 164 if (!session->quit && session->chrome->HasCrashedWebView()) {
159 session->quit = true; 165 session->quit = true;
160 std::string message("session deleted because of page crash"); 166 std::string message("session deleted because of page crash");
161 if (!session->detach) { 167 if (!session->detach) {
162 Status quit_status = session->chrome->Quit(); 168 Status quit_status = session->chrome->Quit();
163 if (quit_status.IsError()) 169 if (quit_status.IsError())
164 message += ", but failed to kill browser:" + quit_status.message(); 170 message += ", but failed to kill browser:" + quit_status.message();
165 } 171 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 249 }
244 } 250 }
245 251
246 namespace internal { 252 namespace internal {
247 253
248 void CreateSessionOnSessionThreadForTesting(const std::string& id) { 254 void CreateSessionOnSessionThreadForTesting(const std::string& id) {
249 SetThreadLocalSession(make_scoped_ptr(new Session(id))); 255 SetThreadLocalSession(make_scoped_ptr(new Session(id)));
250 } 256 }
251 257
252 } // namespace internal 258 } // namespace internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698