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

Unified Diff: chrome/test/webdriver/commands/response.cc

Issue 23526047: Delete old chromedriver code, and remove mongoose webserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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/webdriver/commands/response.h ('k') | chrome/test/webdriver/commands/screenshot_command.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/commands/response.cc
diff --git a/chrome/test/webdriver/commands/response.cc b/chrome/test/webdriver/commands/response.cc
deleted file mode 100644
index 5dcabeccc64878557f7daf096b6057bd48d25384..0000000000000000000000000000000000000000
--- a/chrome/test/webdriver/commands/response.cc
+++ /dev/null
@@ -1,83 +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/webdriver/commands/response.h"
-
-#include "base/base64.h"
-#include "base/json/json_writer.h"
-#include "base/logging.h"
-#include "base/values.h"
-
-using base::DictionaryValue;
-using base::Value;
-
-namespace webdriver {
-
-namespace {
-
-// Error message taken from:
-// http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes
-const char kStatusKey[] = "status";
-const char kValueKey[] = "value";
-const char kMessageKey[] = "message";
-
-} // namespace
-
-Response::Response() {
- SetStatus(kSuccess);
- SetValue(new DictionaryValue());
-}
-
-Response::~Response() {}
-
-ErrorCode Response::GetStatus() const {
- int status;
- if (!data_.GetInteger(kStatusKey, &status))
- NOTREACHED();
- return static_cast<ErrorCode>(status);
-}
-
-void Response::SetStatus(ErrorCode status) {
- data_.SetInteger(kStatusKey, status);
-}
-
-const Value* Response::GetValue() const {
- const Value* out = NULL;
- data_.Get(kValueKey, &out);
- return out;
-}
-
-void Response::SetValue(Value* value) {
- data_.Set(kValueKey, value);
-}
-
-void Response::SetError(Error* error) {
- DictionaryValue* error_dict = new DictionaryValue();
- error_dict->SetString(kMessageKey, error->details());
-
- SetStatus(error->code());
- SetValue(error_dict);
- delete error;
-}
-
-void Response::SetField(const std::string& key, Value* value) {
- data_.Set(key, value);
-}
-
-const Value* Response::GetDictionary() const {
- return &data_;
-}
-
-std::string Response::ToJSON() const {
- std::string json;
- // The |Value| classes do not support int64 and in rare cases we need to
- // return one. We do this by using a double and passing in the special
- // option so that the JSONWriter doesn't add '.0' to the end and confuse
- // the WebDriver client.
- base::JSONWriter::WriteWithOptions(
- &data_, base::JSONWriter::OPTIONS_OMIT_DOUBLE_TYPE_PRESERVATION, &json);
- return json;
-}
-
-} // namespace webdriver
« no previous file with comments | « chrome/test/webdriver/commands/response.h ('k') | chrome/test/webdriver/commands/screenshot_command.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698