| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 std::string result; | 187 std::string result; |
| 188 if (status.IsError()) { | 188 if (status.IsError()) { |
| 189 result = status.message(); | 189 result = status.message(); |
| 190 } else if (value) { | 190 } else if (value) { |
| 191 result = FormatValueForDisplay(*value); | 191 result = FormatValueForDisplay(*value); |
| 192 } | 192 } |
| 193 VLOG(0) << "RESPONSE " << command_name | 193 VLOG(0) << "RESPONSE " << command_name |
| 194 << (result.length() ? " " + result : ""); | 194 << (result.length() ? " " + result : ""); |
| 195 } | 195 } |
| 196 | 196 |
| 197 if (status.IsOk() && session->auto_reporting_enabled) { |
| 198 std::string message = session->GetFirstBrowserError(); |
| 199 if (!message.empty()) |
| 200 status = Status(kUnknownError, message); |
| 201 } |
| 202 |
| 197 cmd_task_runner->PostTask( | 203 cmd_task_runner->PostTask( |
| 198 FROM_HERE, | 204 FROM_HERE, |
| 199 base::Bind(callback_on_cmd, status, base::Passed(&value), session->id)); | 205 base::Bind(callback_on_cmd, status, base::Passed(&value), session->id)); |
| 200 | 206 |
| 201 if (session->quit) { | 207 if (session->quit) { |
| 202 SetThreadLocalSession(scoped_ptr<Session>()); | 208 SetThreadLocalSession(scoped_ptr<Session>()); |
| 203 delete session; | 209 delete session; |
| 204 cmd_task_runner->PostTask(FROM_HERE, terminate_on_cmd); | 210 cmd_task_runner->PostTask(FROM_HERE, terminate_on_cmd); |
| 205 } | 211 } |
| 206 } | 212 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 235 } | 241 } |
| 236 } | 242 } |
| 237 | 243 |
| 238 namespace internal { | 244 namespace internal { |
| 239 | 245 |
| 240 void CreateSessionOnSessionThreadForTesting(const std::string& id) { | 246 void CreateSessionOnSessionThreadForTesting(const std::string& id) { |
| 241 SetThreadLocalSession(make_scoped_ptr(new Session(id))); | 247 SetThreadLocalSession(make_scoped_ptr(new Session(id))); |
| 242 } | 248 } |
| 243 | 249 |
| 244 } // namespace internal | 250 } // namespace internal |
| OLD | NEW |