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

Unified Diff: ui/aura/window_unittest.cc

Issue 10566009: app_list: Fix shadow bleeds over launcher button and steals mouse events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix aura_demo compilation 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_delegate.h ('k') | ui/views/widget/native_widget_aura.h » ('j') | 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..f0da477a3cb2ca069d24735b60e3674f98f0b6e3 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -4,6 +4,8 @@
#include "ui/aura/window.h"
+#include <utility>
+
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/stringprintf.h"
@@ -322,6 +324,26 @@ TEST_F(WindowTest, HitTest) {
// TODO(beng): clip Window to parent.
}
+TEST_F(WindowTest, HitTestMask) {
+ Window w1(new MaskedWindowDelegate(gfx::Rect(5, 6, 20, 30)));
+ w1.Init(ui::LAYER_NOT_DRAWN);
+ w1.SetBounds(gfx::Rect(10, 20, 50, 60));
+ w1.Show();
+ w1.SetParent(NULL);
+
+ // Points inside the mask.
+ EXPECT_TRUE(w1.HitTest(gfx::Point(5, 6))); // top-left
+ EXPECT_TRUE(w1.HitTest(gfx::Point(15, 21))); // center
+ EXPECT_TRUE(w1.HitTest(gfx::Point(24, 35))); // bottom-right
+
+ // Points outside the mask.
+ EXPECT_FALSE(w1.HitTest(gfx::Point(0, 0)));
+ EXPECT_FALSE(w1.HitTest(gfx::Point(60, 80)));
+ EXPECT_FALSE(w1.HitTest(gfx::Point(4, 6)));
+ EXPECT_FALSE(w1.HitTest(gfx::Point(5, 5)));
+ EXPECT_FALSE(w1.HitTest(gfx::Point(25, 36)));
+}
+
TEST_F(WindowTest, GetEventHandlerForPoint) {
scoped_ptr<Window> w1(
CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(10, 10, 500, 500), NULL));
@@ -1680,7 +1702,7 @@ TEST_F(WindowTest, StackTransientsWhoseLayersHaveNoDelegate) {
}
class TestVisibilityClient : public client::VisibilityClient {
-public:
+ public:
explicit TestVisibilityClient(RootWindow* root_window)
: ignore_visibility_changes_(false) {
client::SetVisibilityClient(root_window, this);
« no previous file with comments | « ui/aura/window_delegate.h ('k') | ui/views/widget/native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698