| Index: ui/aura/window_event_dispatcher_unittest.cc
|
| diff --git a/ui/aura/window_event_dispatcher_unittest.cc b/ui/aura/window_event_dispatcher_unittest.cc
|
| index e6ccbf1e5c716894c06ebb3f364e0db19347e59f..be370e510fa19f8d60de2476c0e764e3fb30e525 100644
|
| --- a/ui/aura/window_event_dispatcher_unittest.cc
|
| +++ b/ui/aura/window_event_dispatcher_unittest.cc
|
| @@ -105,9 +105,9 @@ bool IsFocusedWindow(aura::Window* window) {
|
|
|
| } // namespace
|
|
|
| -typedef test::AuraTestBase WindowEventDispatcherTest;
|
| +using WindowEventDispatcherTest = test::AuraTestBaseWithType;
|
|
|
| -TEST_F(WindowEventDispatcherTest, OnHostMouseEvent) {
|
| +TEST_P(WindowEventDispatcherTest, OnHostMouseEvent) {
|
| // Create two non-overlapping windows so we don't have to worry about which
|
| // is on top.
|
| std::unique_ptr<NonClientDelegate> delegate1(new NonClientDelegate());
|
| @@ -142,7 +142,7 @@ TEST_F(WindowEventDispatcherTest, OnHostMouseEvent) {
|
| EXPECT_TRUE(delegate1->mouse_event_flags() & ui::EF_IS_NON_CLIENT);
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTest, RepostEvent) {
|
| +TEST_P(WindowEventDispatcherTest, RepostEvent) {
|
| // Test RepostEvent in RootWindow. It only works for Mouse Press and touch
|
| // press.
|
| EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown());
|
| @@ -163,7 +163,7 @@ TEST_F(WindowEventDispatcherTest, RepostEvent) {
|
|
|
| // Check that we correctly track the state of the mouse buttons in response to
|
| // button press and release events.
|
| -TEST_F(WindowEventDispatcherTest, MouseButtonState) {
|
| +TEST_P(WindowEventDispatcherTest, MouseButtonState) {
|
| EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown());
|
|
|
| gfx::Point location;
|
| @@ -206,7 +206,7 @@ TEST_F(WindowEventDispatcherTest, MouseButtonState) {
|
| EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown());
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTest, TranslatedEvent) {
|
| +TEST_P(WindowEventDispatcherTest, TranslatedEvent) {
|
| std::unique_ptr<Window> w1(test::CreateTestWindowWithDelegate(
|
| NULL, 1, gfx::Rect(50, 50, 100, 100), root_window()));
|
|
|
| @@ -282,7 +282,7 @@ class TestEventClient : public client::EventClient {
|
|
|
| } // namespace
|
|
|
| -TEST_F(WindowEventDispatcherTest, CanProcessEventsWithinSubtree) {
|
| +TEST_P(WindowEventDispatcherTest, CanProcessEventsWithinSubtree) {
|
| TestEventClient client(root_window());
|
| test::TestWindowDelegate d;
|
|
|
| @@ -337,7 +337,7 @@ TEST_F(WindowEventDispatcherTest, CanProcessEventsWithinSubtree) {
|
| w3->parent()->RemoveChild(w3.get());
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTest, DontIgnoreUnknownKeys) {
|
| +TEST_P(WindowEventDispatcherTest, DontIgnoreUnknownKeys) {
|
| ConsumeKeyHandler handler;
|
| root_window()->AddPreTargetHandler(&handler);
|
|
|
| @@ -369,7 +369,7 @@ TEST_F(WindowEventDispatcherTest, DontIgnoreUnknownKeys) {
|
| root_window()->RemovePreTargetHandler(&handler);
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTest, NoDelegateWindowReceivesKeyEvents) {
|
| +TEST_P(WindowEventDispatcherTest, NoDelegateWindowReceivesKeyEvents) {
|
| std::unique_ptr<Window> w1(CreateNormalWindow(1, root_window(), NULL));
|
| w1->Show();
|
| w1->Focus();
|
| @@ -386,7 +386,7 @@ TEST_F(WindowEventDispatcherTest, NoDelegateWindowReceivesKeyEvents) {
|
|
|
| // Tests that touch-events that are beyond the bounds of the root-window do get
|
| // propagated to the event filters correctly with the root as the target.
|
| -TEST_F(WindowEventDispatcherTest, TouchEventsOutsideBounds) {
|
| +TEST_P(WindowEventDispatcherTest, TouchEventsOutsideBounds) {
|
| ui::test::TestEventHandler handler;
|
| root_window()->AddPreTargetHandler(&handler);
|
|
|
| @@ -408,7 +408,7 @@ TEST_F(WindowEventDispatcherTest, TouchEventsOutsideBounds) {
|
| }
|
|
|
| // Tests that scroll events are dispatched correctly.
|
| -TEST_F(WindowEventDispatcherTest, ScrollEventDispatch) {
|
| +TEST_P(WindowEventDispatcherTest, ScrollEventDispatch) {
|
| base::TimeTicks now = ui::EventTimeForNow();
|
| ui::test::TestEventHandler handler;
|
| root_window()->AddPreTargetHandler(&handler);
|
| @@ -628,7 +628,7 @@ std::string EventTypesToString(const EventFilterRecorder::Events& events) {
|
| // Verifies a repost mouse event targets the window with capture (if there is
|
| // one).
|
| // Flaky on 32-bit Windows bots. http://crbug.com/388290
|
| -TEST_F(WindowEventDispatcherTest, MAYBE(RepostTargetsCaptureWindow)) {
|
| +TEST_P(WindowEventDispatcherTest, MAYBE(RepostTargetsCaptureWindow)) {
|
| // Set capture on |window| generate a mouse event (that is reposted) and not
|
| // over |window| and verify |window| gets it (|window| gets it because it has
|
| // capture).
|
| @@ -648,7 +648,7 @@ TEST_F(WindowEventDispatcherTest, MAYBE(RepostTargetsCaptureWindow)) {
|
| std::string::npos) << EventTypesToString(recorder.events());
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTest, MouseMovesHeld) {
|
| +TEST_P(WindowEventDispatcherTest, MouseMovesHeld) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
|
|
| @@ -775,7 +775,7 @@ TEST_F(WindowEventDispatcherTest, MouseMovesHeld) {
|
| root_window()->RemovePreTargetHandler(&recorder);
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTest, TouchMovesHeld) {
|
| +TEST_P(WindowEventDispatcherTest, TouchMovesHeld) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
|
|
| @@ -834,7 +834,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeld) {
|
|
|
| // Tests that mouse move event has a right location
|
| // when there isn't the target window
|
| -TEST_F(WindowEventDispatcherTest, MouseEventWithoutTargetWindow) {
|
| +TEST_P(WindowEventDispatcherTest, MouseEventWithoutTargetWindow) {
|
| EventFilterRecorder recorder_first;
|
| EventFilterRecorder recorder_second;
|
|
|
| @@ -864,7 +864,7 @@ TEST_F(WindowEventDispatcherTest, MouseEventWithoutTargetWindow) {
|
|
|
| // Tests that a mouse exit is dispatched to the last mouse location when
|
| // the window is hiddden.
|
| -TEST_F(WindowEventDispatcherTest, DispatchMouseExitWhenHidingWindow) {
|
| +TEST_P(WindowEventDispatcherTest, DispatchMouseExitWhenHidingWindow) {
|
| EventFilterRecorder recorder;
|
|
|
| test::TestWindowDelegate delegate;
|
| @@ -891,7 +891,7 @@ TEST_F(WindowEventDispatcherTest, DispatchMouseExitWhenHidingWindow) {
|
| }
|
|
|
| // Verifies that a direct call to ProcessedTouchEvent() does not cause a crash.
|
| -TEST_F(WindowEventDispatcherTest, CallToProcessedTouchEvent) {
|
| +TEST_P(WindowEventDispatcherTest, CallToProcessedTouchEvent) {
|
| test::TestWindowDelegate delegate;
|
| std::unique_ptr<aura::Window> window(CreateTestWindowWithDelegate(
|
| &delegate, 1, gfx::Rect(50, 50, 100, 100), root_window()));
|
| @@ -932,7 +932,7 @@ class HoldPointerOnScrollHandler : public ui::test::TestEventHandler {
|
|
|
| // Tests that touch-move events don't contribute to an in-progress scroll
|
| // gesture if touch-move events are being held by the dispatcher.
|
| -TEST_F(WindowEventDispatcherTest, TouchMovesHeldOnScroll) {
|
| +TEST_P(WindowEventDispatcherTest, TouchMovesHeldOnScroll) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
| test::TestWindowDelegate delegate;
|
| @@ -966,7 +966,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeldOnScroll) {
|
|
|
| // Tests that a 'held' touch-event does contribute to gesture event when it is
|
| // dispatched.
|
| -TEST_F(WindowEventDispatcherTest, HeldTouchMoveContributesToGesture) {
|
| +TEST_P(WindowEventDispatcherTest, HeldTouchMoveContributesToGesture) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
|
|
| @@ -1000,7 +1000,7 @@ TEST_F(WindowEventDispatcherTest, HeldTouchMoveContributesToGesture) {
|
|
|
| // Tests that synthetic mouse events are ignored when mouse
|
| // events are disabled.
|
| -TEST_F(WindowEventDispatcherTest, DispatchSyntheticMouseEvents) {
|
| +TEST_P(WindowEventDispatcherTest, DispatchSyntheticMouseEvents) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
|
|
| @@ -1035,7 +1035,7 @@ TEST_F(WindowEventDispatcherTest, DispatchSyntheticMouseEvents) {
|
| }
|
|
|
| // Tests that a mouse-move event is not synthesized when a mouse-button is down.
|
| -TEST_F(WindowEventDispatcherTest, DoNotSynthesizeWhileButtonDown) {
|
| +TEST_P(WindowEventDispatcherTest, DoNotSynthesizeWhileButtonDown) {
|
| EventFilterRecorder recorder;
|
| test::TestWindowDelegate delegate;
|
| std::unique_ptr<aura::Window> window(CreateTestWindowWithDelegate(
|
| @@ -1072,7 +1072,7 @@ TEST_F(WindowEventDispatcherTest, DoNotSynthesizeWhileButtonDown) {
|
| // the cursor previously outside the window becomes inside, or vice versa.
|
| // Do not synthesize events if the window ignores events or is invisible.
|
| // Flaky on 32-bit Windows bots. http://crbug.com/388272
|
| -TEST_F(WindowEventDispatcherTest,
|
| +TEST_P(WindowEventDispatcherTest,
|
| MAYBE(SynthesizeMouseEventsOnWindowBoundsChanged)) {
|
| test::TestWindowDelegate delegate;
|
| std::unique_ptr<aura::Window> window(CreateTestWindowWithDelegate(
|
| @@ -1126,7 +1126,7 @@ TEST_F(WindowEventDispatcherTest,
|
|
|
| // Tests that a mouse exit is dispatched to the last known cursor location
|
| // when the cursor becomes invisible.
|
| -TEST_F(WindowEventDispatcherTest, DispatchMouseExitWhenCursorHidden) {
|
| +TEST_P(WindowEventDispatcherTest, DispatchMouseExitWhenCursorHidden) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
|
|
| @@ -1162,7 +1162,7 @@ TEST_F(WindowEventDispatcherTest, DispatchMouseExitWhenCursorHidden) {
|
|
|
| // Tests that a synthetic mouse exit is dispatched to the last known cursor
|
| // location after mouse events are disabled on the cursor client.
|
| -TEST_F(WindowEventDispatcherTest,
|
| +TEST_P(WindowEventDispatcherTest,
|
| DispatchSyntheticMouseExitAfterMouseEventsDisabled) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
| @@ -1269,7 +1269,7 @@ class DeletingWindowDelegate : public test::TestWindowDelegate {
|
| DISALLOW_COPY_AND_ASSIGN(DeletingWindowDelegate);
|
| };
|
|
|
| -TEST_F(WindowEventDispatcherTest, DeleteWindowDuringDispatch) {
|
| +TEST_P(WindowEventDispatcherTest, DeleteWindowDuringDispatch) {
|
| // Verifies that we can delete a window during each phase of event handling.
|
| // Deleting the window should not cause a crash, only prevent further
|
| // processing from occurring.
|
| @@ -1339,7 +1339,7 @@ class DetachesParentOnTapDelegate : public test::TestWindowDelegate {
|
|
|
| // Tests that the gesture recognizer is reset for all child windows when a
|
| // window hides. No expectations, just checks that the test does not crash.
|
| -TEST_F(WindowEventDispatcherTest,
|
| +TEST_P(WindowEventDispatcherTest,
|
| GestureRecognizerResetsTargetWhenParentHides) {
|
| std::unique_ptr<Window> w1(CreateNormalWindow(1, root_window(), NULL));
|
| DetachesParentOnTapDelegate delegate;
|
| @@ -1391,7 +1391,7 @@ class NestedGestureDelegate : public test::TestWindowDelegate {
|
| } // namespace
|
|
|
| // Tests that gesture end is delivered after nested gesture processing.
|
| -TEST_F(WindowEventDispatcherTest, GestureEndDeliveredAfterNestedGestures) {
|
| +TEST_P(WindowEventDispatcherTest, GestureEndDeliveredAfterNestedGestures) {
|
| NestedGestureDelegate d1(NULL, gfx::Point());
|
| std::unique_ptr<Window> w1(CreateNormalWindow(1, root_window(), &d1));
|
| w1->SetBounds(gfx::Rect(0, 0, 100, 100));
|
| @@ -1411,7 +1411,7 @@ TEST_F(WindowEventDispatcherTest, GestureEndDeliveredAfterNestedGestures) {
|
| }
|
|
|
| // Tests whether we can repost the Tap down gesture event.
|
| -TEST_F(WindowEventDispatcherTest, RepostTapdownGestureTest) {
|
| +TEST_P(WindowEventDispatcherTest, RepostTapdownGestureTest) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
|
|
| @@ -1491,7 +1491,7 @@ class RepostGestureEventRecorder : public EventFilterRecorder {
|
| // Tests whether events which are generated after the reposted gesture event
|
| // are received after that. In this case the scroll sequence events should
|
| // be received after the reposted gesture event.
|
| -TEST_F(WindowEventDispatcherTest, GestureRepostEventOrder) {
|
| +TEST_P(WindowEventDispatcherTest, GestureRepostEventOrder) {
|
| // Expected events at the end for the repost_target window defined below.
|
| const char kExpectedTargetEvents[] =
|
| // TODO)(rbyers): Gesture event reposting is disabled - crbug.com/279039.
|
| @@ -1579,7 +1579,7 @@ class OnMouseExitDeletingEventFilter : public EventFilterRecorder {
|
| // Tests that RootWindow drops mouse-moved event that is supposed to be sent to
|
| // a child, but the child is destroyed because of the synthesized mouse-exit
|
| // event generated on the previous mouse_moved_handler_.
|
| -TEST_F(WindowEventDispatcherTest, DeleteWindowDuringMouseMovedDispatch) {
|
| +TEST_P(WindowEventDispatcherTest, DeleteWindowDuringMouseMovedDispatch) {
|
| // Create window 1 and set its event filter. Window 1 will take ownership of
|
| // the event filter.
|
| std::unique_ptr<Window> w1(CreateNormalWindow(1, root_window(), NULL));
|
| @@ -1618,7 +1618,7 @@ TEST_F(WindowEventDispatcherTest, DeleteWindowDuringMouseMovedDispatch) {
|
|
|
| // Tests the case where the event dispatcher is deleted during the pre-dispatch
|
| // phase of dispatching and event.
|
| -TEST_F(WindowEventDispatcherTest, DeleteDispatcherDuringPreDispatch) {
|
| +TEST_P(WindowEventDispatcherTest, DeleteDispatcherDuringPreDispatch) {
|
| // Create a host for the window hierarchy. This host will be destroyed later
|
| // on.
|
| WindowTreeHost* host = WindowTreeHost::Create(gfx::Rect(0, 0, 100, 100));
|
| @@ -1691,7 +1691,7 @@ class ValidRootDuringDestructionWindowObserver : public aura::WindowObserver {
|
| } // namespace
|
|
|
| // Verifies GetRootWindow() from ~Window returns a valid root.
|
| -TEST_F(WindowEventDispatcherTest, ValidRootDuringDestruction) {
|
| +TEST_P(WindowEventDispatcherTest, ValidRootDuringDestruction) {
|
| bool got_destroying = false;
|
| bool has_valid_root = false;
|
| ValidRootDuringDestructionWindowObserver observer(&got_destroying,
|
| @@ -1745,7 +1745,7 @@ class DontResetHeldEventWindowDelegate : public test::TestWindowDelegate {
|
| // tracks the number of events with ui::EF_SHIFT_DOWN set (all reposted events
|
| // have EF_SHIFT_DOWN). When the first event is seen RepostEvent() is used to
|
| // schedule another reposted event.
|
| -TEST_F(WindowEventDispatcherTest, DontResetHeldEvent) {
|
| +TEST_P(WindowEventDispatcherTest, DontResetHeldEvent) {
|
| DontResetHeldEventWindowDelegate delegate(root_window());
|
| std::unique_ptr<Window> w1(CreateNormalWindow(1, root_window(), &delegate));
|
| w1->SetBounds(gfx::Rect(0, 0, 40, 40));
|
| @@ -1802,7 +1802,7 @@ class DeleteHostFromHeldMouseEventDelegate
|
|
|
| // Verifies if a WindowTreeHost is deleted from dispatching a held mouse event
|
| // we don't crash.
|
| -TEST_F(WindowEventDispatcherTest, DeleteHostFromHeldMouseEvent) {
|
| +TEST_P(WindowEventDispatcherTest, DeleteHostFromHeldMouseEvent) {
|
| // Should be deleted by |delegate|.
|
| WindowTreeHost* h2 = WindowTreeHost::Create(gfx::Rect(0, 0, 100, 100));
|
| h2->InitHost();
|
| @@ -1820,7 +1820,7 @@ TEST_F(WindowEventDispatcherTest, DeleteHostFromHeldMouseEvent) {
|
| EXPECT_TRUE(delegate.got_destroy());
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTest, WindowHideCancelsActiveTouches) {
|
| +TEST_P(WindowEventDispatcherTest, WindowHideCancelsActiveTouches) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
|
|
| @@ -1845,7 +1845,7 @@ TEST_F(WindowEventDispatcherTest, WindowHideCancelsActiveTouches) {
|
| root_window()->RemovePreTargetHandler(&recorder);
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTest, WindowHideCancelsActiveGestures) {
|
| +TEST_P(WindowEventDispatcherTest, WindowHideCancelsActiveGestures) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
|
|
| @@ -1900,7 +1900,7 @@ TEST_F(WindowEventDispatcherTest, WindowHideCancelsActiveGestures) {
|
| // Places two windows side by side. Presses down on one window, and starts a
|
| // scroll. Sets capture on the other window and ensures that the "ending" events
|
| // aren't sent to the window which gained capture.
|
| -TEST_F(WindowEventDispatcherTest, EndingEventDoesntRetarget) {
|
| +TEST_P(WindowEventDispatcherTest, EndingEventDoesntRetarget) {
|
| EventFilterRecorder recorder1;
|
| EventFilterRecorder recorder2;
|
| std::unique_ptr<Window> window1(CreateNormalWindow(1, root_window(), NULL));
|
| @@ -1969,7 +1969,7 @@ class CaptureWindowTracker : public test::TestWindowDelegate {
|
| }
|
|
|
| // Verifies handling loss of capture by the capture window being hidden.
|
| -TEST_F(WindowEventDispatcherTest, CaptureWindowHidden) {
|
| +TEST_P(WindowEventDispatcherTest, CaptureWindowHidden) {
|
| CaptureWindowTracker capture_window_tracker;
|
| capture_window_tracker.CreateCaptureWindow(root_window());
|
| capture_window_tracker.capture_window()->Hide();
|
| @@ -1977,7 +1977,7 @@ TEST_F(WindowEventDispatcherTest, CaptureWindowHidden) {
|
| }
|
|
|
| // Verifies handling loss of capture by the capture window being destroyed.
|
| -TEST_F(WindowEventDispatcherTest, CaptureWindowDestroyed) {
|
| +TEST_P(WindowEventDispatcherTest, CaptureWindowDestroyed) {
|
| CaptureWindowTracker capture_window_tracker;
|
| capture_window_tracker.CreateCaptureWindow(root_window());
|
| capture_window_tracker.reset();
|
| @@ -2062,7 +2062,7 @@ class WindowEventDispatcherTestWithMessageLoop
|
| DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcherTestWithMessageLoop);
|
| };
|
|
|
| -TEST_F(WindowEventDispatcherTestWithMessageLoop, EventRepostedInNonNestedLoop) {
|
| +TEST_P(WindowEventDispatcherTestWithMessageLoop, EventRepostedInNonNestedLoop) {
|
| CHECK(!message_loop()->is_running());
|
| // Perform the test in a callback, so that it runs after the message-loop
|
| // starts.
|
| @@ -2088,7 +2088,7 @@ class WindowEventDispatcherTestInHighDPI : public WindowEventDispatcherTest {
|
| }
|
| };
|
|
|
| -TEST_F(WindowEventDispatcherTestInHighDPI, EventLocationTransform) {
|
| +TEST_P(WindowEventDispatcherTestInHighDPI, EventLocationTransform) {
|
| test::TestWindowDelegate delegate;
|
| std::unique_ptr<aura::Window> child(test::CreateTestWindowWithDelegate(
|
| &delegate, 1234, gfx::Rect(20, 20, 100, 100), root_window()));
|
| @@ -2124,7 +2124,7 @@ TEST_F(WindowEventDispatcherTestInHighDPI, EventLocationTransform) {
|
| root_window()->RemovePreTargetHandler(&handler_root);
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTestInHighDPI, TouchMovesHeldOnScroll) {
|
| +TEST_P(WindowEventDispatcherTestInHighDPI, TouchMovesHeldOnScroll) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
| test::TestWindowDelegate delegate;
|
| @@ -2194,7 +2194,7 @@ class TriggerNestedLoopOnRightMousePress : public ui::test::TestEventHandler {
|
| // Tests that if dispatching a 'held' event triggers a nested message loop, then
|
| // the events that are dispatched from the nested message loop are transformed
|
| // correctly.
|
| -TEST_F(WindowEventDispatcherTestInHighDPI,
|
| +TEST_P(WindowEventDispatcherTestInHighDPI,
|
| EventsTransformedInRepostedEventTriggeredNestedLoop) {
|
| std::unique_ptr<Window> window(CreateNormalWindow(1, root_window(), NULL));
|
| // Make sure the window is visible.
|
| @@ -2246,7 +2246,7 @@ class SelfDestructDelegate : public test::TestWindowDelegate {
|
| DISALLOW_COPY_AND_ASSIGN(SelfDestructDelegate);
|
| };
|
|
|
| -TEST_F(WindowEventDispatcherTest, SynthesizedLocatedEvent) {
|
| +TEST_P(WindowEventDispatcherTest, SynthesizedLocatedEvent) {
|
| ui::test::EventGenerator generator(root_window());
|
| generator.MoveMouseTo(10, 10);
|
| EXPECT_EQ("10,10",
|
| @@ -2280,7 +2280,7 @@ TEST_F(WindowEventDispatcherTest, SynthesizedLocatedEvent) {
|
| // Tests that the window which has capture can get destroyed as a result of
|
| // ui::ET_MOUSE_CAPTURE_CHANGED event dispatched in
|
| // WindowEventDispatcher::UpdateCapture without causing a "use after free".
|
| -TEST_F(WindowEventDispatcherTest, DestroyWindowOnCaptureChanged) {
|
| +TEST_P(WindowEventDispatcherTest, DestroyWindowOnCaptureChanged) {
|
| SelfDestructDelegate delegate;
|
| std::unique_ptr<aura::Window> window_first(CreateTestWindowWithDelegate(
|
| &delegate, 1, gfx::Rect(20, 10, 10, 20), root_window()));
|
| @@ -2320,7 +2320,7 @@ class StaticFocusClient : public client::FocusClient {
|
|
|
| // Tests that host-cancel-mode event can be dispatched to a dispatcher safely
|
| // when the focused window does not live in the dispatcher's tree.
|
| -TEST_F(WindowEventDispatcherTest, HostCancelModeWithFocusedWindowOutside) {
|
| +TEST_P(WindowEventDispatcherTest, HostCancelModeWithFocusedWindowOutside) {
|
| test::TestWindowDelegate delegate;
|
| std::unique_ptr<Window> focused(CreateTestWindowWithDelegate(
|
| &delegate, 123, gfx::Rect(20, 30, 100, 50), NULL));
|
| @@ -2393,7 +2393,7 @@ class MoveWindowHandler : public ui::EventHandler {
|
| // Tests that nested event dispatch works correctly if the target of the older
|
| // event being dispatched is moved to a different dispatcher in response to an
|
| // event in the inner loop.
|
| -TEST_F(WindowEventDispatcherTest, NestedEventDispatchTargetMoved) {
|
| +TEST_P(WindowEventDispatcherTest, NestedEventDispatchTargetMoved) {
|
| std::unique_ptr<WindowTreeHost> second_host(
|
| WindowTreeHost::Create(gfx::Rect(20, 30, 100, 50)));
|
| second_host->InitHost();
|
| @@ -2449,7 +2449,7 @@ class AlwaysMouseDownInputStateLookup : public InputStateLookup {
|
| DISALLOW_COPY_AND_ASSIGN(AlwaysMouseDownInputStateLookup);
|
| };
|
|
|
| -TEST_F(WindowEventDispatcherTest,
|
| +TEST_P(WindowEventDispatcherTest,
|
| CursorVisibilityChangedWhileCaptureWindowInAnotherDispatcher) {
|
| test::EventCountDelegate delegate;
|
| std::unique_ptr<Window> window(CreateTestWindowWithDelegate(
|
| @@ -2494,7 +2494,7 @@ TEST_F(WindowEventDispatcherTest,
|
| EXPECT_EQ("0 0 1", delegate.GetMouseMotionCountsAndReset());
|
| }
|
|
|
| -TEST_F(WindowEventDispatcherTest,
|
| +TEST_P(WindowEventDispatcherTest,
|
| RedirectedEventToDifferentDispatcherLocation) {
|
| std::unique_ptr<WindowTreeHost> second_host(
|
| WindowTreeHost::Create(gfx::Rect(20, 30, 100, 50)));
|
| @@ -2559,7 +2559,7 @@ class AsyncWindowDelegate : public test::TestWindowDelegate {
|
|
|
| // Tests that gesture events dispatched through the asynchronous flow have
|
| // co-ordinates in the right co-ordinate space.
|
| -TEST_F(WindowEventDispatcherTest, GestureEventCoordinates) {
|
| +TEST_P(WindowEventDispatcherTest, GestureEventCoordinates) {
|
| const float kX = 67.3f;
|
| const float kY = 97.8f;
|
|
|
| @@ -2593,7 +2593,7 @@ TEST_F(WindowEventDispatcherTest, GestureEventCoordinates) {
|
| }
|
|
|
| // Tests that a scroll-generating touch-event is marked as such.
|
| -TEST_F(WindowEventDispatcherTest, TouchMovesMarkedWhenCausingScroll) {
|
| +TEST_P(WindowEventDispatcherTest, TouchMovesMarkedWhenCausingScroll) {
|
| EventFilterRecorder recorder;
|
| root_window()->AddPreTargetHandler(&recorder);
|
|
|
| @@ -2642,7 +2642,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesMarkedWhenCausingScroll) {
|
| // WindowTreeHost::MoveCursorTo() when the cursor did not move but the
|
| // cursor's position in root coordinates has changed (e.g. when the displays's
|
| // scale factor changed). Test that hover effects are properly updated.
|
| -TEST_F(WindowEventDispatcherTest, OnCursorMovedToRootLocationUpdatesHover) {
|
| +TEST_P(WindowEventDispatcherTest, OnCursorMovedToRootLocationUpdatesHover) {
|
| WindowEventDispatcher* dispatcher = host()->dispatcher();
|
|
|
| std::unique_ptr<Window> w(CreateNormalWindow(1, root_window(), nullptr));
|
| @@ -2669,4 +2669,19 @@ TEST_F(WindowEventDispatcherTest, OnCursorMovedToRootLocationUpdatesHover) {
|
| w->RemovePreTargetHandler(&recorder);
|
| }
|
|
|
| +INSTANTIATE_TEST_CASE_P(/* no prefix */,
|
| + WindowEventDispatcherTest,
|
| + ::testing::Values(test::BackendType::CLASSIC,
|
| + test::BackendType::MUS));
|
| +
|
| +INSTANTIATE_TEST_CASE_P(/* no prefix */,
|
| + WindowEventDispatcherTestWithMessageLoop,
|
| + ::testing::Values(test::BackendType::CLASSIC,
|
| + test::BackendType::MUS));
|
| +
|
| +INSTANTIATE_TEST_CASE_P(/* no prefix */,
|
| + WindowEventDispatcherTestInHighDPI,
|
| + ::testing::Values(test::BackendType::CLASSIC,
|
| + test::BackendType::MUS));
|
| +
|
| } // namespace aura
|
|
|