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

Unified Diff: ui/aura_shell/desktop_event_filter_unittest.cc

Issue 8538017: Fix WindowTest.Transform, and also make it run on Windows. Some of it (the bits that rely on wind... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/window_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/desktop_event_filter_unittest.cc
===================================================================
--- ui/aura_shell/desktop_event_filter_unittest.cc (revision 109647)
+++ ui/aura_shell/desktop_event_filter_unittest.cc (working copy)
@@ -14,6 +14,7 @@
#include "ui/aura/test/test_stacking_client.h"
#include "ui/aura_shell/shell_window_ids.h"
#include "ui/base/hit_test.h"
+#include "ui/gfx/screen.h"
namespace aura_shell {
namespace test {
@@ -315,5 +316,44 @@
EXPECT_EQ(aura::kCursorNull, desktop->last_cursor());
}
+TEST_F(DefaultEventFilterTest, TransformActivate) {
+ aura::Desktop* desktop = aura::Desktop::GetInstance();
+ gfx::Size size = desktop->GetHostSize();
+ EXPECT_EQ(gfx::Rect(size),
+ gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()));
+
+ // Rotate it clock-wise 90 degrees.
+ ui::Transform transform;
+ transform.SetRotate(90.0f);
+ transform.ConcatTranslate(size.width(), 0);
+ desktop->SetTransform(transform);
+
+ aura::test::ActivateWindowDelegate d1;
+ scoped_ptr<aura::Window> w1(
+ CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(0, 10, 50, 50), NULL));
+ w1->Show();
+
+ gfx::Point miss_point(5, 5);
+ transform.TransformPoint(miss_point);
+ aura::MouseEvent mouseev1(ui::ET_MOUSE_PRESSED,
+ miss_point,
+ ui::EF_LEFT_BUTTON_DOWN);
+ desktop->DispatchMouseEvent(&mouseev1);
+ EXPECT_FALSE(w1->GetFocusManager()->GetFocusedWindow());
+ aura::MouseEvent mouseup(ui::ET_MOUSE_RELEASED,
+ miss_point,
+ ui::EF_LEFT_BUTTON_DOWN);
+ desktop->DispatchMouseEvent(&mouseup);
+
+ gfx::Point hit_point(5, 15);
+ transform.TransformPoint(hit_point);
+ aura::MouseEvent mouseev2(ui::ET_MOUSE_PRESSED,
+ hit_point,
+ ui::EF_LEFT_BUTTON_DOWN);
+ desktop->DispatchMouseEvent(&mouseev2);
+ EXPECT_EQ(w1.get(), desktop->active_window());
+ EXPECT_EQ(w1.get(), w1->GetFocusManager()->GetFocusedWindow());
+}
+
} // namespace test
} // namespace aura_shell
« no previous file with comments | « ui/aura/window_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698