Commit d1e68f46 authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

Fix expectations for Windows for MouseExitOnCaptureGrab, and re-enable.

On Windows, Chrome doesn't generate a synthetic mouse exit event,
see crbug.com/394672.

Change-Id: I1b8ae0e43061f2c555c317cfd1f2f683b79db738
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2316843
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793804}
parent 7eed20fe
...@@ -1718,14 +1718,15 @@ TEST_F(WidgetCaptureTest, MAYBE_SystemModalWindowReleasesCapture) { ...@@ -1718,14 +1718,15 @@ TEST_F(WidgetCaptureTest, MAYBE_SystemModalWindowReleasesCapture) {
// Regression test for http://crbug.com/382421 (Linux-Aura issue). // Regression test for http://crbug.com/382421 (Linux-Aura issue).
// TODO(pkotwicz): Make test pass on CrOS and Windows. // TODO(pkotwicz): Make test pass on CrOS and Windows.
// TODO(tapted): Investigate for toolkit-views on Mac http;//crbug.com/441064. // TODO(tapted): Investigate for toolkit-views on Mac http;//crbug.com/441064.
#if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_APPLE) #if defined(OS_CHROMEOS) || defined(OS_APPLE)
#define MAYBE_MouseExitOnCaptureGrab DISABLED_MouseExitOnCaptureGrab #define MAYBE_MouseExitOnCaptureGrab DISABLED_MouseExitOnCaptureGrab
#else #else
#define MAYBE_MouseExitOnCaptureGrab MouseExitOnCaptureGrab #define MAYBE_MouseExitOnCaptureGrab MouseExitOnCaptureGrab
#endif #endif
// Test that a synthetic mouse exit is sent to the widget which was handling // Test that a synthetic mouse exit is sent to the widget which was handling
// mouse events when a different widget grabs capture. // mouse events when a different widget grabs capture. Except for Windows,
// which does not send a synthetic mouse exit.
TEST_F(WidgetCaptureTest, MAYBE_MouseExitOnCaptureGrab) { TEST_F(WidgetCaptureTest, MAYBE_MouseExitOnCaptureGrab) {
Widget widget1; Widget widget1;
Widget::InitParams params1 = Widget::InitParams params1 =
...@@ -1754,9 +1755,15 @@ TEST_F(WidgetCaptureTest, MAYBE_MouseExitOnCaptureGrab) { ...@@ -1754,9 +1755,15 @@ TEST_F(WidgetCaptureTest, MAYBE_MouseExitOnCaptureGrab) {
widget2.SetCapture(nullptr); widget2.SetCapture(nullptr);
EXPECT_EQ(0, mouse_view1->EnteredCalls()); EXPECT_EQ(0, mouse_view1->EnteredCalls());
// Grabbing native capture on Windows generates a ui::ET_MOUSE_EXITED event // On Windows, Chrome doesn't synthesize a separate mouse exited event.
// in addition to the one generated by Chrome. // Instead, it uses ::TrackMouseEvent to get notified of the mouse leaving.
EXPECT_LT(0, mouse_view1->ExitedCalls()); // Calling SetCapture does not cause Windows to generate a WM_MOUSELEAVE
// event. See WindowEventDispatcher::OnOtherRootGotCapture() for more info.
#if defined(OS_WIN)
EXPECT_EQ(0, mouse_view1->ExitedCalls());
#else
EXPECT_EQ(1, mouse_view1->ExitedCalls());
#endif // OS_WIN
} }
namespace { namespace {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment