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

Unified Diff: chrome/test/webdriver/webdriver_basic_types.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
Index: chrome/test/webdriver/webdriver_basic_types.cc
diff --git a/chrome/test/webdriver/webdriver_basic_types.cc b/chrome/test/webdriver/webdriver_basic_types.cc
deleted file mode 100644
index c72948c72f645256f6b2d4b5bf172831ff82596c..0000000000000000000000000000000000000000
--- a/chrome/test/webdriver/webdriver_basic_types.cc
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright (c) 2011 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/webdriver_basic_types.h"
-
-#include <cmath>
-
-#include "base/values.h"
-
-using base::Value;
-
-namespace webdriver {
-
-Point::Point() { }
-
-Point::Point(double x, double y) : x_(x), y_(y) { }
-
-Point::~Point() { }
-
-void Point::Offset(double x, double y) {
- x_ += x;
- y_ += y;
-}
-
-double Point::x() const {
- return x_;
-}
-
-double Point::y() const {
- return y_;
-}
-
-int Point::rounded_x() const {
- int truncated = static_cast<int>(x_);
- if (std::abs(x_ - truncated) < 0.5)
- return truncated;
- return truncated + 1;
-}
-
-int Point::rounded_y() const {
- int truncated = static_cast<int>(y_);
- if (std::abs(y_ - truncated) < 0.5)
- return truncated;
- return truncated + 1;
-}
-
-Size::Size() { }
-
-Size::Size(double width, double height) : width_(width), height_(height) { }
-
-Size::~Size() { }
-
-double Size::width() const {
- return width_;
-}
-
-double Size::height() const {
- return height_;
-}
-
-Rect::Rect() { }
-
-Rect::Rect(double x, double y, double width, double height)
- : origin_(x, y), size_(width, height) { }
-
-Rect::Rect(const Point& origin, const Size& size)
- : origin_(origin), size_(size) { }
-
-Rect::~Rect() { }
-
-const Point& Rect::origin() const {
- return origin_;
-}
-
-const Size& Rect::size() const {
- return size_;
-}
-
-double Rect::x() const {
- return origin_.x();
-}
-
-double Rect::y() const {
- return origin_.y();
-}
-
-double Rect::width() const {
- return size_.width();
-}
-
-double Rect::height() const {
- return size_.height();
-}
-
-} // namespace webdriver
-
-Value* ValueConversionTraits<webdriver::Point>::CreateValueFrom(
- const webdriver::Point& t) {
- DictionaryValue* value = new DictionaryValue();
- value->SetDouble("x", t.x());
- value->SetDouble("y", t.y());
- return value;
-}
-
-bool ValueConversionTraits<webdriver::Point>::SetFromValue(
- const Value* value, webdriver::Point* t) {
- if (!value->IsType(Value::TYPE_DICTIONARY))
- return false;
-
- const DictionaryValue* dict_value =
- static_cast<const DictionaryValue*>(value);
- double x, y;
- if (!dict_value->GetDouble("x", &x) ||
- !dict_value->GetDouble("y", &y))
- return false;
- *t = webdriver::Point(x, y);
- return true;
-}
-
-bool ValueConversionTraits<webdriver::Point>::CanConvert(const Value* value) {
- webdriver::Point t;
- return SetFromValue(value, &t);
-}
-
-Value* ValueConversionTraits<webdriver::Size>::CreateValueFrom(
- const webdriver::Size& t) {
- DictionaryValue* value = new DictionaryValue();
- value->SetDouble("width", t.width());
- value->SetDouble("height", t.height());
- return value;
-}
-
-bool ValueConversionTraits<webdriver::Size>::SetFromValue(
- const Value* value, webdriver::Size* t) {
- if (!value->IsType(Value::TYPE_DICTIONARY))
- return false;
-
- const DictionaryValue* dict_value =
- static_cast<const DictionaryValue*>(value);
- double width, height;
- if (!dict_value->GetDouble("width", &width) ||
- !dict_value->GetDouble("height", &height))
- return false;
- *t = webdriver::Size(width, height);
- return true;
-}
-
-bool ValueConversionTraits<webdriver::Size>::CanConvert(const Value* value) {
- webdriver::Size t;
- return SetFromValue(value, &t);
-}
-
-Value* ValueConversionTraits<webdriver::Rect>::CreateValueFrom(
- const webdriver::Rect& t) {
- DictionaryValue* value = new DictionaryValue();
- value->SetDouble("left", t.x());
- value->SetDouble("top", t.y());
- value->SetDouble("width", t.width());
- value->SetDouble("height", t.height());
- return value;
-}
-
-bool ValueConversionTraits<webdriver::Rect>::SetFromValue(
- const Value* value, webdriver::Rect* t) {
- if (!value->IsType(Value::TYPE_DICTIONARY))
- return false;
-
- const DictionaryValue* dict_value =
- static_cast<const DictionaryValue*>(value);
- double x, y, width, height;
- if (!dict_value->GetDouble("left", &x) ||
- !dict_value->GetDouble("top", &y) ||
- !dict_value->GetDouble("width", &width) ||
- !dict_value->GetDouble("height", &height))
- return false;
- *t = webdriver::Rect(x, y, width, height);
- return true;
-}
-
-bool ValueConversionTraits<webdriver::Rect>::CanConvert(const Value* value) {
- webdriver::Rect t;
- return SetFromValue(value, &t);
-}
« no previous file with comments | « chrome/test/webdriver/webdriver_basic_types.h ('k') | chrome/test/webdriver/webdriver_capabilities_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698