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

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: minor cleanup 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
« no previous file with comments | « 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..847bc78d364adf035c84600f32557170fe39d33a 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,9 +959,10 @@ 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::Rect transformed_bounds(0, 0, size.height(), size.width());
+ EXPECT_EQ(transformed_bounds.size(), desktop->GetHostSize());
+ EXPECT_EQ(transformed_bounds, desktop->bounds());
+ EXPECT_EQ(transformed_bounds,
gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()));
oshima 2011/10/21 19:55:45 Just a suggestion. I've been using string to compa
ActivateWindowDelegate d1;
@@ -973,15 +971,18 @@ TEST_F(WindowTest, Transform) {
w1->Show();
MouseEvent mouseev1(ui::ET_MOUSE_PRESSED,
- gfx::Point(195, 5), ui::EF_LEFT_BUTTON_DOWN);
+ gfx::Point(transformed_bounds.width() - 5, 5),
+ 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);
+ gfx::Point(transformed_bounds.width() - 5, 5),
+ ui::EF_LEFT_BUTTON_DOWN);
desktop->DispatchMouseEvent(&mouseup);
MouseEvent mouseev2(ui::ET_MOUSE_PRESSED,
- gfx::Point(185, 5), ui::EF_LEFT_BUTTON_DOWN);
+ gfx::Point(transformed_bounds.width() - 15, 5),
+ ui::EF_LEFT_BUTTON_DOWN);
desktop->DispatchMouseEvent(&mouseev2);
EXPECT_EQ(w1.get(), desktop->active_window());
EXPECT_EQ(w1.get(), w1->GetFocusManager()->GetFocusedWindow());
« no previous file with comments | « ui/aura/desktop_host_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698