| Index: components/mus/ws/event_dispatcher_unittest.cc
|
| diff --git a/components/mus/ws/event_dispatcher_unittest.cc b/components/mus/ws/event_dispatcher_unittest.cc
|
| index 07ffa0f39d67161710f735a75baccb7af8fa4f1b..424d07c7b450b81b5a3034173997acdc532c43cb 100644
|
| --- a/components/mus/ws/event_dispatcher_unittest.cc
|
| +++ b/components/mus/ws/event_dispatcher_unittest.cc
|
| @@ -654,6 +654,26 @@ TEST_F(EventDispatcherTest, AdditionalClientArea) {
|
| EXPECT_FALSE(details->in_nonclient_area);
|
| }
|
|
|
| +TEST_F(EventDispatcherTest, HitTestMask) {
|
| + std::unique_ptr<ServerWindow> child = CreateChildWindow(WindowId(1, 3));
|
| +
|
| + root_window()->SetBounds(gfx::Rect(0, 0, 100, 100));
|
| + child->SetBounds(gfx::Rect(10, 10, 20, 20));
|
| + child->set_hit_test_mask(gfx::Rect(2, 2, 16, 16));
|
| +
|
| + // Press in the masked out area.
|
| + const ui::PointerEvent press_event(ui::MouseEvent(
|
| + ui::ET_MOUSE_PRESSED, gfx::Point(11, 11), gfx::Point(11, 11),
|
| + base::TimeDelta(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON));
|
| + event_dispatcher()->ProcessEvent(press_event);
|
| +
|
| + // Event went through the child window and hit the root.
|
| + std::unique_ptr<DispatchedEventDetails> details =
|
| + test_event_dispatcher_delegate()->GetAndAdvanceDispatchedEventDetails();
|
| + EXPECT_EQ(root_window(), details->window);
|
| + EXPECT_FALSE(details->in_nonclient_area);
|
| +}
|
| +
|
| TEST_F(EventDispatcherTest, DontFocusOnSecondDown) {
|
| std::unique_ptr<ServerWindow> child1 = CreateChildWindow(WindowId(1, 3));
|
| std::unique_ptr<ServerWindow> child2 = CreateChildWindow(WindowId(1, 4));
|
|
|