| Index: chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
|
| diff --git a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
|
| index 96a2790b6ad014fbfc71678572c46c08adc79721..f6464d8bb9eba1d2c5b14e8f8c2225a23257d358 100644
|
| --- a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
|
| +++ b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
|
| @@ -63,9 +63,10 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) {
|
| {
|
| // Without any custom shapes, the event should be targeted correctly to the
|
| // window.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40),
|
| - gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(40, 40), gfx::Point(40, 40),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| @@ -78,9 +79,10 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) {
|
| {
|
| // With an empty custom shape, all events within the window should fall
|
| // through to the root window.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40),
|
| - gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(40, 40), gfx::Point(40, 40),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| @@ -103,18 +105,20 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) {
|
| {
|
| // With the custom shape, the events that don't fall within the custom shape
|
| // will go through to the root window.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40),
|
| - gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(40, 40), gfx::Point(40, 40),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| EXPECT_EQ(root_window(), move.target());
|
|
|
| // But events within the shape will still reach the window.
|
| - ui::MouseEvent move2(ui::ET_MOUSE_MOVED, gfx::Point(80, 80),
|
| - gfx::Point(80, 80), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move2(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(80, 80), gfx::Point(80, 80),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| details = event_processor()->OnEventFromSource(&move2);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| EXPECT_EQ(window, move2.target());
|
| @@ -133,9 +137,10 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) {
|
| {
|
| // Without any custom shapes, an event within the window bounds should be
|
| // targeted correctly to the window.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(40, 40),
|
| - gfx::Point(40, 40), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(40, 40), gfx::Point(40, 40),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| @@ -145,9 +150,10 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) {
|
| // Without any custom shapes, an event that falls just outside the window
|
| // bounds should also be targeted correctly to the window, because of the
|
| // targeter installed on the root-window.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
|
| - gfx::Point(10, 10), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| @@ -161,9 +167,10 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) {
|
| {
|
| // With the custom shape, the events that don't fall within the custom shape
|
| // will go through to the root window.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
|
| - gfx::Point(10, 10), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| @@ -174,9 +181,10 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) {
|
| // app window for events just outside its bounds.
|
| app_window()->UpdateShape(scoped_ptr<SkRegion>());
|
| {
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
|
| - gfx::Point(10, 10), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| @@ -191,9 +199,10 @@ TEST_F(ShapedAppWindowTargeterTest, ResizeInsetsWithinBounds) {
|
| {
|
| // An event in the center of the window should always have
|
| // |window| as its target.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(80, 80),
|
| - gfx::Point(80, 80), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(80, 80), gfx::Point(80, 80),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| @@ -203,9 +212,10 @@ TEST_F(ShapedAppWindowTargeterTest, ResizeInsetsWithinBounds) {
|
| // Without an EasyResizeTargeter on the container, an event
|
| // inside the window and within 5px of an edge should have
|
| // |window| as its target.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(32, 37),
|
| - gfx::Point(32, 37), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(32, 37), gfx::Point(32, 37),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| @@ -232,9 +242,10 @@ TEST_F(ShapedAppWindowTargeterTest, ResizeInsetsWithinBounds) {
|
| // RenderWidgetHostViewAura, we cannot differentiate the two cases. Fix
|
| // the test environment so that the test can assert that non-border events
|
| // bubble down to a child of |window|.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(80, 80),
|
| - gfx::Point(80, 80), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(80, 80), gfx::Point(80, 80),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| @@ -244,9 +255,10 @@ TEST_F(ShapedAppWindowTargeterTest, ResizeInsetsWithinBounds) {
|
| // With an EasyResizeTargeter on the container, an event
|
| // inside the window and within 5px of an edge should have
|
| // |window| as its target.
|
| - ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(32, 37),
|
| - gfx::Point(32, 37), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent move(
|
| + ui::ET_MOUSE_MOVED, gfx::Point(32, 37), gfx::Point(32, 37),
|
| + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
|
| + ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
|
|