Remove usage of gfx in unit tests (issue #1632)

This commit is contained in:
Marshall Greenblatt 2016-11-14 13:47:31 -05:00
parent 53b3f1c274
commit b462c19db1
2 changed files with 5 additions and 10 deletions

View File

@ -1341,6 +1341,8 @@ if (is_mac) {
cef_unittests_sources = [
"tests/cefclient/browser/client_app_browser.cc",
"tests/cefclient/browser/client_app_browser.h",
"tests/cefclient/browser/geometry_util.cc",
"tests/cefclient/browser/geometry_util.h",
"tests/cefclient/browser/main_message_loop.cc",
"tests/cefclient/browser/main_message_loop.h",
"tests/cefclient/browser/main_message_loop_external_pump.cc",

View File

@ -4,14 +4,13 @@
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/events/keycodes/keyboard_code_conversion.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/rect.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_logging.h"
#include "include/cef_v8.h"
#include "include/wrapper/cef_closure_task.h"
#include "include/wrapper/cef_stream_resource_handler.h"
#include "tests/cefclient/browser/geometry_util.h"
#include "tests/cefclient/browser/resource_util.h"
#include "tests/unittests/routing_test_handler.h"
@ -1063,17 +1062,11 @@ class OSRTestHandler : public RoutingTestHandler,
}
CefRect GetScaledRect(const CefRect& rect) const {
const gfx::Rect& gfx_rect = gfx::ConvertRectToPixel(
scale_factor_,
gfx::Rect(rect.x, rect.y, rect.width, rect.height));
return CefRect(gfx_rect.x(), gfx_rect.y(),
gfx_rect.width(), gfx_rect.height());
return client::LogicalToDevice(rect, scale_factor_);
}
int GetScaledInt(int value) const {
const gfx::Point& gfx_point = gfx::ConvertPointToPixel(
scale_factor_, gfx::Point(value, 0));
return gfx_point.x();
return client::LogicalToDevice(value, scale_factor_);
}
CefRect GetExpectedRect(int index) {