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 <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 Loading... |
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 // Notify |session|'s |CommandListener|s of the command. |
| 156 NotifySessionListenersBeforeCommand(session, command_name); |
| 157 |
154 scoped_ptr<base::Value> value; | 158 scoped_ptr<base::Value> value; |
155 Status status = command.Run(session, *params, &value); | 159 Status status = command.Run(session, *params, &value); |
156 | 160 |
157 if (status.IsError() && session->chrome) { | 161 if (status.IsError() && session->chrome) { |
158 if (!session->quit && session->chrome->HasCrashedWebView()) { | 162 if (!session->quit && session->chrome->HasCrashedWebView()) { |
159 session->quit = true; | 163 session->quit = true; |
160 std::string message("session deleted because of page crash"); | 164 std::string message("session deleted because of page crash"); |
161 if (!session->detach) { | 165 if (!session->detach) { |
162 Status quit_status = session->chrome->Quit(); | 166 Status quit_status = session->chrome->Quit(); |
163 if (quit_status.IsError()) | 167 if (quit_status.IsError()) |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 247 } |
244 } | 248 } |
245 | 249 |
246 namespace internal { | 250 namespace internal { |
247 | 251 |
248 void CreateSessionOnSessionThreadForTesting(const std::string& id) { | 252 void CreateSessionOnSessionThreadForTesting(const std::string& id) { |
249 SetThreadLocalSession(make_scoped_ptr(new Session(id))); | 253 SetThreadLocalSession(make_scoped_ptr(new Session(id))); |
250 } | 254 } |
251 | 255 |
252 } // namespace internal | 256 } // namespace internal |
OLD | NEW |