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

Unified Diff: ui/aura/window_unittest.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: GetNativeScreen Created 4 years, 11 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: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 60792c2a4b726722a03fbf44791b406426fce967..f2699eb8b0e60c8b23bca7eebd9b87dc6910a0cf 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -358,19 +358,19 @@ TEST_F(WindowTest, MoveCursorTo) {
Window* root = root_window();
root->MoveCursorTo(gfx::Point(10, 10));
EXPECT_EQ("10,10",
- gfx::Screen::GetScreenFor(root)->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
w1->MoveCursorTo(gfx::Point(10, 10));
EXPECT_EQ("20,20",
- gfx::Screen::GetScreenFor(root)->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
w11->MoveCursorTo(gfx::Point(10, 10));
EXPECT_EQ("25,25",
- gfx::Screen::GetScreenFor(root)->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
w111->MoveCursorTo(gfx::Point(10, 10));
EXPECT_EQ("30,30",
- gfx::Screen::GetScreenFor(root)->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
w1111->MoveCursorTo(gfx::Point(10, 10));
EXPECT_EQ("35,35",
- gfx::Screen::GetScreenFor(root)->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
}
TEST_F(WindowTest, ContainsMouse) {
@@ -398,8 +398,8 @@ TEST_F(WindowTest, MoveCursorToWithTransformRootWindow) {
// TODO(yoshiki): fix this to build on Windows. See crbug.com/133413.OD
EXPECT_EQ("50,120", QueryLatestMousePositionRequestInHost(host()).ToString());
#endif
- EXPECT_EQ("10,10", gfx::Screen::GetScreenFor(
- root_window())->GetCursorScreenPoint().ToString());
+ EXPECT_EQ("10,10",
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
}
// Tests Window::ConvertPointToWindow() with transform to non-root windows.
@@ -413,21 +413,21 @@ TEST_F(WindowTest, MoveCursorToWithTransformWindow) {
w1->SetTransform(transform1);
w1->MoveCursorTo(gfx::Point(10, 10));
EXPECT_EQ("30,30",
- gfx::Screen::GetScreenFor(w1.get())->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
gfx::Transform transform2;
transform2.Translate(-10, 20);
w1->SetTransform(transform2);
w1->MoveCursorTo(gfx::Point(10, 10));
EXPECT_EQ("10,40",
- gfx::Screen::GetScreenFor(w1.get())->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
gfx::Transform transform3;
transform3.Rotate(90.0);
w1->SetTransform(transform3);
w1->MoveCursorTo(gfx::Point(5, 5));
EXPECT_EQ("5,15",
- gfx::Screen::GetScreenFor(w1.get())->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
gfx::Transform transform4;
transform4.Translate(100.0, 100.0);
@@ -436,7 +436,7 @@ TEST_F(WindowTest, MoveCursorToWithTransformWindow) {
w1->SetTransform(transform4);
w1->MoveCursorTo(gfx::Point(10, 10));
EXPECT_EQ("60,130",
- gfx::Screen::GetScreenFor(w1.get())->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
}
// Test Window::ConvertPointToWindow() with complex transforms to both root and
@@ -453,8 +453,6 @@ TEST_F(WindowTest, MoveCursorToWithComplexTransform) {
scoped_ptr<Window> w1111(
CreateTestWindow(SK_ColorRED, 1111, gfx::Rect(5, 5, 50, 50), w111.get()));
- Window* root = root_window();
-
// The root window expects transforms that produce integer rects.
gfx::Transform root_transform;
root_transform.Translate(60.0, 70.0);
@@ -479,7 +477,7 @@ TEST_F(WindowTest, MoveCursorToWithComplexTransform) {
EXPECT_EQ("169,80", QueryLatestMousePositionRequestInHost(host()).ToString());
#endif
EXPECT_EQ("20,53",
- gfx::Screen::GetScreenFor(root)->GetCursorScreenPoint().ToString());
+ gfx::Screen::GetScreen()->GetCursorScreenPoint().ToString());
}
// Tests that we do not crash when a Window is destroyed by going out of
@@ -1588,7 +1586,7 @@ TEST_F(WindowTest, IgnoreEventsTest) {
TEST_F(WindowTest, Transform) {
gfx::Size size = host()->GetBounds().size();
EXPECT_EQ(gfx::Rect(size),
- gfx::Screen::GetScreenFor(root_window())->GetDisplayNearestPoint(
+ gfx::Screen::GetScreen()->GetDisplayNearestPoint(
gfx::Point()).bounds());
// Rotate it clock-wise 90 degrees.
@@ -1603,7 +1601,7 @@ TEST_F(WindowTest, Transform) {
root_window()->bounds().size().ToString());
EXPECT_EQ(
gfx::Rect(transformed_size).ToString(),
- gfx::Screen::GetScreenFor(root_window())->GetDisplayNearestPoint(
+ gfx::Screen::GetScreen()->GetDisplayNearestPoint(
gfx::Point()).bounds().ToString());
// Host size shouldn't change.

Powered by Google App Engine
This is Rietveld 408576698