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