| 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/status.h" | 5 #include "chrome/test/chromedriver/status.h" |
| 6 | 6 |
| 7 namespace { | 7 namespace { |
| 8 | 8 |
| 9 // Returns the string equivalent of the given |ErrorCode|. | 9 // Returns the string equivalent of the given |ErrorCode|. |
| 10 const char* DefaultMessageForStatusCode(StatusCode code) { | 10 const char* DefaultMessageForStatusCode(StatusCode code) { |
| 11 switch (code) { | 11 switch (code) { |
| 12 case kOk: | 12 case kOk: |
| 13 return "ok"; | 13 return "ok"; |
| 14 case kNoSuchElement: | 14 case kNoSuchElement: |
| 15 return "no such element"; | 15 return "no such element"; |
| 16 case kUnknownCommand: | 16 case kUnknownCommand: |
| 17 return "unknown command"; | 17 return "unknown command"; |
| 18 case kStaleElementReference: |
| 19 return "stale element reference"; |
| 18 case kUnknownError: | 20 case kUnknownError: |
| 19 return "unknown error"; | 21 return "unknown error"; |
| 20 case kXPathLookupError: | 22 case kXPathLookupError: |
| 21 return "xpath lookup error"; | 23 return "xpath lookup error"; |
| 22 case kInvalidSelector: | 24 case kInvalidSelector: |
| 23 return "invalid selector"; | 25 return "invalid selector"; |
| 24 case kSessionNotCreatedException: | 26 case kSessionNotCreatedException: |
| 25 return "session not created exception"; | 27 return "session not created exception"; |
| 26 case kNoSuchSession: | 28 case kNoSuchSession: |
| 27 return "no such session"; | 29 return "no such session"; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return code_ != kOk; | 67 return code_ != kOk; |
| 66 } | 68 } |
| 67 | 69 |
| 68 StatusCode Status::code() const { | 70 StatusCode Status::code() const { |
| 69 return code_; | 71 return code_; |
| 70 } | 72 } |
| 71 | 73 |
| 72 const std::string& Status::message() const { | 74 const std::string& Status::message() const { |
| 73 return msg_; | 75 return msg_; |
| 74 } | 76 } |
| OLD | NEW |