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

Side by Side Diff: chrome/test/webdriver/webdriver_error.cc

Issue 6992015: Fix minor issues in ChromeDriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/webdriver/session_manager.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/webdriver/webdriver_error.h" 5 #include "chrome/test/webdriver/webdriver_error.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 namespace webdriver { 9 namespace webdriver {
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 std::string Error::ToString() const { 66 std::string Error::ToString() const {
67 std::string error; 67 std::string error;
68 if (code_ != kUnknownError) { 68 if (code_ != kUnknownError) {
69 error += ErrorCodeToString(code_); 69 error += ErrorCodeToString(code_);
70 error += ": "; 70 error += ": ";
71 } 71 }
72 if (details_.length()) { 72 if (details_.length()) {
73 error += details_; 73 error += details_;
74 } 74 }
75
76 // Only include a stacktrace on Linux. Windows and Mac have all symbols
77 // stripped in release builds.
78 #if defined(OS_LINUX)
75 size_t count = 0; 79 size_t count = 0;
76 trace_.Addresses(&count); 80 trace_.Addresses(&count);
77 if (count > 0) { 81 if (count > 0) {
78 std::ostringstream ostream; 82 std::ostringstream ostream;
79 trace_.OutputToStream(&ostream); 83 trace_.OutputToStream(&ostream);
80 error += "\n"; 84 error += "\n";
81 error += ostream.str(); 85 error += ostream.str();
82 } 86 }
87 #endif
83 return error; 88 return error;
84 } 89 }
85 90
86 ErrorCode Error::code() const { 91 ErrorCode Error::code() const {
87 return code_; 92 return code_;
88 } 93 }
89 94
90 const std::string& Error::details() const { 95 const std::string& Error::details() const {
91 return details_; 96 return details_;
92 } 97 }
93 98
94 const base::debug::StackTrace& Error::trace() const { 99 const base::debug::StackTrace& Error::trace() const {
95 return trace_; 100 return trace_;
96 } 101 }
97 102
98 } // namespace webdriver 103 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/session_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698