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

Unified Diff: ui/aura/window_unittest.cc

Issue 10543174: Aura: Add Window::MoveCursorTo() taking relative location to the window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added test. Created 8 years, 6 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/window.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 5932a4cc74acd96a075b08a5a0587d3d82e03f5b..5036db32472eb40bcc6e46617ed6c699b9c9275d 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -302,6 +302,29 @@ TEST_F(WindowTest, ConvertPointToWindow) {
EXPECT_EQ(reference_point, test_point);
}
+TEST_F(WindowTest, MoveCursorTo) {
+ scoped_ptr<Window> w1(
+ CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(10, 10, 500, 500), NULL));
+ scoped_ptr<Window> w11(
+ CreateTestWindow(SK_ColorGREEN, 11, gfx::Rect(5, 5, 100, 100), w1.get()));
+ scoped_ptr<Window> w111(
+ CreateTestWindow(SK_ColorCYAN, 111, gfx::Rect(5, 5, 75, 75), w11.get()));
+ scoped_ptr<Window> w1111(
+ CreateTestWindow(SK_ColorRED, 1111, gfx::Rect(5, 5, 50, 50), w111.get()));
+
+ RootWindow* root = root_window();
+ root->MoveCursorTo(gfx::Point(10, 10));
+ EXPECT_EQ(gfx::Point(10, 10), root->last_mouse_location());
+ w1->MoveCursorTo(gfx::Point(10, 10));
+ EXPECT_EQ(gfx::Point(20, 20), root->last_mouse_location());
+ w11->MoveCursorTo(gfx::Point(10, 10));
+ EXPECT_EQ(gfx::Point(25, 25), root->last_mouse_location());
+ w111->MoveCursorTo(gfx::Point(10, 10));
+ EXPECT_EQ(gfx::Point(30, 30), root->last_mouse_location());
+ w1111->MoveCursorTo(gfx::Point(10, 10));
+ EXPECT_EQ(gfx::Point(35, 35), root->last_mouse_location());
oshima 2012/06/15 14:06:17 can you also add cases that applies transforms (ro
yoshiki 2012/06/15 15:10:39 Done.
+}
+
TEST_F(WindowTest, HitTest) {
Window w1(new ColorTestWindowDelegate(SK_ColorWHITE));
w1.set_id(1);
« no previous file with comments | « ui/aura/window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698