Index: ash/first_run/first_run_helper_unittest.cc |
diff --git a/ash/first_run/first_run_helper_unittest.cc b/ash/first_run/first_run_helper_unittest.cc |
index 6952dd6152ce522d7bf480e9ab54c341e6c2d219..a86c064c7ae0a6712e9a5650dbdbe43332b7fa48 100644 |
--- a/ash/first_run/first_run_helper_unittest.cc |
+++ b/ash/first_run/first_run_helper_unittest.cc |
@@ -137,10 +137,12 @@ TEST_F(FirstRunHelperTest, ModalWindowDoesNotBlock) { |
overlay_window->Focus(); |
EXPECT_TRUE(overlay_window->HasFocus()); |
int mouse_events; |
- overlay_window->SetEventFilter(new CountingEventHandler(&mouse_events)); |
+ CountingEventHandler handler(&mouse_events); |
+ overlay_window->AddPreTargetHandler(&handler); |
GetEventGenerator().PressLeftButton(); |
GetEventGenerator().ReleaseLeftButton(); |
EXPECT_EQ(mouse_events, 2); |
+ overlay_window->RemovePreTargetHandler(&handler); |
} |
} // namespace test |