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

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

Issue 101203012: [chromedriver] Add an error autoreporting feature that automatically raises errors from browser logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from review Created 6 years, 11 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
« no previous file with comments | « chrome/test/chromedriver/client/command_executor.py ('k') | chrome/test/chromedriver/logging.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/client/command_executor.py ('k') | chrome/test/chromedriver/logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698