Index: ui/aura/window_unittest.cc |
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc |
index d9557191603233d169d986b32305cfcce9066bd7..e13dcdb8364fe507534230afee413fb8fda24e2e 100644 |
--- a/ui/aura/window_unittest.cc |
+++ b/ui/aura/window_unittest.cc |
@@ -268,6 +268,25 @@ TEST_F(WindowTest, Contains) { |
EXPECT_FALSE(child2.Contains(&child1)); |
} |
+TEST_F(WindowTest, ContainsPointInRoot) { |
+ scoped_ptr<Window> w( |
+ CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(10, 10, 5, 5), NULL)); |
+ EXPECT_FALSE(w->ContainsPointInRoot(gfx::Point(9, 9))); |
+ EXPECT_TRUE(w->ContainsPointInRoot(gfx::Point(10, 10))); |
+ EXPECT_TRUE(w->ContainsPointInRoot(gfx::Point(14, 14))); |
+ EXPECT_FALSE(w->ContainsPointInRoot(gfx::Point(15, 15))); |
+ EXPECT_FALSE(w->ContainsPointInRoot(gfx::Point(20, 20))); |
+} |
+ |
+TEST_F(WindowTest, ContainsPoint) { |
+ scoped_ptr<Window> w( |
+ CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(10, 10, 5, 5), NULL)); |
+ EXPECT_TRUE(w->ContainsPoint(gfx::Point(0, 0))); |
+ EXPECT_TRUE(w->ContainsPoint(gfx::Point(4, 4))); |
+ EXPECT_FALSE(w->ContainsPoint(gfx::Point(5, 5))); |
+ EXPECT_FALSE(w->ContainsPoint(gfx::Point(10, 10))); |
+} |
+ |
TEST_F(WindowTest, ConvertPointToWindow) { |
// Window::ConvertPointToWindow is mostly identical to |
// Layer::ConvertPointToLayer, except NULL values for |source| are permitted, |