Index: chrome/test/chromedriver/status.cc |
diff --git a/chrome/test/chromedriver/status.cc b/chrome/test/chromedriver/status.cc |
index bd5027952730113170b963a3c136c717b6770c5a..6dad0789b99c104a63ccabcef0502452748f0dfb 100644 |
--- a/chrome/test/chromedriver/status.cc |
+++ b/chrome/test/chromedriver/status.cc |
@@ -4,6 +4,10 @@ |
#include "chrome/test/chromedriver/status.h" |
+#include <vector> |
+ |
+#include "base/string_split.h" |
chrisgao (Use stgao instead)
2012/12/01 08:37:19
It seems unused.
kkania
2013/02/28 21:51:58
Done.
|
+ |
namespace { |
// Returns the string equivalent of the given |ErrorCode|. |
@@ -19,6 +23,8 @@ const char* DefaultMessageForStatusCode(StatusCode code) { |
return "session not created exception"; |
case kNoSuchSession: |
return "no such session"; |
+ case kChromeNotReachable: |
+ return "chrome not reachable"; |
default: |
return "<unknown>"; |
} |
@@ -34,6 +40,21 @@ Status::Status(StatusCode code, const std::string& details) |
msg_(DefaultMessageForStatusCode(code) + std::string(": ") + details) { |
} |
+Status::Status(StatusCode code, const Status& cause) |
+ : code_(code), |
+ msg_(DefaultMessageForStatusCode(code) + std::string("\nfrom ") + |
+ cause.message()) {} |
+ |
+Status::Status(StatusCode code, |
+ const std::string& details, |
+ const Status& cause) |
+ : code_(code), |
+ msg_(DefaultMessageForStatusCode(code) + std::string(": ") + details + |
+ "\nfrom " + cause.message()) { |
+} |
+ |
+Status::~Status() {} |
+ |
bool Status::IsOk() const { |
return code_ == kOk; |
} |