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

Unified Diff: ui/aura/window_unittest.cc

Issue 8374005: aura: Try to make Linux host resize code more reliable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reset host win position when wm isn't running Created 9 years, 2 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
« ui/aura/desktop_host_linux.cc ('K') | « ui/aura/desktop_host_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 94233bbda49611bcb0f7159b5b126506b08dd0bb..545897030586c16845f152ad61c184af623e4372 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -947,11 +947,8 @@ TEST_F(WindowTest, IsOrContainsFullscreenWindow) {
// Tests transformation on the desktop.
TEST_F(WindowTest, Transform) {
Desktop* desktop = Desktop::GetInstance();
- gfx::Size size(200, 300);
- desktop->SetHostSize(size);
desktop->ShowDesktop();
-
- EXPECT_EQ(gfx::Rect(size), gfx::Rect(desktop->GetHostSize()));
+ gfx::Size size = desktop->GetHostSize();
EXPECT_EQ(gfx::Rect(size),
gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()));
@@ -962,26 +959,35 @@ TEST_F(WindowTest, Transform) {
desktop->SetTransform(transform);
// The size should be the transformed size.
- EXPECT_EQ(gfx::Rect(0, 0, 300, 200), gfx::Rect(desktop->GetHostSize()));
- EXPECT_EQ(gfx::Rect(0, 0, 300, 200), desktop->bounds());
- EXPECT_EQ(gfx::Rect(0, 0, 300, 200),
- gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()));
+ gfx::Size transformed_size(size.height(), size.width());
+ EXPECT_EQ(transformed_size.ToString(), desktop->GetHostSize().ToString());
+ EXPECT_EQ(gfx::Rect(gfx::Point(), transformed_size).ToString(),
+ desktop->bounds().ToString());
+ EXPECT_EQ(gfx::Rect(gfx::Point(), transformed_size).ToString(),
+ gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()).ToString());
ActivateWindowDelegate d1;
scoped_ptr<Window> w1(
CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(0, 10, 50, 50), NULL));
w1->Show();
+ gfx::Point miss_point(5, 5);
+ transform.TransformPoint(miss_point);
MouseEvent mouseev1(ui::ET_MOUSE_PRESSED,
- gfx::Point(195, 5), ui::EF_LEFT_BUTTON_DOWN);
+ miss_point,
+ ui::EF_LEFT_BUTTON_DOWN);
desktop->DispatchMouseEvent(&mouseev1);
EXPECT_FALSE(w1->GetFocusManager()->GetFocusedWindow());
MouseEvent mouseup(ui::ET_MOUSE_RELEASED,
- gfx::Point(195, 5), ui::EF_LEFT_BUTTON_DOWN);
+ miss_point,
+ ui::EF_LEFT_BUTTON_DOWN);
desktop->DispatchMouseEvent(&mouseup);
+ gfx::Point hit_point(5, 15);
+ transform.TransformPoint(hit_point);
MouseEvent mouseev2(ui::ET_MOUSE_PRESSED,
- gfx::Point(185, 5), ui::EF_LEFT_BUTTON_DOWN);
+ hit_point,
+ ui::EF_LEFT_BUTTON_DOWN);
desktop->DispatchMouseEvent(&mouseev2);
EXPECT_EQ(w1.get(), desktop->active_window());
EXPECT_EQ(w1.get(), w1->GetFocusManager()->GetFocusedWindow());
« ui/aura/desktop_host_linux.cc ('K') | « ui/aura/desktop_host_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698