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

Unified Diff: chrome/test/chromedriver/status.cc

Issue 12848005: [chromedriver] Separate stuff of chrome from chromedriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments and fix compile error on mac. Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/chromedriver/status.h ('k') | chrome/test/chromedriver/status_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/status.cc
diff --git a/chrome/test/chromedriver/status.cc b/chrome/test/chromedriver/status.cc
deleted file mode 100644
index c6bd216a96e8f96503f4070afa128d90c6db86c3..0000000000000000000000000000000000000000
--- a/chrome/test/chromedriver/status.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/test/chromedriver/status.h"
-
-#include "base/stringprintf.h"
-
-namespace {
-
-// Returns the string equivalent of the given |ErrorCode|.
-const char* DefaultMessageForStatusCode(StatusCode code) {
- switch (code) {
- case kOk:
- return "ok";
- case kNoSuchElement:
- return "no such element";
- case kUnknownCommand:
- return "unknown command";
- case kStaleElementReference:
- return "stale element reference";
- case kElementNotVisible:
- return "element not visible";
- case kInvalidElementState:
- return "invalid element state";
- case kUnknownError:
- return "unknown error";
- case kJavaScriptError:
- return "javascript error";
- case kXPathLookupError:
- return "xpath lookup error";
- case kNoSuchWindow:
- return "no such window";
- case kInvalidCookieDomain:
- return "invalid cookie domain";
- case kUnexpectedAlertOpen:
- return "unexpected alert open";
- case kNoAlertOpen:
- return "no alert open";
- case kScriptTimeout:
- return "asynchronous script timeout";
- case kInvalidSelector:
- return "invalid selector";
- case kSessionNotCreatedException:
- return "session not created exception";
- case kNoSuchSession:
- return "no such session";
- case kNoSuchFrame:
- return "no such frame";
- case kChromeNotReachable:
- return "chrome not reachable";
- case kDisconnected:
- return "disconnected";
- default:
- return "<unknown>";
- }
-}
-
-} // namespace
-
-Status::Status(StatusCode code)
- : code_(code), msg_(DefaultMessageForStatusCode(code)) {}
-
-Status::Status(StatusCode code, const std::string& details)
- : code_(code),
- 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() {}
-
-void Status::AddDetails(const std::string& details) {
- msg_ += base::StringPrintf("\n (%s)", details.c_str());
-}
-
-bool Status::IsOk() const {
- return code_ == kOk;
-}
-
-bool Status::IsError() const {
- return code_ != kOk;
-}
-
-StatusCode Status::code() const {
- return code_;
-}
-
-const std::string& Status::message() const {
- return msg_;
-}
« no previous file with comments | « chrome/test/chromedriver/status.h ('k') | chrome/test/chromedriver/status_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698