diff options
79 files changed, 461 insertions, 478 deletions
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc index c5fc1cf..31ebf9b 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc @@ -25,12 +25,12 @@ #include "ash/wm/window_util.h" #include "base/command_line.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/events/event.h" #include "ui/events/event_processor.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" @@ -519,7 +519,7 @@ TEST_F(AcceleratorControllerTest, AutoRepeat) { TestTarget target_b; GetController()->Register(accelerator_b, &target_b); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.PressKey(ui::VKEY_A, ui::EF_CONTROL_DOWN); generator.ReleaseKey(ui::VKEY_A, ui::EF_CONTROL_DOWN); @@ -554,7 +554,7 @@ TEST_F(AcceleratorControllerTest, AutoRepeat) { } TEST_F(AcceleratorControllerTest, Previous) { - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.PressKey(ui::VKEY_VOLUME_MUTE, ui::EF_NONE); generator.ReleaseKey(ui::VKEY_VOLUME_MUTE, ui::EF_NONE); @@ -588,7 +588,7 @@ TEST_F(AcceleratorControllerTest, DontRepeatToggleFullscreen) { widget->Activate(); widget->GetNativeView()->SetProperty(aura::client::kCanMaximizeKey, true); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); wm::WindowState* window_state = wm::GetWindowState(widget->GetNativeView()); // Toggling not suppressed. diff --git a/ash/accelerators/accelerator_filter_unittest.cc b/ash/accelerators/accelerator_filter_unittest.cc index 67ff1d9..d91d084 100644 --- a/ash/accelerators/accelerator_filter_unittest.cc +++ b/ash/accelerators/accelerator_filter_unittest.cc @@ -15,10 +15,10 @@ #include "base/memory/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/events/event.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/rect.h" namespace ash { @@ -31,7 +31,7 @@ TEST_F(AcceleratorFilterTest, TestFilterWithoutFocus) { const TestScreenshotDelegate* delegate = GetScreenshotDelegate(); EXPECT_EQ(0, delegate->handle_take_screenshot_count()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); // AcceleratorController calls ScreenshotDelegate::HandleTakeScreenshot() when // VKEY_PRINT is pressed. See kAcceleratorData[] in accelerator_controller.cc. generator.PressKey(ui::VKEY_PRINT, 0); @@ -54,7 +54,7 @@ TEST_F(AcceleratorFilterTest, TestFilterWithFocus) { // AcceleratorFilter should ignore the key events since the root window is // not focused. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.PressKey(ui::VKEY_PRINT, 0); EXPECT_EQ(0, delegate->handle_take_screenshot_count()); generator.ReleaseKey(ui::VKEY_PRINT, 0); @@ -69,7 +69,7 @@ TEST_F(AcceleratorFilterTest, TestCapsLockMask) { const TestScreenshotDelegate* delegate = GetScreenshotDelegate(); EXPECT_EQ(0, delegate->handle_take_screenshot_count()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.PressKey(ui::VKEY_PRINT, 0); EXPECT_EQ(1, delegate->handle_take_screenshot_count()); generator.ReleaseKey(ui::VKEY_PRINT, 0); diff --git a/ash/accelerators/magnifier_key_scroller_unittest.cc b/ash/accelerators/magnifier_key_scroller_unittest.cc index ad91abd..9de8c95 100644 --- a/ash/accelerators/magnifier_key_scroller_unittest.cc +++ b/ash/accelerators/magnifier_key_scroller_unittest.cc @@ -8,8 +8,8 @@ #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/wm/window_util.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" +#include "ui/events/test/event_generator.h" namespace ash { namespace { @@ -52,7 +52,7 @@ TEST_F(MagnifierKeyScrollerTest, Basic) { controller->SetEnabled(true); EXPECT_EQ("200,150", controller->GetWindowPosition().ToString()); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); // Click and Release generates the press event upon release. generator.PressKey(ui::VKEY_DOWN, ui::EF_SHIFT_DOWN); diff --git a/ash/accelerators/spoken_feedback_toggler_unittest.cc b/ash/accelerators/spoken_feedback_toggler_unittest.cc index 9344471..20df051 100644 --- a/ash/accelerators/spoken_feedback_toggler_unittest.cc +++ b/ash/accelerators/spoken_feedback_toggler_unittest.cc @@ -7,8 +7,8 @@ #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/wm/window_util.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" +#include "ui/events/test/event_generator.h" namespace ash { @@ -18,7 +18,7 @@ TEST_F(SpokenFeedbackTogglerTest, Basic) { SpokenFeedbackToggler::ScopedEnablerForTest scoped; Shell* shell = Shell::GetInstance(); AccessibilityDelegate* delegate = shell->accessibility_delegate(); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); EXPECT_FALSE(delegate->IsSpokenFeedbackEnabled()); generator.PressKey(ui::VKEY_F6, ui::EF_SHIFT_DOWN); diff --git a/ash/autoclick/autoclick_unittest.cc b/ash/autoclick/autoclick_unittest.cc index ff387aa..2af2dde 100644 --- a/ash/autoclick/autoclick_unittest.cc +++ b/ash/autoclick/autoclick_unittest.cc @@ -5,7 +5,6 @@ #include "ash/autoclick/autoclick_controller.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" @@ -13,6 +12,7 @@ #include "ui/events/event_constants.h" #include "ui/events/event_handler.h" #include "ui/events/keycodes/keyboard_codes.h" +#include "ui/events/test/event_generator.h" namespace ash { @@ -227,7 +227,7 @@ TEST_F(AutoclickTest, ExtendedDisplay) { std::vector<ui::MouseEvent> events; // Test first root window. - aura::test::EventGenerator generator1(root_windows[0]); + ui::test::EventGenerator generator1(root_windows[0]); generator1.MoveMouseTo(100, 200); events = WaitForMouseEvents(); EXPECT_EQ(2u, events.size()); @@ -235,7 +235,7 @@ TEST_F(AutoclickTest, ExtendedDisplay) { EXPECT_EQ(200, events[0].root_location().y()); // Test second root window. - aura::test::EventGenerator generator2(root_windows[1]); + ui::test::EventGenerator generator2(root_windows[1]); generator2.MoveMouseTo(300, 400); events = WaitForMouseEvents(); EXPECT_EQ(2u, events.size()); diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc index 26e01cc..bd8cf49 100644 --- a/ash/display/display_controller_unittest.cc +++ b/ash/display/display_controller_unittest.cc @@ -23,10 +23,10 @@ #include "ui/aura/client/focus_change_observer.h" #include "ui/aura/client/focus_client.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window_tracker.h" #include "ui/aura/window_tree_host.h" #include "ui/events/event_handler.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" @@ -1024,7 +1024,7 @@ TEST_F(DisplayControllerTest, OverscanInsets) { EXPECT_EQ("80,0 150x200", ScreenUtil::GetSecondaryDisplay().bounds().ToString()); - aura::test::EventGenerator generator(root_windows[0]); + ui::test::EventGenerator generator(root_windows[0]); generator.MoveMouseToInHost(20, 25); EXPECT_EQ("5,15", event_handler.GetLocationAndReset()); @@ -1066,7 +1066,7 @@ TEST_F(DisplayControllerTest, Rotate) { gfx::Display display1 = Shell::GetScreen()->GetPrimaryDisplay(); int64 display2_id = ScreenUtil::GetSecondaryDisplay().id(); aura::Window::Windows root_windows = Shell::GetAllRootWindows(); - aura::test::EventGenerator generator1(root_windows[0]); + ui::test::EventGenerator generator1(root_windows[0]); TestObserver observer; EXPECT_EQ("120x200", root_windows[0]->bounds().size().ToString()); @@ -1107,7 +1107,7 @@ TEST_F(DisplayControllerTest, Rotate) { EXPECT_EQ(1, observer.GetRotationChangedCountAndReset()); #if !defined(OS_WIN) - aura::test::EventGenerator generator2(root_windows[1]); + ui::test::EventGenerator generator2(root_windows[1]); generator2.MoveMouseToInHost(50, 40); EXPECT_EQ("179,25", event_handler.GetLocationAndReset()); display_manager->SetDisplayRotation(display1.id(), @@ -1149,7 +1149,7 @@ TEST_F(DisplayControllerTest, ScaleRootWindow) { EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); EXPECT_EQ(1.0f, GetStoredUIScale(display2.id())); - aura::test::EventGenerator generator(root_windows[0]); + ui::test::EventGenerator generator(root_windows[0]); generator.MoveMouseToInHost(599, 200); EXPECT_EQ("449,150", event_handler.GetLocationAndReset()); @@ -1177,7 +1177,7 @@ TEST_F(DisplayControllerTest, TouchScale) { gfx::Display display = Shell::GetScreen()->GetPrimaryDisplay(); aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Window* root_window = root_windows[0]; - aura::test::EventGenerator generator(root_window); + ui::test::EventGenerator generator(root_window); generator.PressMoveAndReleaseTouchTo(50, 50); // Default test touches have radius_x/y = 1.0, with device scale @@ -1213,7 +1213,7 @@ TEST_F(DisplayControllerTest, ConvertHostToRootCoords) { EXPECT_EQ("0,0 300x450", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); - aura::test::EventGenerator generator(root_windows[0]); + ui::test::EventGenerator generator(root_windows[0]); generator.MoveMouseToInHost(0, 0); EXPECT_EQ("0,449", event_handler.GetLocationAndReset()); generator.MoveMouseToInHost(599, 0); diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 54dd0aa..55ccd03 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc @@ -15,11 +15,11 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window_observer.h" #include "ui/aura/window_tree_host.h" -#include "ui/gfx/display_observer.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/display.h" +#include "ui/gfx/display_observer.h" #include "ui/gfx/screen.h" #include "ui/gfx/screen_type_delegate.h" @@ -613,7 +613,7 @@ TEST_F(DisplayManagerTest, MAYBE_EnsurePointerInDisplays) { aura::Env* env = aura::Env::GetInstance(); - aura::test::EventGenerator generator(root_windows[0]); + ui::test::EventGenerator generator(root_windows[0]); // Set the initial position. generator.MoveMouseToInHost(350, 150); @@ -1019,8 +1019,8 @@ TEST_F(DisplayManagerTest, MAYBE_UpdateMouseCursorAfterRotateZoom) { aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Env* env = aura::Env::GetInstance(); - aura::test::EventGenerator generator1(root_windows[0]); - aura::test::EventGenerator generator2(root_windows[1]); + ui::test::EventGenerator generator1(root_windows[0]); + ui::test::EventGenerator generator2(root_windows[1]); // Test on 1st display. generator1.MoveMouseToInHost(150, 50); diff --git a/ash/display/mirror_window_controller_unittest.cc b/ash/display/mirror_window_controller_unittest.cc index 15f8c6a..a071279 100644 --- a/ash/display/mirror_window_controller_unittest.cc +++ b/ash/display/mirror_window_controller_unittest.cc @@ -12,12 +12,12 @@ #include "ash/test/mirror_window_test_api.h" #include "base/command_line.h" #include "base/strings/stringprintf.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/hit_test.h" +#include "ui/events/test/event_generator.h" namespace ash { @@ -87,7 +87,7 @@ TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorBasic) { EXPECT_TRUE(test_api.GetCursorWindow()); EXPECT_EQ("50,50 100x100", window->bounds().ToString()); - aura::test::EventGenerator generator(root); + ui::test::EventGenerator generator(root); generator.MoveMouseTo(10, 10); // Test if cursor movement is propertly reflected in mirror window. @@ -144,7 +144,7 @@ TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorRotate) { EXPECT_TRUE(test_api.GetCursorWindow()); EXPECT_EQ("50,50 100x100", window->bounds().ToString()); - aura::test::EventGenerator generator(root); + ui::test::EventGenerator generator(root); generator.MoveMouseToInHost(100, 100); // Test if cursor movement is propertly reflected in mirror window. @@ -200,7 +200,7 @@ TEST_F(MirrorWindowControllerTest, MAYBE_MirrorCursorLocations) { UpdateDisplay("400x600*2,400x600"); aura::Window* root = Shell::GetInstance()->GetPrimaryRootWindow(); - aura::test::EventGenerator generator(root); + ui::test::EventGenerator generator(root); generator.MoveMouseToInHost(10, 20); gfx::Point hot_point = test_api.GetCursorHotPoint(); diff --git a/ash/display/root_window_transformers_unittest.cc b/ash/display/root_window_transformers_unittest.cc index 62d7681..7a7581c 100644 --- a/ash/display/root_window_transformers_unittest.cc +++ b/ash/display/root_window_transformers_unittest.cc @@ -17,10 +17,10 @@ #include "ash/test/mirror_window_test_api.h" #include "base/synchronization/waitable_event.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_tracker.h" #include "ui/events/event_handler.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/display.h" #include "ui/gfx/rect_conversions.h" #include "ui/gfx/screen.h" @@ -144,8 +144,8 @@ TEST_F(RootWindowTransformersTest, MAYBE_RotateAndMagnify) { int64 display2_id = ScreenUtil::GetSecondaryDisplay().id(); aura::Window::Windows root_windows = Shell::GetAllRootWindows(); - aura::test::EventGenerator generator1(root_windows[0]); - aura::test::EventGenerator generator2(root_windows[1]); + ui::test::EventGenerator generator1(root_windows[0]); + ui::test::EventGenerator generator2(root_windows[1]); magnifier->SetEnabled(true); EXPECT_EQ(2.0f, magnifier->GetScale()); @@ -247,7 +247,7 @@ TEST_F(RootWindowTransformersTest, ScaleAndMagnify) { EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); EXPECT_EQ(1.0f, GetStoredUIScale(display2.id())); - aura::test::EventGenerator generator(root_windows[0]); + ui::test::EventGenerator generator(root_windows[0]); generator.MoveMouseToInHost(500, 200); EXPECT_EQ("299,150", event_handler.GetLocationAndReset()); magnifier->SetEnabled(false); @@ -276,7 +276,7 @@ TEST_F(RootWindowTransformersTest, MAYBE_TouchScaleAndMagnify) { gfx::Display display = Shell::GetScreen()->GetPrimaryDisplay(); aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Window* root_window = root_windows[0]; - aura::test::EventGenerator generator(root_window); + ui::test::EventGenerator generator(root_window); MagnificationController* magnifier = Shell::GetInstance()->magnification_controller(); @@ -319,7 +319,7 @@ TEST_F(RootWindowTransformersTest, MAYBE_ConvertHostToRootCoords) { EXPECT_EQ("0,0 300x450", root_windows[0]->bounds().ToString()); EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); - aura::test::EventGenerator generator(root_windows[0]); + ui::test::EventGenerator generator(root_windows[0]); generator.MoveMouseToInHost(300, 200); magnifier->SetEnabled(true); EXPECT_EQ("150,224", event_handler.GetLocationAndReset()); diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc index c45ba68..48ff847 100644 --- a/ash/drag_drop/drag_drop_controller_unittest.cc +++ b/ash/drag_drop/drag_drop_controller_unittest.cc @@ -12,7 +12,6 @@ #include "base/location.h" #include "base/strings/utf_string_conversions.h" #include "ui/aura/client/capture_client.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_tree_host.h" #include "ui/base/clipboard/clipboard.h" @@ -24,6 +23,7 @@ #include "ui/events/event.h" #include "ui/events/event_utils.h" #include "ui/events/gestures/gesture_types.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/events_test_utils.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/image/image_skia_rep.h" @@ -359,8 +359,8 @@ TEST_F(DragDropControllerTest, MAYBE_DragDropInSingleViewTest) { AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget->GetNativeView()); generator.PressLeftButton(); int num_drags = 17; @@ -405,8 +405,8 @@ TEST_F(DragDropControllerTest, DragDropWithZeroDragUpdates) { AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget->GetNativeView()); generator.PressLeftButton(); int num_drags = drag_view->VerticalDragThreshold() + 1; @@ -453,7 +453,7 @@ TEST_F(DragDropControllerTest, MAYBE_DragDropInMultipleViewsSingleWidgetTest) { ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseRelativeTo(widget->GetNativeView(), drag_view1->bounds().CenterPoint()); generator.PressLeftButton(); @@ -519,8 +519,8 @@ TEST_F(DragDropControllerTest, MAYBE_DragDropInMultipleViewsMultipleWidgetsTest) ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget1->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget1->GetNativeView()); generator.PressLeftButton(); int num_drags = drag_view1->width(); @@ -577,7 +577,7 @@ TEST_F(DragDropControllerTest, MAYBE_ViewRemovedWhileInDragDropTest) { ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseToCenterOf(widget->GetNativeView()); generator.PressLeftButton(); @@ -638,8 +638,8 @@ TEST_F(DragDropControllerTest, DragLeavesClipboardAloneTest) { DragTestView* drag_view = new DragTestView; AddViewToWidgetAndResize(widget.get(), drag_view); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget->GetNativeView()); ui::OSExchangeData data; std::string data_str("I am being dragged"); data.SetString(base::ASCIIToUTF16(data_str)); @@ -669,8 +669,8 @@ TEST_F(DragDropControllerTest, WindowDestroyedDuringDragDrop) { ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget->GetNativeView()); generator.PressLeftButton(); int num_drags = 17; @@ -713,8 +713,8 @@ TEST_F(DragDropControllerTest, SyntheticEventsDuringDragDrop) { AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget->GetNativeView()); generator.PressLeftButton(); int num_drags = 17; @@ -769,8 +769,8 @@ TEST_F(DragDropControllerTest, MAYBE_PressingEscapeCancelsDragDrop) { AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget->GetNativeView()); generator.PressLeftButton(); int num_drags = 17; @@ -811,8 +811,8 @@ TEST_F(DragDropControllerTest, MAYBE_CaptureLostCancelsDragDrop) { AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget->GetNativeView()); generator.PressLeftButton(); int num_drags = 17; @@ -873,8 +873,8 @@ TEST_F(DragDropControllerTest, TouchDragDropInMultipleWindows) { ui::OSExchangeData data; data.SetString(base::UTF8ToUTF16("I am being dragged")); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget1->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget1->GetNativeView()); generator.PressTouch(); gfx::Point point = gfx::Rect(drag_view1->bounds()).CenterPoint(); DispatchGesture(ui::ET_GESTURE_LONG_PRESS, point); @@ -923,8 +923,8 @@ TEST_F(DragDropControllerTest, TouchDragDropCancelsOnLongTap) { scoped_ptr<views::Widget> widget(CreateNewWidget()); DragTestView* drag_view = new DragTestView; AddViewToWidgetAndResize(widget.get(), drag_view); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget->GetNativeView()); generator.PressTouch(); gfx::Point point = gfx::Rect(drag_view->bounds()).CenterPoint(); @@ -949,8 +949,8 @@ TEST_F(DragDropControllerTest, TouchDragDropLongTapGestureIsForwarded) { scoped_ptr<views::Widget> widget(CreateNewWidget()); DragTestView* drag_view = new DragTestView; AddViewToWidgetAndResize(widget.get(), drag_view); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - widget->GetNativeView()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + widget->GetNativeView()); generator.PressTouch(); gfx::Point point = gfx::Rect(drag_view->bounds()).CenterPoint(); diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc index b5f9382..71f68e4 100644 --- a/ash/extended_desktop_unittest.cc +++ b/ash/extended_desktop_unittest.cc @@ -17,13 +17,13 @@ #include "base/strings/utf_string_conversions.h" #include "ui/aura/client/capture_client.h" #include "ui/aura/client/focus_client.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/test/window_test_api.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/cursor/cursor.h" #include "ui/events/event_handler.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #include "ui/views/controls/textfield/textfield.h" @@ -214,7 +214,7 @@ TEST_F(ExtendedDesktopTest, Activation) { aura::client::GetFocusClient(root_windows[0])->GetFocusedWindow()); EXPECT_TRUE(wm::IsActiveWindow(widget_on_2nd->GetNativeView())); - aura::test::EventGenerator& event_generator(GetEventGenerator()); + ui::test::EventGenerator& event_generator(GetEventGenerator()); // Clicking a window changes the active window and active root window. event_generator.MoveMouseToCenterOf(widget_on_1st->GetNativeView()); event_generator.ClickLeftButton(); @@ -253,7 +253,7 @@ TEST_F(ExtendedDesktopTest, SystemModal) { EXPECT_EQ(root_windows[1], modal_widget->GetNativeView()->GetRootWindow()); EXPECT_EQ(root_windows[1], Shell::GetTargetRootWindow()); - aura::test::EventGenerator& event_generator(GetEventGenerator()); + ui::test::EventGenerator& event_generator(GetEventGenerator()); // Clicking a widget on widget_on_1st display should not change activation. event_generator.MoveMouseToCenterOf(widget_on_1st->GetNativeView()); @@ -391,7 +391,7 @@ TEST_F(ExtendedDesktopTest, Capture) { EXPECT_EQ(r1_w1.get(), aura::client::GetCaptureWindow(r2_w1->GetRootWindow())); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseToCenterOf(r2_w1.get()); // |r1_w1| will receive the events because it has capture. EXPECT_EQ("1 1 0", r1_d1.GetMouseMotionCountsAndReset()); @@ -458,7 +458,7 @@ TEST_F(ExtendedDesktopTest, CaptureEventLocation) { r1_w1->SetCapture(); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseToCenterOf(r2_w1.get()); EXPECT_EQ(gfx::Point(1060, 60).ToString(), generator.current_location().ToString()); @@ -493,7 +493,7 @@ TEST_F(ExtendedDesktopTest, CaptureEventLocationHighDPI) { r1_w1->SetCapture(); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseToCenterOf(r2_w1.get()); EXPECT_EQ(gfx::Point(560, 60).ToString(), generator.current_location().ToString()); @@ -528,7 +528,7 @@ TEST_F(ExtendedDesktopTest, CaptureEventLocationHighDPI_2) { r1_w1->SetCapture(); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseToCenterOf(r2_w1.get()); EXPECT_EQ(gfx::Point(1060, 60).ToString(), generator.current_location().ToString()); @@ -597,7 +597,7 @@ TEST_F(ExtendedDesktopTest, MoveWindowByMouseClick) { MoveWindowByClickEventHandler event_handler(window.get()); window->AddPreTargetHandler(&event_handler); - aura::test::EventGenerator& event_generator(GetEventGenerator()); + ui::test::EventGenerator& event_generator(GetEventGenerator()); event_generator.MoveMouseToCenterOf(window.get()); event_generator.ClickLeftButton(); @@ -764,7 +764,7 @@ TEST_F(ExtendedDesktopTest, OpenSystemTray) { SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray(); ASSERT_FALSE(tray->HasSystemBubble()); - aura::test::EventGenerator& event_generator(GetEventGenerator()); + ui::test::EventGenerator& event_generator(GetEventGenerator()); // Opens the tray by a dummy click event and makes sure that adding/removing // displays doesn't break anything. @@ -866,7 +866,7 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) { EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); // The lock window should get events on both root windows. - aura::test::EventGenerator& event_generator(GetEventGenerator()); + ui::test::EventGenerator& event_generator(GetEventGenerator()); event_generator.set_current_target(root_windows[0]); event_generator.PressKey(ui::VKEY_A, 0); @@ -917,7 +917,7 @@ TEST_F(ExtendedDesktopTest, PassiveGrab) { widget->Show(); ASSERT_EQ("50,50 200x200", widget->GetWindowBoundsInScreen().ToString()); - aura::test::EventGenerator& generator(GetEventGenerator()); + ui::test::EventGenerator& generator(GetEventGenerator()); generator.MoveMouseTo(150, 150); EXPECT_EQ("100,100 150,150", event_handler.GetLocationsAndReset()); diff --git a/ash/first_run/first_run_helper_unittest.cc b/ash/first_run/first_run_helper_unittest.cc index 15e42bf..df272aa 100644 --- a/ash/first_run/first_run_helper_unittest.cc +++ b/ash/first_run/first_run_helper_unittest.cc @@ -8,8 +8,8 @@ #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/events/event_handler.h" +#include "ui/events/test/event_generator.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h" diff --git a/ash/focus_cycler_unittest.cc b/ash/focus_cycler_unittest.cc index 33c89c2..74569d3 100644 --- a/ash/focus_cycler_unittest.cc +++ b/ash/focus_cycler_unittest.cc @@ -15,10 +15,10 @@ #include "ash/system/tray/system_tray.h" #include "ash/test/ash_test_base.h" #include "ash/wm/window_util.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" +#include "ui/events/test/event_generator.h" #include "ui/views/accessible_pane_view.h" #include "ui/views/controls/button/menu_button.h" #include "ui/views/widget/widget.h" @@ -389,7 +389,7 @@ TEST_F(FocusCyclerTest, CycleFocusThroughWindowWithPanes) { // Pressing "Escape" while on the status area should // deactivate it, and activate the browser window. aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::test::EventGenerator event_generator(root, root); + ui::test::EventGenerator event_generator(root, root); event_generator.PressKey(ui::VKEY_ESCAPE, 0); EXPECT_TRUE(wm::IsActiveWindow(browser_window)); EXPECT_EQ(focus_manager->GetFocusedView(), view1); diff --git a/ash/frame/caption_buttons/frame_size_button_unittest.cc b/ash/frame/caption_buttons/frame_size_button_unittest.cc index 74c8f14..02c6023 100644 --- a/ash/frame/caption_buttons/frame_size_button_unittest.cc +++ b/ash/frame/caption_buttons/frame_size_button_unittest.cc @@ -11,10 +11,10 @@ #include "ash/wm/window_state.h" #include "base/i18n/rtl.h" #include "grit/ash_resources.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/base/l10n/l10n_util.h" #include "ui/events/gestures/gesture_configuration.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" @@ -159,7 +159,7 @@ class FrameSizeButtonTest : public AshTestBase { // Tests that pressing the left mouse button or tapping down on the size button // puts the button into the pressed state. TEST_F(FrameSizeButtonTest, PressedState) { - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseTo(CenterPointInScreen(size_button())); generator.PressLeftButton(); EXPECT_EQ(views::Button::STATE_PRESSED, size_button()->state()); @@ -180,7 +180,7 @@ TEST_F(FrameSizeButtonTest, PressedState) { TEST_F(FrameSizeButtonTest, ClickSizeButtonTogglesMaximize) { EXPECT_FALSE(window_state()->IsMaximized()); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseTo(CenterPointInScreen(size_button())); generator.ClickLeftButton(); RunAllPendingInMessageLoop(); @@ -207,7 +207,7 @@ TEST_F(FrameSizeButtonTest, ButtonDrag) { // 1) Test by dragging the mouse. // Snap right. - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseTo(CenterPointInScreen(size_button())); generator.PressLeftButton(); generator.MoveMouseTo(CenterPointInScreen(close_button())); @@ -264,7 +264,7 @@ TEST_F(FrameSizeButtonTest, ButtonDrag) { TEST_F(FrameSizeButtonTest, SnapLeftOvershootMinimize) { EXPECT_TRUE(window_state()->IsNormalStateType()); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseTo(CenterPointInScreen(size_button())); generator.PressLeftButton(); @@ -281,7 +281,7 @@ TEST_F(FrameSizeButtonTest, SnapLeftOvershootMinimize) { TEST_F(FrameSizeButtonTest, RightMouseButton) { EXPECT_TRUE(window_state()->IsNormalStateType()); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseTo(CenterPointInScreen(size_button())); generator.PressRightButton(); generator.ReleaseRightButton(); @@ -300,7 +300,7 @@ TEST_F(FrameSizeButtonTest, ResetButtonsAfterClick) { // Pressing the size button should result in the size button being pressed and // the minimize and close button icons changing. - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseTo(CenterPointInScreen(size_button())); generator.PressLeftButton(); EXPECT_EQ(views::Button::STATE_NORMAL, minimize_button()->state()); @@ -371,7 +371,7 @@ TEST_F(FrameSizeButtonTest, SizeButtonPressedWhenSnapButtonHovered) { // Pressing the size button should result in the size button being pressed and // the minimize and close button icons changing. - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseTo(CenterPointInScreen(size_button())); generator.PressLeftButton(); EXPECT_EQ(views::Button::STATE_NORMAL, minimize_button()->state()); @@ -441,7 +441,7 @@ TEST_F(FrameSizeButtonTestRTL, ButtonDrag) { // Pressing the size button should swap the icons of the minimize and close // buttons to icons for snapping right and for snapping left respectively. - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseTo(CenterPointInScreen(size_button())); generator.PressLeftButton(); EXPECT_EQ(views::Button::STATE_NORMAL, minimize_button()->state()); diff --git a/ash/ime/candidate_view_unittest.cc b/ash/ime/candidate_view_unittest.cc index 708ec92..92d14d2 100644 --- a/ash/ime/candidate_view_unittest.cc +++ b/ash/ime/candidate_view_unittest.cc @@ -6,8 +6,8 @@ #include "base/logging.h" #include "base/strings/utf_string_conversions.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" +#include "ui/events/test/event_generator.h" #include "ui/views/controls/button/button.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" @@ -57,7 +57,7 @@ class CandidateViewTest : public views::ViewsTestBase, widget_->Show(); aura::Window* native_window = widget_->GetNativeWindow(); - event_generator_.reset(new aura::test::EventGenerator( + event_generator_.reset(new ui::test::EventGenerator( native_window->GetRootWindow(), native_window)); } @@ -97,9 +97,7 @@ class CandidateViewTest : public views::ViewsTestBase, return -1; } - aura::test::EventGenerator* event_generator() { - return event_generator_.get(); - } + ui::test::EventGenerator* event_generator() { return event_generator_.get(); } private: virtual void ButtonPressed(views::Button* sender, @@ -109,7 +107,7 @@ class CandidateViewTest : public views::ViewsTestBase, views::Widget* widget_; views::View* container_; - scoped_ptr<aura::test::EventGenerator> event_generator_; + scoped_ptr<ui::test::EventGenerator> event_generator_; views::View* last_pressed_; DISALLOW_COPY_AND_ASSIGN(CandidateViewTest); diff --git a/ash/magnifier/magnification_controller_unittest.cc b/ash/magnifier/magnification_controller_unittest.cc index 54daf88..45ffce6 100644 --- a/ash/magnifier/magnification_controller_unittest.cc +++ b/ash/magnifier/magnification_controller_unittest.cc @@ -11,8 +11,8 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/env.h" #include "ui/aura/test/aura_test_utils.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window_tree_host.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/rect_conversions.h" #include "ui/gfx/screen.h" @@ -173,7 +173,7 @@ TEST_F(MagnificationControllerTest, MoveWindow) { } TEST_F(MagnificationControllerTest, PointOfInterest) { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseToInHost(gfx::Point(0, 0)); EXPECT_EQ("0,0", CurrentPointOfInterest()); @@ -193,7 +193,7 @@ TEST_F(MagnificationControllerTest, PointOfInterest) { TEST_F(MagnificationControllerTest, PanWindow2xLeftToRight) { const aura::Env* env = aura::Env::GetInstance(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseToInHost(gfx::Point(0, 0)); EXPECT_EQ(1.f, GetMagnificationController()->GetScale()); @@ -297,7 +297,7 @@ TEST_F(MagnificationControllerTest, PanWindow2xLeftToRight) { TEST_F(MagnificationControllerTest, PanWindow2xRightToLeft) { const aura::Env* env = aura::Env::GetInstance(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseToInHost(gfx::Point(799, 300)); EXPECT_EQ(1.f, GetMagnificationController()->GetScale()); @@ -350,7 +350,7 @@ TEST_F(MagnificationControllerTest, PanWindow2xRightToLeft) { TEST_F(MagnificationControllerTest, PanWindowToRight) { const aura::Env* env = aura::Env::GetInstance(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseToInHost(gfx::Point(400, 300)); EXPECT_EQ(1.f, GetMagnificationController()->GetScale()); @@ -396,7 +396,7 @@ TEST_F(MagnificationControllerTest, PanWindowToRight) { TEST_F(MagnificationControllerTest, PanWindowToLeft) { const aura::Env* env = aura::Env::GetInstance(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseToInHost(gfx::Point(400, 300)); EXPECT_EQ(1.f, GetMagnificationController()->GetScale()); diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc index 9202734..a692722 100644 --- a/ash/root_window_controller_unittest.cc +++ b/ash/root_window_controller_unittest.cc @@ -19,7 +19,6 @@ #include "ui/aura/client/focus_client.h" #include "ui/aura/client/window_tree_client.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" @@ -30,6 +29,7 @@ #include "ui/base/ime/text_input_client.h" #include "ui/base/ime/text_input_focus_manager.h" #include "ui/base/ui_base_switches_util.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/test_event_handler.h" #include "ui/keyboard/keyboard_controller_proxy.h" #include "ui/keyboard/keyboard_switches.h" @@ -281,7 +281,7 @@ TEST_F(RootWindowControllerTest, MoveWindows_Modal) { modal->GetNativeView())); EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); - aura::test::EventGenerator generator_1st(root_windows[0]); + ui::test::EventGenerator generator_1st(root_windows[0]); generator_1st.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); @@ -688,7 +688,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, ui::test::TestEventHandler handler; root_window->AddPreTargetHandler(&handler); - aura::test::EventGenerator event_generator(root_window, keyboard_window); + ui::test::EventGenerator event_generator(root_window, keyboard_window); event_generator.ClickLeftButton(); int expected_mouse_presses = 1; EXPECT_EQ(expected_mouse_presses, handler.num_mouse_events() / 2); @@ -773,9 +773,9 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) { ui::test::TestEventHandler handler; root_window->AddPreTargetHandler(&handler); - aura::test::EventGenerator root_window_event_generator(root_window); - aura::test::EventGenerator keyboard_event_generator(root_window, - keyboard_window); + ui::test::EventGenerator root_window_event_generator(root_window); + ui::test::EventGenerator keyboard_event_generator(root_window, + keyboard_window); views::Widget* modal_widget = CreateModalWidget(gfx::Rect(300, 10, 100, 100)); diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 9f48d74..a6182ec 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc @@ -27,13 +27,13 @@ #include "base/command_line.h" #include "base/strings/utf_string_conversions.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/events/gestures/gesture_configuration.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #include "ui/views/controls/label.h" @@ -408,7 +408,7 @@ void ShelfLayoutManagerTest::RunGestureDragTests(gfx::Vector2d delta) { shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); shelf->LayoutShelf(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); const int kNumScrollSteps = 4; ShelfDragCallback handler(shelf_hidden, shelf_shown); @@ -828,7 +828,7 @@ TEST_F(ShelfLayoutManagerTest, ShelfUpdatedWhenStatusAreaChangesSize) { // Various assertions around auto-hide. TEST_F(ShelfLayoutManagerTest, MAYBE_AutoHide) { aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::test::EventGenerator generator(root, root); + ui::test::EventGenerator generator(root, root); generator.MoveMouseTo(0, 0); ShelfLayoutManager* shelf = GetShelfLayoutManager(); @@ -919,7 +919,7 @@ TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { int y = root_windows[0]->GetBoundsInScreen().y(); // Start off the mouse nowhere near the shelf; the shelf should be hidden. - aura::test::EventGenerator& generator(GetEventGenerator()); + ui::test::EventGenerator& generator(GetEventGenerator()); generator.MoveMouseTo(right_edge - 50, y); UpdateAutoHideStateNow(); EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); @@ -987,8 +987,8 @@ TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { TEST_F(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) { // Since ShelfLayoutManager queries for mouse location, move the mouse so // it isn't over the shelf. - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(0, 0); ShelfLayoutManager* shelf = GetShelfLayoutManager(); @@ -1040,8 +1040,8 @@ TEST_F(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) { TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) { // Since ShelfLayoutManager queries for mouse location, move the mouse so // it isn't over the shelf. - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(0, 0); ShelfLayoutManager* shelf = GetShelfLayoutManager(); @@ -1085,8 +1085,8 @@ TEST_F(ShelfLayoutManagerTest, SetAutoHideBehavior) { TEST_F(ShelfLayoutManagerTest, TestDimmingBehavior) { // Since ShelfLayoutManager queries for mouse location, move the mouse so // it isn't over the shelf. - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(0, 0); ShelfLayoutManager* shelf = GetShelfLayoutManager(); @@ -1159,8 +1159,8 @@ TEST_F(ShelfLayoutManagerTest, TestDimmingBehavior) { TEST_F(ShelfLayoutManagerTest, TestDimmingBehaviorWithMenus) { // Since ShelfLayoutManager queries for mouse location, move the mouse so // it isn't over the shelf. - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(0, 0); ShelfLayoutManager* shelf = GetShelfLayoutManager(); @@ -1229,8 +1229,8 @@ TEST_F(ShelfLayoutManagerTest, TestDimmingBehaviorWithMenus) { TEST_F(ShelfLayoutManagerTest, VisibleWhenStatusOrShelfFocused) { // Since ShelfLayoutManager queries for mouse location, move the mouse so // it isn't over the shelf. - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(0, 0); ShelfLayoutManager* shelf = GetShelfLayoutManager(); @@ -1532,7 +1532,7 @@ TEST_F(ShelfLayoutManagerTest, GestureEdgeSwipe) { widget->Show(); widget->Maximize(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); aura::Window* window = widget->GetNativeWindow(); shelf->LayoutShelf(); @@ -1584,7 +1584,7 @@ TEST_F(ShelfLayoutManagerTest, GestureEdgeSwipeInMaximizeMode) { wm::GetWindowState(window)->set_hide_shelf_when_fullscreen(false); widget->SetFullscreen(true); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); // The maximize mode gets started. shelf->OnMaximizeModeStarted(); @@ -1703,7 +1703,7 @@ TEST_F(ShelfLayoutManagerTest, ShelfAnimatesWhenGestureComplete) { ui::ScopedAnimationDurationScaleMode regular_animations( ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); gfx::Rect shelf_bounds_in_screen = GetShelfWidget()->GetWindowBoundsInScreen(); gfx::Point start(shelf_bounds_in_screen.CenterPoint()); @@ -1735,7 +1735,7 @@ TEST_F(ShelfLayoutManagerTest, ShelfAnimatesWhenGestureComplete) { gfx::Point start = GetShelfWidget()->GetWindowBoundsInScreen().CenterPoint(); gfx::Point end(start.x(), start.y() - 100); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); // Test that the shelf animates to the visible bounds after a swipe up on // the auto hidden shelf. @@ -1769,7 +1769,7 @@ TEST_F(ShelfLayoutManagerTest, GestureRevealsTrayBubble) { // Create a visible window so auto-hide behavior is enforced. CreateTestWidget(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); SystemTray* tray = GetSystemTray(); // First, make sure the shelf is visible. @@ -1910,7 +1910,7 @@ TEST_F(ShelfLayoutManagerTest, BubbleEnlargesShelfMouseHitArea) { CreateTestWidget(); shelf->LayoutShelf(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); // Make two iterations - first without a message bubble which should make // the shelf disappear and then with a message bubble which should keep it @@ -2006,7 +2006,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_StatusAreaHitBoxCoversEdge) { ShelfLayoutManager* shelf = GetShelfLayoutManager(); StatusAreaWidget* status_area_widget = Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseTo(399,399); // Test bottom right pixel for bottom alignment. diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc index fb5c1db..1d7a8d0 100644 --- a/ash/shelf/shelf_view_unittest.cc +++ b/ash/shelf/shelf_view_unittest.cc @@ -37,13 +37,13 @@ #include "base/strings/string_number_conversions.h" #include "grit/ash_resources.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/l10n/l10n_util.h" #include "ui/compositor/layer.h" #include "ui/events/event.h" #include "ui/events/event_constants.h" +#include "ui/events/test/event_generator.h" #include "ui/views/view_model.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -517,8 +517,8 @@ class ShelfViewTest : public AshTestBase { gfx::Point center_point_of_drag_item = drag_button->GetBoundsInScreen().CenterPoint(); - aura::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow(), - center_point_of_drag_item); + ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow(), + center_point_of_drag_item); // Rip an item off to OverflowBubble. generator.PressLeftButton(); gfx::Point rip_off_point(center_point_of_drag_item.x(), 0); @@ -1326,7 +1326,7 @@ TEST_F(ShelfViewTest, ShouldHideTooltipWithAppListWindowTest) { TEST_F(ShelfViewTest, ShouldHideTooltipWhenHoveringOnTooltip) { ShelfTooltipManager* tooltip_manager = shelf_view_->tooltip_manager(); tooltip_manager->CreateZeroDelayTimerForTest(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); // Move the mouse off any item and check that no tooltip is shown. generator.MoveMouseTo(gfx::Point(0, 0)); @@ -1418,8 +1418,8 @@ TEST_F(ShelfViewTest, OverflowBubbleSize) { int item_width = test_for_overflow_view.GetButtonSize() + test_for_overflow_view.GetButtonSpacing(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); ShelfButton* button = test_for_overflow_view.GetButton(ripped_index); // Rip off the last visible item. gfx::Point start_point = button->GetBoundsInScreen().CenterPoint(); @@ -1606,7 +1606,7 @@ TEST_F(ShelfViewTest, CheckRipOffFromLeftShelfAlignmentWithMultiMonitor) { gfx::Point start_point = button->GetBoundsInScreen().CenterPoint(); wm::ConvertPointFromScreen(second_root, &start_point); - aura::test::EventGenerator generator(second_root, start_point); + ui::test::EventGenerator generator(second_root, start_point); // Rip off the browser item. generator.PressLeftButton(); diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc index 5d3faf6..aafb8cd 100644 --- a/ash/shell_unittest.cc +++ b/ash/shell_unittest.cc @@ -25,10 +25,10 @@ #include "base/strings/utf_string_conversions.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/models/simple_menu_model.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/events_test_utils.h" #include "ui/events/test/test_event_handler.h" #include "ui/gfx/size.h" @@ -509,7 +509,7 @@ TEST_F(ShellTest, TestPreTargetHandlerOrder) { TEST_F(ShellTest, EnvPreTargetHandler) { ui::test::TestEventHandler event_handler; aura::Env::GetInstance()->AddPreTargetHandler(&event_handler); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseBy(1, 1); EXPECT_NE(0, event_handler.num_mouse_events()); aura::Env::GetInstance()->RemovePreTargetHandler(&event_handler); diff --git a/ash/system/tray/system_tray_unittest.cc b/ash/system/tray/system_tray_unittest.cc index c798e78..74c7c02 100644 --- a/ash/system/tray/system_tray_unittest.cc +++ b/ash/system/tray/system_tray_unittest.cc @@ -18,10 +18,10 @@ #include "ash/wm/window_util.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/base/ui_base_types.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" @@ -417,8 +417,8 @@ TEST_F(SystemTrayTest, PersistentBubble) { tray->ShowDefaultView(BUBBLE_CREATE_NEW); ASSERT_TRUE(tray->HasSystemBubble()); { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - gfx::Point(5, 5)); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point(5, 5)); generator.ClickLeftButton(); ASSERT_FALSE(tray->HasSystemBubble()); } @@ -431,8 +431,8 @@ TEST_F(SystemTrayTest, PersistentBubble) { ASSERT_TRUE(tray->HasSystemBubble()); { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - gfx::Point(5, 5)); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point(5, 5)); generator.ClickLeftButton(); ASSERT_TRUE(tray->HasSystemBubble()); } diff --git a/ash/system/user/tray_user_unittest.cc b/ash/system/user/tray_user_unittest.cc index 25eae95..4868861 100644 --- a/ash/system/user/tray_user_unittest.cc +++ b/ash/system/user/tray_user_unittest.cc @@ -16,7 +16,7 @@ #include "ash/test/test_session_state_delegate.h" #include "ash/test/test_shell_delegate.h" #include "components/user_manager/user_info.h" -#include "ui/aura/test/event_generator.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/animation/animation_container_element.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" @@ -34,13 +34,13 @@ class TrayUserTest : public ash::test::AshTestBase { void InitializeParameters(int users_logged_in, bool multiprofile); // Show the system tray menu using the provided event generator. - void ShowTrayMenu(aura::test::EventGenerator* generator); + void ShowTrayMenu(ui::test::EventGenerator* generator); // Move the mouse over the user item. - void MoveOverUserItem(aura::test::EventGenerator* generator, int index); + void MoveOverUserItem(ui::test::EventGenerator* generator, int index); // Click on the user item. Note that the tray menu needs to be shown. - void ClickUserItem(aura::test::EventGenerator* generator, int index); + void ClickUserItem(ui::test::EventGenerator* generator, int index); // Accessors to various system components. ShelfLayoutManager* shelf() { return shelf_; } @@ -104,7 +104,7 @@ void TrayUserTest::InitializeParameters(int users_logged_in, tray_->AddTrayItem(tray_user_separator_); } -void TrayUserTest::ShowTrayMenu(aura::test::EventGenerator* generator) { +void TrayUserTest::ShowTrayMenu(ui::test::EventGenerator* generator) { gfx::Point center = tray()->GetBoundsInScreen().CenterPoint(); generator->MoveMouseTo(center.x(), center.y()); @@ -112,15 +112,15 @@ void TrayUserTest::ShowTrayMenu(aura::test::EventGenerator* generator) { generator->ClickLeftButton(); } -void TrayUserTest::MoveOverUserItem(aura::test::EventGenerator* generator, - int index) { +void TrayUserTest::MoveOverUserItem(ui::test::EventGenerator* generator, + int index) { gfx::Point center = tray_user(index)->GetUserPanelBoundsInScreenForTest().CenterPoint(); generator->MoveMouseTo(center.x(), center.y()); } -void TrayUserTest::ClickUserItem(aura::test::EventGenerator* generator, +void TrayUserTest::ClickUserItem(ui::test::EventGenerator* generator, int index) { MoveOverUserItem(generator, index); generator->ClickLeftButton(); @@ -143,7 +143,7 @@ TEST_F(TrayUserTest, SingleUserModeDoesNotAllowAddingUser) { InitializeParameters(1, false); // Move the mouse over the status area and click to open the status menu. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); EXPECT_FALSE(tray()->IsAnyBubbleVisible()); @@ -172,7 +172,7 @@ TEST_F(TrayUserTest, MutiUserModeDoesNotAllowToAddUser) { InitializeParameters(1, true); // Move the mouse over the status area and click to open the status menu. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.set_async(false); int max_users = delegate()->GetMaximumNumberOfLoggedInUsers(); @@ -232,7 +232,7 @@ TEST_F(TrayUserTest, MutiUserModeDoesNotAllowToAddUser) { TEST_F(TrayUserTest, MutiUserModeButtonClicks) { // Have two users. InitializeParameters(2, true); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); ShowTrayMenu(&generator); // Switch to a new user - which has a capitalized name. diff --git a/ash/system/web_notification/web_notification_tray_unittest.cc b/ash/system/web_notification/web_notification_tray_unittest.cc index 886e829..7f17c3b 100644 --- a/ash/system/web_notification/web_notification_tray_unittest.cc +++ b/ash/system/web_notification/web_notification_tray_unittest.cc @@ -22,8 +22,8 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #include "ui/message_center/message_center_style.h" @@ -437,7 +437,7 @@ TEST_F(WebNotificationTrayTest, MAYBE_PopupAndFullscreen) { EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden); // Move the mouse cursor at the bottom, which shows the shelf. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); gfx::Point bottom_right = Shell::GetScreen()->GetPrimaryDisplay().bounds().bottom_right(); bottom_right.Offset(-1, -1); diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index 3bf53dd..70db370c 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -22,7 +22,7 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/window_tree_client.h" -#include "ui/aura/test/event_generator.h" +#include "ui/aura/test/event_generator_delegate_aura.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" diff --git a/ash/tooltips/tooltip_controller_unittest.cc b/ash/tooltips/tooltip_controller_unittest.cc index c7834f9..bb01730 100644 --- a/ash/tooltips/tooltip_controller_unittest.cc +++ b/ash/tooltips/tooltip_controller_unittest.cc @@ -6,10 +6,10 @@ #include "ash/test/ash_test_base.h" #include "base/strings/utf_string_conversions.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/font.h" #include "ui/gfx/point.h" #include "ui/views/corewm/tooltip_controller.h" @@ -105,7 +105,7 @@ TEST_F(TooltipControllerTest, HideTooltipWhenCursorHidden) { EXPECT_EQ(base::string16(), helper_->GetTooltipText()); EXPECT_EQ(NULL, helper_->GetTooltipWindow()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseRelativeTo(widget->GetNativeView(), view->bounds().CenterPoint()); base::string16 expected_tooltip = base::ASCIIToUTF16("Tooltip Text"); @@ -148,7 +148,7 @@ TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) { EXPECT_EQ(widget2->GetNativeView()->GetRootWindow(), root_windows[1]); // Show tooltip on second display. - aura::test::EventGenerator generator(root_windows[1]); + ui::test::EventGenerator generator(root_windows[1]); generator.MoveMouseRelativeTo(widget2->GetNativeView(), view2->bounds().CenterPoint()); helper_->FireTooltipTimer(); @@ -167,7 +167,7 @@ TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) { // The tooltip should create a new aura window for itself, so we should still // be able to show tooltips on the primary display. - aura::test::EventGenerator generator1(root_windows[0]); + ui::test::EventGenerator generator1(root_windows[0]); generator1.MoveMouseRelativeTo(widget1->GetNativeView(), view1->bounds().CenterPoint()); helper_->FireTooltipTimer(); diff --git a/ash/wm/app_list_controller_unittest.cc b/ash/wm/app_list_controller_unittest.cc index da663d6..05ceae3 100644 --- a/ash/wm/app_list_controller_unittest.cc +++ b/ash/wm/app_list_controller_unittest.cc @@ -11,9 +11,9 @@ #include "base/memory/scoped_ptr.h" #include "ui/app_list/app_list_switches.h" #include "ui/app_list/views/app_list_view.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" +#include "ui/events/test/event_generator.h" namespace ash { @@ -86,8 +86,7 @@ TEST_P(AppListControllerTest, ClickOutsideBubbleClosesBubble) { aura::Window* app_window = shell->GetAppListWindow(); ASSERT_TRUE(app_window); - aura::test::EventGenerator generator(shell->GetPrimaryRootWindow(), - app_window); + ui::test::EventGenerator generator(shell->GetPrimaryRootWindow(), app_window); // Click on the bubble itself. The bubble should remain visible. generator.ClickLeftButton(); EXPECT_TRUE(shell->GetAppListTargetVisibility()); @@ -112,7 +111,7 @@ TEST_P(AppListControllerTest, TapOutsideBubbleClosesBubble) { ASSERT_TRUE(app_window); gfx::Rect app_window_bounds = app_window->GetBoundsInRootWindow(); - aura::test::EventGenerator generator(shell->GetPrimaryRootWindow()); + ui::test::EventGenerator generator(shell->GetPrimaryRootWindow()); // Click on the bubble itself. The bubble should remain visible. generator.GestureTapAt(app_window_bounds.CenterPoint()); EXPECT_TRUE(shell->GetAppListTargetVisibility()); diff --git a/ash/wm/dock/docked_window_resizer_unittest.cc b/ash/wm/dock/docked_window_resizer_unittest.cc index 82489dc..98c70b0 100644 --- a/ash/wm/dock/docked_window_resizer_unittest.cc +++ b/ash/wm/dock/docked_window_resizer_unittest.cc @@ -28,11 +28,11 @@ #include "base/command_line.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/window_tree_client.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/hit_test.h" #include "ui/base/ui_base_types.h" +#include "ui/events/test/event_generator.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/window_util.h" @@ -1588,7 +1588,7 @@ TEST_P(DockedWindowResizerTest, MaximizedDuringDrag) { // ToplevelWindowEventHandler::ScopedWindowResizer::OnWindowStateTypeChanged() // must be called in order for the maximized window's size to be correct. delegate()->set_window_component(HTCAPTION); - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); generator.MoveMouseTo(window->GetBoundsInScreen().origin()); generator.PressLeftButton(); generator.MoveMouseBy(10, 10); diff --git a/ash/wm/gestures/overview_gesture_handler_unittest.cc b/ash/wm/gestures/overview_gesture_handler_unittest.cc index 0c0ee28..6c1412b 100644 --- a/ash/wm/gestures/overview_gesture_handler_unittest.cc +++ b/ash/wm/gestures/overview_gesture_handler_unittest.cc @@ -6,11 +6,11 @@ #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/wm/overview/window_selector_controller.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" +#include "ui/events/test/event_generator.h" #include "ui/views/widget/widget.h" namespace ash { @@ -42,7 +42,7 @@ TEST_F(OverviewGestureHandlerTest, VerticalSwipes) { aura::Window* root_window = Shell::GetPrimaryRootWindow(); scoped_ptr<aura::Window> window1(CreateWindow(bounds)); scoped_ptr<aura::Window> window2(CreateWindow(bounds)); - aura::test::EventGenerator generator(root_window, root_window); + ui::test::EventGenerator generator(root_window, root_window); generator.ScrollSequence(gfx::Point(), base::TimeDelta::FromMilliseconds(5), 0, -500, 100, 3); EXPECT_TRUE(IsSelecting()); @@ -69,7 +69,7 @@ TEST_F(OverviewGestureHandlerTest, HorizontalSwipes) { aura::Window* root_window = Shell::GetPrimaryRootWindow(); scoped_ptr<aura::Window> window1(CreateWindow(bounds)); scoped_ptr<aura::Window> window2(CreateWindow(bounds)); - aura::test::EventGenerator generator(root_window, root_window); + ui::test::EventGenerator generator(root_window, root_window); generator.ScrollSequence(gfx::Point(), base::TimeDelta::FromMilliseconds(5), 600, -500, 100, 3); EXPECT_FALSE(IsSelecting()); @@ -86,7 +86,7 @@ TEST_F(OverviewGestureHandlerTest, SwipeUpDownWithoutReleasing) { aura::Window* root_window = Shell::GetPrimaryRootWindow(); scoped_ptr<aura::Window> window1(CreateWindow(bounds)); scoped_ptr<aura::Window> window2(CreateWindow(bounds)); - aura::test::EventGenerator generator(root_window, root_window); + ui::test::EventGenerator generator(root_window, root_window); base::TimeDelta timestamp = base::TimeDelta::FromInternalValue( base::TimeTicks::Now().ToInternalValue()); gfx::Point start; @@ -146,7 +146,7 @@ TEST_F(OverviewGestureHandlerTest, GestureSwipe) { aura::Window* root_window = Shell::GetPrimaryRootWindow(); scoped_ptr<aura::Window> window1(CreateWindow(bounds)); scoped_ptr<aura::Window> window2(CreateWindow(bounds)); - aura::test::EventGenerator generator(root_window, root_window); + ui::test::EventGenerator generator(root_window, root_window); gfx::Point start_points[3]; start_points[0] = start_points[1] = start_points[2] = gfx::Point(); generator.GestureMultiFingerScroll(3, start_points, 5, 10, 0, 100); @@ -163,7 +163,7 @@ TEST_F(OverviewGestureHandlerTest, GestureSwipeTopOfWindow) { aura::Window* root_window = Shell::GetPrimaryRootWindow(); scoped_ptr<aura::Window> window1(CreateWindow(bounds)); scoped_ptr<aura::Window> window2(CreateWindow(bounds)); - aura::test::EventGenerator generator(root_window, window2.get()); + ui::test::EventGenerator generator(root_window, window2.get()); gfx::Point start_points[3]; start_points[0] = start_points[1] = start_points[2] = gfx::Point(105, 105); generator.GestureMultiFingerScroll(3, start_points, 5, 10, 0, 100); diff --git a/ash/wm/immersive_fullscreen_controller_unittest.cc b/ash/wm/immersive_fullscreen_controller_unittest.cc index 0ba623f..dbab153 100644 --- a/ash/wm/immersive_fullscreen_controller_unittest.cc +++ b/ash/wm/immersive_fullscreen_controller_unittest.cc @@ -15,11 +15,11 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/test_event_handler.h" #include "ui/gfx/animation/slide_animation.h" #include "ui/views/bubble/bubble_delegate.h" @@ -231,7 +231,7 @@ class ImmersiveFullscreenControllerTest : public ash::test::AshTestBase { case MODALITY_GESTURE_TAP: { gfx::Point screen_position = event_position; views::View::ConvertPointToScreen(top_container_, &screen_position); - aura::test::EventGenerator& event_generator(GetEventGenerator()); + ui::test::EventGenerator& event_generator(GetEventGenerator()); event_generator.MoveTouch(event_position); event_generator.PressTouch(); event_generator.ReleaseTouch(); @@ -243,7 +243,7 @@ class ImmersiveFullscreenControllerTest : public ash::test::AshTestBase { gfx::Point end = revealed ? start + scroll_delta : start - scroll_delta; views::View::ConvertPointToScreen(top_container_, &start); views::View::ConvertPointToScreen(top_container_, &end); - aura::test::EventGenerator& event_generator(GetEventGenerator()); + ui::test::EventGenerator& event_generator(GetEventGenerator()); event_generator.GestureScrollSequence( start, end, base::TimeDelta::FromMilliseconds(30), 1); @@ -349,7 +349,7 @@ TEST_F(ImmersiveFullscreenControllerTest, OnMouseEvent) { ASSERT_TRUE(controller()->IsEnabled()); ASSERT_FALSE(controller()->IsRevealed()); - aura::test::EventGenerator& event_generator(GetEventGenerator()); + ui::test::EventGenerator& event_generator(GetEventGenerator()); gfx::Rect top_container_bounds_in_screen = top_container()->GetBoundsInScreen(); @@ -528,7 +528,7 @@ TEST_F(ImmersiveFullscreenControllerTest, MouseEventsVerticalDisplayLayout) { // The y position of the top edge of the primary display. int y_top_edge = primary_root_window_bounds_in_screen.y(); - aura::test::EventGenerator& event_generator(GetEventGenerator()); + ui::test::EventGenerator& event_generator(GetEventGenerator()); // Moving right below the top edge starts the hover timer running. We // cannot use MoveMouse() because MoveMouse() stops the timer if it started diff --git a/ash/wm/lock_state_controller_unittest.cc b/ash/wm/lock_state_controller_unittest.cc index 7c3f0e2..eea43c8 100644 --- a/ash/wm/lock_state_controller_unittest.cc +++ b/ash/wm/lock_state_controller_unittest.cc @@ -17,12 +17,12 @@ #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/compositor/scoped_layer_animation_settings.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" @@ -113,8 +113,7 @@ class LockStateControllerTest : public AshTestBase { protected: void GenerateMouseMoveEvent() { - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseTo(10, 10); } diff --git a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc index 089a232..39f77c7 100644 --- a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc +++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc @@ -14,8 +14,8 @@ #include "ash/test/test_screenshot_delegate.h" #include "ash/test/test_system_tray_delegate.h" #include "ash/test/test_volume_control_delegate.h" -#include "ui/aura/test/event_generator.h" #include "ui/events/event_handler.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/vector3d_f.h" #include "ui/message_center/message_center.h" @@ -270,7 +270,7 @@ TEST_F(MaximizeModeControllerTest, Screenshot) { Shell::GetInstance()->lock_state_controller()->SetDelegate( new test::TestLockStateControllerDelegate); aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::test::EventGenerator event_generator(root, root); + ui::test::EventGenerator event_generator(root, root); test::TestScreenshotDelegate* delegate = GetScreenshotDelegate(); delegate->set_can_take_screenshot(true); diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc index 8dc5575..445dd28 100644 --- a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc +++ b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc @@ -24,11 +24,11 @@ #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/base/hit_test.h" +#include "ui/events/test/event_generator.h" namespace ash { @@ -945,7 +945,7 @@ TEST_F(MaximizeModeWindowManagerTest, TryToDesktopSizeDragUnmaximizable) { // 1. Move the mouse over the caption and check that dragging the window does // change the location. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseTo(gfx::Point(rect.x() + 2, rect.y() + 2)); generator.PressLeftButton(); generator.MoveMouseBy(10, 5); @@ -1033,7 +1033,7 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromTop) { EXPECT_EQ(foreground_window.get(), wm::GetActiveWindow()); // Do an edge swipe top into screen. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.GestureScrollSequence(gfx::Point(50, 0), gfx::Point(50, 100), base::TimeDelta::FromMilliseconds(20), @@ -1077,7 +1077,7 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromBottom) { EXPECT_EQ(foreground_window.get(), wm::GetActiveWindow()); // Do an edge swipe bottom into screen. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); int y = Shell::GetPrimaryRootWindow()->bounds().bottom(); generator.GestureScrollSequence(gfx::Point(50, y), gfx::Point(50, y - 100), @@ -1113,7 +1113,7 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtTop) { EXPECT_EQ(foreground_window.get(), wm::GetActiveWindow()); // Touch tap on the top edge. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.GestureTapAt(gfx::Point(100, 0)); EXPECT_FALSE(foreground_window_state->IsFullscreen()); EXPECT_TRUE(background_window_state->IsFullscreen()); @@ -1149,7 +1149,7 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtBottom) { EXPECT_EQ(foreground_window.get(), wm::GetActiveWindow()); // Touch tap on the bottom edge. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.GestureTapAt( gfx::Point(100, Shell::GetPrimaryRootWindow()->bounds().bottom() - 1)); EXPECT_FALSE(foreground_window_state->IsFullscreen()); @@ -1183,7 +1183,7 @@ TEST_F(MaximizeModeWindowManagerTest, NoExitImmersiveModeWithEdgeSwipeFromTop) { window_state->set_in_immersive_fullscreen(true); // Do an edge swipe top into screen. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.GestureScrollSequence(gfx::Point(50, 0), gfx::Point(50, 100), base::TimeDelta::FromMilliseconds(20), @@ -1215,7 +1215,7 @@ TEST_F(MaximizeModeWindowManagerTest, EXPECT_TRUE(window_state->in_immersive_fullscreen()); // Do an edge swipe bottom into screen. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); int y = Shell::GetPrimaryRootWindow()->bounds().bottom(); generator.GestureScrollSequence(gfx::Point(50, y), gfx::Point(50, y - 100), diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index dddfeb1..c53664c 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc @@ -35,12 +35,12 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/focus_client.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/rect_conversions.h" #include "ui/gfx/transform.h" #include "ui/views/controls/label.h" @@ -170,13 +170,13 @@ class WindowSelectorTest : public test::AshTestBase { } void ClickWindow(aura::Window* window) { - aura::test::EventGenerator event_generator(window->GetRootWindow(), window); + ui::test::EventGenerator event_generator(window->GetRootWindow(), window); gfx::RectF target = GetTransformedBounds(window); event_generator.ClickLeftButton(); } void SendKey(ui::KeyboardCode key) { - aura::test::EventGenerator event_generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator event_generator(Shell::GetPrimaryRootWindow()); event_generator.PressKey(key, 0); event_generator.ReleaseKey(key, 0); } @@ -321,8 +321,8 @@ TEST_F(WindowSelectorTest, BasicGesture) { EXPECT_EQ(window1.get(), GetFocusedWindow()); ToggleOverview(); EXPECT_EQ(text_filter_widget()->GetNativeWindow(), GetFocusedWindow()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - window2.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + window2.get()); generator.GestureTapAt(gfx::ToEnclosingRect( GetTransformedTargetBounds(window2.get())).CenterPoint()); EXPECT_EQ(window2.get(), GetFocusedWindow()); @@ -377,7 +377,7 @@ TEST_F(WindowSelectorTest, CloseButton) { aura::Window* window2 = widget->GetNativeWindow(); gfx::RectF bounds = GetTransformedBoundsInRootWindow(window2); gfx::Point point(bounds.top_right().x() - 1, bounds.top_right().y() - 1); - aura::test::EventGenerator event_generator(window2->GetRootWindow(), point); + ui::test::EventGenerator event_generator(window2->GetRootWindow(), point); EXPECT_FALSE(widget->IsClosed()); event_generator.ClickLeftButton(); @@ -1013,7 +1013,7 @@ TEST_F(WindowSelectorTest, CloseButtonOnPanels) { gfx::RectF bounds1 = GetTransformedBoundsInRootWindow(window1); gfx::Point point1(bounds1.top_right().x() - 1, bounds1.top_right().y() - 1); - aura::test::EventGenerator event_generator1(window1->GetRootWindow(), point1); + ui::test::EventGenerator event_generator1(window1->GetRootWindow(), point1); EXPECT_FALSE(widget1->IsClosed()); event_generator1.ClickLeftButton(); @@ -1031,7 +1031,7 @@ TEST_F(WindowSelectorTest, CloseButtonOnPanels) { gfx::RectF bounds2 = GetTransformedBoundsInRootWindow(window2); gfx::Point point2(bounds2.top_right().x() - 1, bounds2.top_right().y() - 1); - aura::test::EventGenerator event_generator2(window2->GetRootWindow(), point2); + ui::test::EventGenerator event_generator2(window2->GetRootWindow(), point2); EXPECT_FALSE(widget2->IsClosed()); event_generator2.ClickLeftButton(); diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc index 4faeacb..1489972 100644 --- a/ash/wm/panels/panel_layout_manager_unittest.cc +++ b/ash/wm/panels/panel_layout_manager_unittest.cc @@ -31,12 +31,12 @@ #include "base/i18n/rtl.h" #include "base/run_loop.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/l10n/l10n_util.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #include "ui/views/widget/widget.h" namespace ash { @@ -220,7 +220,7 @@ class PanelLayoutManagerTest : public test::AshTestBase { int index = model->ItemIndexByID(GetShelfIDForWindow(window)); gfx::Rect bounds = test_api.GetButton(index)->GetBoundsInScreen(); - aura::test::EventGenerator& event_generator = GetEventGenerator(); + ui::test::EventGenerator& event_generator = GetEventGenerator(); event_generator.MoveMouseTo(bounds.CenterPoint()); event_generator.ClickLeftButton(); diff --git a/ash/wm/partial_screenshot_view_unittest.cc b/ash/wm/partial_screenshot_view_unittest.cc index d908331..3b763b4 100644 --- a/ash/wm/partial_screenshot_view_unittest.cc +++ b/ash/wm/partial_screenshot_view_unittest.cc @@ -9,8 +9,8 @@ #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" #include "ash/test/test_screenshot_delegate.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window_event_dispatcher.h" +#include "ui/events/test/event_generator.h" namespace ash { @@ -35,7 +35,7 @@ class PartialScreenshotViewTest : public test::AshTestBase { }; TEST_F(PartialScreenshotViewTest, BasicMouse) { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseTo(100, 100); generator.PressLeftButton(); @@ -53,7 +53,7 @@ TEST_F(PartialScreenshotViewTest, BasicMouse) { } TEST_F(PartialScreenshotViewTest, BasicTouch) { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.set_current_location(gfx::Point(100,100)); generator.GestureTapDownAndUp(gfx::Point(100,100)); diff --git a/ash/wm/resize_shadow_and_cursor_unittest.cc b/ash/wm/resize_shadow_and_cursor_unittest.cc index 0503a82..066c350 100644 --- a/ash/wm/resize_shadow_and_cursor_unittest.cc +++ b/ash/wm/resize_shadow_and_cursor_unittest.cc @@ -11,10 +11,10 @@ #include "ash/wm/resize_shadow_controller.h" #include "ash/wm/window_state.h" #include "base/bind.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/cursor/cursor.h" #include "ui/base/hit_test.h" +#include "ui/events/test/event_generator.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -116,7 +116,7 @@ class ResizeShadowAndCursorTest : public AshTestBase { // Test whether the resize shadows are visible and the cursor type based on the // mouse's position. TEST_F(ResizeShadowAndCursorTest, MouseHover) { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); ASSERT_TRUE(ash::wm::GetWindowState(window())->IsNormalStateType()); generator.MoveMouseTo(50, 50); @@ -159,7 +159,7 @@ TEST_F(ResizeShadowAndCursorTest, MouseHover) { // Test that the resize shadows stay visible and that the cursor stays the same // as long as a user is resizing a window. TEST_F(ResizeShadowAndCursorTest, MouseDrag) { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); ASSERT_TRUE(ash::wm::GetWindowState(window())->IsNormalStateType()); gfx::Size initial_size(window()->bounds().size()); @@ -183,7 +183,7 @@ TEST_F(ResizeShadowAndCursorTest, MouseDrag) { // Test that the resize shadows stay visible while resizing a window via touch. TEST_F(ResizeShadowAndCursorTest, Touch) { ASSERT_TRUE(ash::wm::GetWindowState(window())->IsNormalStateType()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); int start_x = 200 + ash::kResizeOutsideBoundsSize - 1; int start_y = 100 + ash::kResizeOutsideBoundsSize - 1; @@ -199,7 +199,7 @@ TEST_F(ResizeShadowAndCursorTest, Touch) { // Test that the resize shadows are not visible and that the default cursor is // used when the window is maximized. TEST_F(ResizeShadowAndCursorTest, MaximizeRestore) { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); ASSERT_TRUE(ash::wm::GetWindowState(window())->IsNormalStateType()); generator.MoveMouseTo(200, 50); diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc index 06b6fce..705e364 100644 --- a/ash/wm/system_gesture_event_filter_unittest.cc +++ b/ash/wm/system_gesture_event_filter_unittest.cc @@ -22,7 +22,6 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window_event_dispatcher.h" @@ -31,6 +30,7 @@ #include "ui/events/event_handler.h" #include "ui/events/event_utils.h" #include "ui/events/gestures/gesture_configuration.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/test_event_handler.h" #include "ui/gfx/screen.h" #include "ui/gfx/size.h" @@ -249,8 +249,7 @@ TEST_F(SystemGestureEventFilterTest, TwoFingerDrag) { gfx::Point(350, 350), }; - aura::test::EventGenerator generator(root_window, - toplevel->GetNativeWindow()); + ui::test::EventGenerator generator(root_window, toplevel->GetNativeWindow()); wm::WindowState* toplevel_state = wm::GetWindowState(toplevel->GetNativeWindow()); @@ -316,7 +315,7 @@ TEST_F(SystemGestureEventFilterTest, TwoFingerDragTwoWindows) { second_bounds.origin() + gfx::Vector2d(40, 20) }; - aura::test::EventGenerator generator(root_window); + ui::test::EventGenerator generator(root_window); // Do not drag too fast to avoid fling. generator.GestureMultiFingerScroll(kTouchPoints, points, 50, kSteps, 0, 150); @@ -341,8 +340,7 @@ TEST_F(SystemGestureEventFilterTest, WindowsWithMaxSizeDontSnap) { gfx::Point(bounds.x() + 30, bounds.y() + 20), }; - aura::test::EventGenerator generator(root_window, - toplevel->GetNativeWindow()); + ui::test::EventGenerator generator(root_window, toplevel->GetNativeWindow()); // Swipe down to minimize. generator.GestureMultiFingerScroll(kTouchPoints, points, 15, kSteps, 0, 150); @@ -405,8 +403,7 @@ TEST_F(SystemGestureEventFilterTest, DISABLED_TwoFingerDragEdge) { EXPECT_EQ(HTLEFT, toplevel->GetNativeWindow()->delegate()-> GetNonClientComponent(points[1])); - aura::test::EventGenerator generator(root_window, - toplevel->GetNativeWindow()); + ui::test::EventGenerator generator(root_window, toplevel->GetNativeWindow()); bounds = toplevel->GetNativeWindow()->bounds(); // Swipe down. Nothing should happen. @@ -466,8 +463,7 @@ TEST_F(SystemGestureEventFilterTest, TwoFingerDragDelayed) { EXPECT_EQ(HTCAPTION, toplevel->GetNativeWindow()->delegate()-> GetNonClientComponent(points[1])); - aura::test::EventGenerator generator(root_window, - toplevel->GetNativeWindow()); + ui::test::EventGenerator generator(root_window, toplevel->GetNativeWindow()); bounds = toplevel->GetNativeWindow()->bounds(); // Swipe right and down starting with one finger. @@ -502,8 +498,7 @@ TEST_F(SystemGestureEventFilterTest, ThreeFingerGestureStopsDrag) { EXPECT_EQ(HTCAPTION, toplevel->GetNativeWindow()->delegate()-> GetNonClientComponent(points[1])); - aura::test::EventGenerator generator(root_window, - toplevel->GetNativeWindow()); + ui::test::EventGenerator generator(root_window, toplevel->GetNativeWindow()); bounds = toplevel->GetNativeWindow()->bounds(); // Swipe right and down starting with two fingers. @@ -532,7 +527,7 @@ TEST_F(SystemGestureEventFilterTest, DragLeftNearEdgeSnaps) { gfx::Point(bounds.x() + bounds.width() / 2, bounds.y() + 5), }; aura::Window* toplevel_window = toplevel->GetNativeWindow(); - aura::test::EventGenerator generator(root_window, toplevel_window); + ui::test::EventGenerator generator(root_window, toplevel_window); // Check that dragging left snaps before reaching the screen edge. gfx::Rect work_area = @@ -560,7 +555,7 @@ TEST_F(SystemGestureEventFilterTest, DragRightNearEdgeSnaps) { gfx::Point(bounds.x() + bounds.width() / 2, bounds.y() + 5), }; aura::Window* toplevel_window = toplevel->GetNativeWindow(); - aura::test::EventGenerator generator(root_window, toplevel_window); + ui::test::EventGenerator generator(root_window, toplevel_window); // Check that dragging right snaps before reaching the screen edge. gfx::Rect work_area = diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc index ac03c10..6bc665b 100644 --- a/ash/wm/system_modal_container_layout_manager_unittest.cc +++ b/ash/wm/system_modal_container_layout_manager_unittest.cc @@ -13,12 +13,12 @@ #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/run_loop.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/compositor/test/layer_animator_test_controller.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/screen.h" #include "ui/keyboard/keyboard_controller.h" #include "ui/keyboard/keyboard_controller_proxy.h" @@ -230,7 +230,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalTransient) { EXPECT_TRUE(wm::IsActiveWindow(t1)); // Attempting to click the parent should result in no activation change. - aura::test::EventGenerator e1(Shell::GetPrimaryRootWindow(), parent.get()); + ui::test::EventGenerator e1(Shell::GetPrimaryRootWindow(), parent.get()); e1.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(t1)); @@ -245,7 +245,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalTransient) { EXPECT_EQ(GetModalContainer(), t2->parent()); // t2 should still be active, even after clicking on t1. - aura::test::EventGenerator e2(Shell::GetPrimaryRootWindow(), t1); + ui::test::EventGenerator e2(Shell::GetPrimaryRootWindow(), t1); e2.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(t2)); @@ -269,8 +269,8 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalNonTransient) { EXPECT_TRUE(wm::IsActiveWindow(t1.get())); // Attempting to click the parent should result in no activation change. - aura::test::EventGenerator e1(Shell::GetPrimaryRootWindow(), - Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator e1(Shell::GetPrimaryRootWindow(), + Shell::GetPrimaryRootWindow()); e1.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(t1.get())); @@ -285,7 +285,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalNonTransient) { EXPECT_EQ(GetModalContainer(), t2->parent()); // t2 should still be active, even after clicking on t1. - aura::test::EventGenerator e2(Shell::GetPrimaryRootWindow(), t1.get()); + ui::test::EventGenerator e2(Shell::GetPrimaryRootWindow(), t1.get()); e2.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(t2)); @@ -310,7 +310,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, CanActivateAfterEndModalSession) { EXPECT_TRUE(wm::IsActiveWindow(transient.get())); // Attempting to click the parent should result in no activation change. - aura::test::EventGenerator e1(Shell::GetPrimaryRootWindow(), parent.get()); + ui::test::EventGenerator e1(Shell::GetPrimaryRootWindow(), parent.get()); e1.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(transient.get())); @@ -324,7 +324,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, CanActivateAfterEndModalSession) { EXPECT_TRUE(wm::IsActiveWindow(parent.get())); // Attempting to click unrelated should activate it. - aura::test::EventGenerator e2(Shell::GetPrimaryRootWindow(), unrelated.get()); + ui::test::EventGenerator e2(Shell::GetPrimaryRootWindow(), unrelated.get()); e2.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(unrelated.get())); } @@ -335,7 +335,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, EventFocusContainers) { scoped_ptr<aura::Window> main( main_delegate->OpenTestWindowWithContext(CurrentContext())); EXPECT_TRUE(wm::IsActiveWindow(main.get())); - aura::test::EventGenerator e1(Shell::GetPrimaryRootWindow(), main.get()); + ui::test::EventGenerator e1(Shell::GetPrimaryRootWindow(), main.get()); e1.ClickLeftButton(); EXPECT_EQ(1, main_delegate->mouse_presses()); @@ -407,7 +407,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, ChangeCapture) { gfx::Point center(view->width() / 2, view->height() / 2); views::View::ConvertPointToScreen(view, ¢er); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), center); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), center); generator.PressLeftButton(); EXPECT_TRUE(view->got_press()); scoped_ptr<aura::Window> modal_window( diff --git a/ash/wm/toplevel_window_event_handler_unittest.cc b/ash/wm/toplevel_window_event_handler_unittest.cc index 74497f7..7c4f4d6 100644 --- a/ash/wm/toplevel_window_event_handler_unittest.cc +++ b/ash/wm/toplevel_window_event_handler_unittest.cc @@ -20,11 +20,11 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/hit_test.h" #include "ui/events/event.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/screen.h" #include "ui/wm/core/window_util.h" #include "ui/wm/public/window_move_client.h" @@ -80,12 +80,12 @@ class ToplevelWindowEventHandlerTest : public AshTestBase { } void DragFromCenterBy(aura::Window* window, int dx, int dy) { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window); generator.DragMouseBy(dx, dy); } void TouchDragFromCenterBy(aura::Window* window, int dx, int dy) { - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window); generator.PressMoveAndReleaseTouchBy(dx, dy); } @@ -130,7 +130,7 @@ TEST_F(ToplevelWindowEventHandlerTest, GrowBox) { window_delegate->set_minimum_size(gfx::Size(40, 40)); gfx::Point position = w1->bounds().origin(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseToCenterOf(w1.get()); generator.DragMouseBy(100, 100); // Position should not have changed. @@ -374,8 +374,8 @@ TEST_F(ToplevelWindowEventHandlerTest, DontDragIfModalChild) { // Verifies we don't let windows drag to a -y location. TEST_F(ToplevelWindowEventHandlerTest, DontDragToNegativeY) { scoped_ptr<aura::Window> target(CreateWindow(HTTOP)); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - target.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + target.get()); generator.MoveMouseTo(0, 5); generator.DragMouseBy(0, -5); // The y location and height should not have changed. @@ -401,8 +401,8 @@ TEST_F(ToplevelWindowEventHandlerTest, GestureDrag) { 0, gfx::Rect(0, 0, 100, 100))); wm::WindowState* window_state = wm::GetWindowState(target.get()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - target.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + target.get()); gfx::Rect old_bounds = target->bounds(); gfx::Point location(5, 5); target->SetProperty(aura::client::kCanMaximizeKey, true); @@ -481,8 +481,8 @@ TEST_F(ToplevelWindowEventHandlerTest, GestureDragMinimizeLoginScreen) { RootWindowController::ForWindow(target.get()) ->GetContainer(kShellWindowId_LockSystemModalContainer); lock->AddChild(target.get()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - target.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + target.get()); gfx::Rect old_bounds = target->bounds(); gfx::Point location(5, 5); target->SetProperty(aura::client::kCanMaximizeKey, true); @@ -506,8 +506,8 @@ TEST_F(ToplevelWindowEventHandlerTest, GestureDragToRestore) { wm::WindowState* window_state = wm::GetWindowState(window.get()); window_state->Activate(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - window.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + window.get()); gfx::Rect old_bounds = window->bounds(); gfx::Point location, end; end = location = window->GetBoundsInRootWindow().CenterPoint(); @@ -528,8 +528,8 @@ TEST_F(ToplevelWindowEventHandlerTest, GestureDragForUnresizableWindow) { scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION)); wm::WindowState* window_state = wm::GetWindowState(target.get()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - target.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + target.get()); gfx::Rect old_bounds = target->bounds(); gfx::Point location(5, 5); @@ -583,8 +583,8 @@ TEST_F(ToplevelWindowEventHandlerTest, GestureDragMultipleWindows) { new TestWindowDelegate(HTCAPTION), 1, gfx::Rect(100, 0, 100, 100))); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - target.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + target.get()); gfx::Rect old_bounds = target->bounds(); gfx::Point location(5, 5); target->SetProperty(aura::client::kCanMaximizeKey, true); @@ -598,8 +598,7 @@ TEST_F(ToplevelWindowEventHandlerTest, GestureDragMultipleWindows) { // Try to drag |notmoved| window. This should not move the window. { gfx::Rect bounds = notmoved->bounds(); - aura::test::EventGenerator gen(Shell::GetPrimaryRootWindow(), - notmoved.get()); + ui::test::EventGenerator gen(Shell::GetPrimaryRootWindow(), notmoved.get()); gfx::Point start = notmoved->bounds().origin() + gfx::Vector2d(10, 10); gfx::Point end = start + gfx::Vector2d(100, 10); gen.GestureScrollSequence(start, end, @@ -618,8 +617,8 @@ TEST_F(ToplevelWindowEventHandlerTest, GestureDragMultipleWindows) { #endif TEST_F(ToplevelWindowEventHandlerTest, MAYBE_EscapeReverts) { scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOMRIGHT)); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - target.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + target.get()); generator.PressLeftButton(); generator.MoveMouseBy(10, 11); @@ -644,8 +643,8 @@ TEST_F(ToplevelWindowEventHandlerTest, MAYBE_MinimizeMaximizeCompletes) { { scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION)); target->Focus(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - target.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + target.get()); generator.PressLeftButton(); generator.MoveMouseBy(10, 11); RunAllPendingInMessageLoop(); @@ -664,8 +663,8 @@ TEST_F(ToplevelWindowEventHandlerTest, MAYBE_MinimizeMaximizeCompletes) { { scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION)); target->Focus(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - target.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + target.get()); generator.PressLeftButton(); generator.MoveMouseBy(10, 11); RunAllPendingInMessageLoop(); @@ -689,8 +688,8 @@ TEST_F(ToplevelWindowEventHandlerTest, RunMoveLoopFailsDuringInProgressDrag) { EXPECT_EQ("0,0 100x100", window1->bounds().ToString()); scoped_ptr<aura::Window> window2(CreateWindow(HTCAPTION)); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - window1.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + window1.get()); window1->Focus(); generator.PressLeftButton(); generator.MoveMouseBy(10, 11); @@ -708,7 +707,7 @@ TEST_F(ToplevelWindowEventHandlerTest, RunMoveLoopFailsDuringInProgressDrag) { namespace { -void SendMouseReleaseAndReleaseCapture(aura::test::EventGenerator* generator, +void SendMouseReleaseAndReleaseCapture(ui::test::EventGenerator* generator, aura::Window* window) { generator->ReleaseLeftButton(); window->ReleaseCapture(); @@ -720,8 +719,8 @@ void SendMouseReleaseAndReleaseCapture(aura::test::EventGenerator* generator, // immediately after the mouse release. views::Widget has this behavior. TEST_F(ToplevelWindowEventHandlerTest, CaptureLossAfterMouseRelease) { scoped_ptr<aura::Window> window(CreateWindow(HTNOWHERE)); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - window.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + window.get()); generator.PressLeftButton(); window->SetCapture(); diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index 75b7e4e..c47c8e2 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -12,7 +12,6 @@ #include "ui/aura/client/focus_client.h" #include "ui/aura/env.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/base/cursor/cursor.h" @@ -20,6 +19,7 @@ #include "ui/events/event.h" #include "ui/events/event_processor.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/test_event_handler.h" #include "ui/gfx/screen.h" #include "ui/wm/core/compound_event_filter.h" @@ -174,8 +174,7 @@ TEST_F(WindowManagerTest, Focus) { SK_ColorGRAY, -13, gfx::Rect(5, 470, 50, 50), w1.get())); // Click on a sub-window (w121) to focus it. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - w121.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), w121.get()); generator.ClickLeftButton(); aura::client::FocusClient* focus_client = @@ -287,8 +286,7 @@ TEST_F(WindowManagerTest, ActivateOnMouse) { { // Click on window2. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - w2.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), w2.get()); generator.ClickLeftButton(); // Window2 should have become active. @@ -304,8 +302,7 @@ TEST_F(WindowManagerTest, ActivateOnMouse) { { // Click back on window1, but set it up so w1 doesn't activate on click. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - w1.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), w1.get()); d1.set_activate(false); generator.ClickLeftButton(); @@ -335,8 +332,8 @@ TEST_F(WindowManagerTest, ActivateOnMouse) { { scoped_ptr<aura::Window> w11(CreateTestWindowWithDelegate( &wd, -11, gfx::Rect(10, 10, 10, 10), w1.get())); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - w11.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + w11.get()); // First set the focus to the child |w11|. generator.ClickLeftButton(); EXPECT_EQ(w11.get(), focus_client->GetFocusedWindow()); @@ -361,8 +358,7 @@ TEST_F(WindowManagerTest, ActivateOnMouse) { // Move focus to |w2| first. scoped_ptr<aura::Window> w2(CreateTestWindowInShellWithDelegate( &wd, -1, gfx::Rect(70, 70, 50, 50))); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - w2.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), w2.get()); generator.ClickLeftButton(); EXPECT_EQ(w2.get(), focus_client->GetFocusedWindow()); EXPECT_FALSE(w11->CanFocus()); @@ -403,8 +399,8 @@ TEST_F(WindowManagerTest, PanelActivation) { NonFocusableDelegate nfd; scoped_ptr<aura::Window> w3(CreateTestWindowInShellWithDelegate( &nfd, -1, gfx::Rect(70, 70, 50, 50))); - aura::test::EventGenerator generator3(Shell::GetPrimaryRootWindow(), - w3.get()); + ui::test::EventGenerator generator3(Shell::GetPrimaryRootWindow(), + w3.get()); wm::ActivateWindow(p1.get()); EXPECT_TRUE(wm::IsActiveWindow(p1.get())); generator3.ClickLeftButton(); @@ -731,7 +727,7 @@ TEST_F(WindowManagerTest, AdditionalFilters) { #if defined(OS_CHROMEOS) || defined(OS_WIN) // Touch visually hides the cursor on ChromeOS and Windows TEST_F(WindowManagerTest, UpdateCursorVisibility) { - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); ::wm::CursorManager* cursor_manager = ash::Shell::GetInstance()->cursor_manager(); @@ -754,7 +750,7 @@ TEST_F(WindowManagerTest, UpdateCursorVisibility) { // ChromeOS is the only platform for which the cursor is hidden on keypress // (crbug.com/304296). TEST_F(WindowManagerTest, UpdateCursorVisibilityOnKeyEvent) { - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); ::wm::CursorManager* cursor_manager = ash::Shell::GetInstance()->cursor_manager(); @@ -777,7 +773,7 @@ TEST_F(WindowManagerTest, UpdateCursorVisibilityOnKeyEvent) { } TEST_F(WindowManagerTest, TestCursorClientObserver) { - aura::test::EventGenerator& generator = GetEventGenerator(); + ui::test::EventGenerator& generator = GetEventGenerator(); ::wm::CursorManager* cursor_manager = ash::Shell::GetInstance()->cursor_manager(); diff --git a/ash/wm/window_modality_controller_unittest.cc b/ash/wm/window_modality_controller_unittest.cc index 1519d27..8fbb64f 100644 --- a/ash/wm/window_modality_controller_unittest.cc +++ b/ash/wm/window_modality_controller_unittest.cc @@ -9,12 +9,12 @@ #include "ash/test/child_modal_window.h" #include "ash/wm/window_util.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/ui_base_types.h" +#include "ui/events/test/event_generator.h" #include "ui/views/test/capture_tracking_view.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/window_util.h" @@ -189,8 +189,8 @@ TEST_F(WindowModalityControllerTest, Events) { { // Clicking a point within w1 should activate that window. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - gfx::Point(10, 10)); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point(10, 10)); generator.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(w1.get())); } @@ -199,8 +199,8 @@ TEST_F(WindowModalityControllerTest, Events) { { // Clicking a point within w1 should activate w11. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - gfx::Point(10, 10)); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point(10, 10)); generator.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(w11.get())); } @@ -223,8 +223,8 @@ TEST_F(WindowModalityControllerTest, EventsForEclipsedWindows) { wm::ActivateWindow(w2.get()); { // Clicking a point on w1 that is not eclipsed by w2. - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - gfx::Point(90, 90)); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point(90, 90)); generator.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(w11.get())); } @@ -276,7 +276,7 @@ TEST_F(WindowModalityControllerTest, ChangeCapture) { gfx::Point center(view->width() / 2, view->height() / 2); views::View::ConvertPointToScreen(view, ¢er); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), center); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), center); generator.PressLeftButton(); EXPECT_TRUE(view->got_press()); @@ -347,8 +347,8 @@ TEST_F(WindowModalityControllerTest, TouchEvent) { TouchTrackerWindowDelegate d11; scoped_ptr<aura::Window> w11(CreateTestWindowInShellWithDelegate(&d11, -11, gfx::Rect(20, 20, 50, 50))); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - gfx::Point(10, 10)); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point(10, 10)); ::wm::AddTransientChild(w1.get(), w11.get()); d1.reset(); @@ -479,7 +479,7 @@ TEST_F(WindowModalityControllerTest, ChildModalEventGenerator) { EXPECT_FALSE(parent->HasFocus()); { - aura::test::EventGenerator generator( + ui::test::EventGenerator generator( Shell::GetPrimaryRootWindow(), parent->bounds().origin() + gfx::Vector2d(10, parent->bounds().height() - 10)); @@ -496,7 +496,7 @@ TEST_F(WindowModalityControllerTest, ChildModalEventGenerator) { } { - aura::test::EventGenerator generator( + ui::test::EventGenerator generator( Shell::GetPrimaryRootWindow(), parent->bounds().origin() + gfx::Vector2d(10, 10)); generator.ClickLeftButton(); @@ -511,7 +511,7 @@ TEST_F(WindowModalityControllerTest, ChildModalEventGenerator) { } { - aura::test::EventGenerator generator( + ui::test::EventGenerator generator( Shell::GetPrimaryRootWindow(), child->bounds().origin() + gfx::Vector2d(10, 10)); generator.ClickLeftButton(); diff --git a/ash/wm/workspace/multi_window_resize_controller_unittest.cc b/ash/wm/workspace/multi_window_resize_controller_unittest.cc index 9ff1d7c..7a7da34 100644 --- a/ash/wm/workspace/multi_window_resize_controller_unittest.cc +++ b/ash/wm/workspace/multi_window_resize_controller_unittest.cc @@ -8,13 +8,13 @@ #include "ash/test/ash_test_base.h" #include "ash/test/shell_test_api.h" #include "ash/wm/window_util.h" +#include "ash/wm/workspace/workspace_event_handler_test_helper.h" #include "ash/wm/workspace_controller.h" #include "ash/wm/workspace_controller_test_helper.h" -#include "ash/wm/workspace/workspace_event_handler_test_helper.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/base/hit_test.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" @@ -105,7 +105,7 @@ TEST_F(MultiWindowResizeControllerTest, BasicTests) { scoped_ptr<aura::Window> w2( CreateTestWindow(&delegate2, gfx::Rect(100, 0, 100, 100))); delegate2.set_window_component(HTRIGHT); - aura::test::EventGenerator generator(w1->GetRootWindow()); + ui::test::EventGenerator generator(w1->GetRootWindow()); generator.MoveMouseTo(w1->bounds().CenterPoint()); EXPECT_TRUE(HasPendingShow()); EXPECT_TRUE(IsShowing()); @@ -136,7 +136,7 @@ TEST_F(MultiWindowResizeControllerTest, DeleteWindow) { scoped_ptr<aura::Window> w2( CreateTestWindow(&delegate2, gfx::Rect(100, 0, 100, 100))); delegate2.set_window_component(HTRIGHT); - aura::test::EventGenerator generator(w1->GetRootWindow()); + ui::test::EventGenerator generator(w1->GetRootWindow()); generator.MoveMouseTo(w1->bounds().CenterPoint()); EXPECT_TRUE(HasPendingShow()); EXPECT_TRUE(IsShowing()); @@ -179,7 +179,7 @@ TEST_F(MultiWindowResizeControllerTest, Drag) { scoped_ptr<aura::Window> w2( CreateTestWindow(&delegate2, gfx::Rect(100, 0, 100, 100))); delegate2.set_window_component(HTRIGHT); - aura::test::EventGenerator generator(w1->GetRootWindow()); + ui::test::EventGenerator generator(w1->GetRootWindow()); generator.MoveMouseTo(w1->bounds().CenterPoint()); EXPECT_TRUE(HasPendingShow()); EXPECT_TRUE(IsShowing()); @@ -227,7 +227,7 @@ TEST_F(MultiWindowResizeControllerTest, Three) { CreateTestWindow(&delegate3, gfx::Rect(200, 0, 100, 100))); delegate3.set_window_component(HTRIGHT); - aura::test::EventGenerator generator(w1->GetRootWindow()); + ui::test::EventGenerator generator(w1->GetRootWindow()); generator.MoveMouseTo(w1->bounds().CenterPoint()); EXPECT_TRUE(HasPendingShow()); EXPECT_TRUE(IsShowing()); diff --git a/ash/wm/workspace/workspace_event_handler_unittest.cc b/ash/wm/workspace/workspace_event_handler_unittest.cc index f9a1e1a3..e9c9f15 100644 --- a/ash/wm/workspace/workspace_event_handler_unittest.cc +++ b/ash/wm/workspace/workspace_event_handler_unittest.cc @@ -13,12 +13,12 @@ #include "ash/wm/workspace_controller.h" #include "ash/wm/workspace_controller_test_helper.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/hit_test.h" #include "ui/events/event_processor.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/screen.h" #include "ui/wm/core/window_util.h" #include "ui/wm/public/window_move_client.h" @@ -93,8 +93,8 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisResizeEdge) { gfx::Rect work_area = Shell::GetScreen()->GetDisplayNearestWindow( window.get()).work_area(); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - window.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + window.get()); // Double-click the top resize edge. delegate.set_window_component(HTTOP); @@ -153,7 +153,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisResizeEdge) { window->SetBoundsInScreen(restored_bounds, ScreenUtil::GetSecondaryDisplay()); aura::Window* second_root = Shell::GetAllRootWindows()[1]; EXPECT_EQ(second_root, window->GetRootWindow()); - aura::test::EventGenerator generator2(second_root, window.get()); + ui::test::EventGenerator generator2(second_root, window.get()); // Y-axis maximization. delegate.set_window_component(HTTOP); @@ -212,8 +212,8 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisWhenSideSnapped) { // Double clicking the top border should not do anything for side snapped // windows. (They already take up the entire workspace height and reverting // to the restored bounds would be weird). - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - window.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + window.get()); delegate.set_window_component(HTTOP); generator.DoubleClickLeftButton(); EXPECT_EQ(wm::WINDOW_STATE_TYPE_LEFT_SNAPPED, window_state->GetStateType()); @@ -242,8 +242,8 @@ TEST_F(WorkspaceEventHandlerTest, delegate.set_maximum_size(gfx::Size(0, 100)); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - window.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + window.get()); // Double-click the top resize edge. delegate.set_window_component(HTTOP); generator.DoubleClickLeftButton(); @@ -266,8 +266,8 @@ TEST_F(WorkspaceEventHandlerTest, delegate.set_maximum_size(gfx::Size(100, 0)); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - window.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + window.get()); // Double-click the top resize edge. delegate.set_window_component(HTRIGHT); generator.DoubleClickLeftButton(); @@ -294,7 +294,7 @@ TEST_F(WorkspaceEventHandlerTest, wm::WindowState* window_state = wm::GetWindowState(window.get()); EXPECT_FALSE(window_state->IsMaximized()); aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::test::EventGenerator generator(root, window.get()); + ui::test::EventGenerator generator(root, window.get()); generator.DoubleClickLeftButton(); EXPECT_EQ("10,20 30x40", window->bounds().ToString()); EXPECT_FALSE(window_state->IsMaximized()); @@ -323,7 +323,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickCaptionTogglesMaximize) { // 1) Double clicking a normal window should maximize. delegate.set_window_component(HTCAPTION); aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::test::EventGenerator generator(root, window.get()); + ui::test::EventGenerator generator(root, window.get()); generator.ClickLeftButton(); generator.DoubleClickLeftButton(); EXPECT_NE(restore_bounds.ToString(), window->bounds().ToString()); @@ -379,7 +379,7 @@ TEST_F(WorkspaceEventHandlerTest, window->SetProperty(aura::client::kCanMaximizeKey, true); delegate.set_window_component(HTCAPTION); aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::test::EventGenerator generator(root, window.get()); + ui::test::EventGenerator generator(root, window.get()); WindowPropertyObserver observer(window.get()); ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(), @@ -410,8 +410,8 @@ TEST_F(WorkspaceEventHandlerTest, DoubleTapCaptionTogglesMaximize) { wm::WindowState* window_state = wm::GetWindowState(window.get()); EXPECT_FALSE(window_state->IsMaximized()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - window.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + window.get()); generator.GestureTapAt(gfx::Point(25, 25)); generator.GestureTapAt(gfx::Point(25, 25)); RunAllPendingInMessageLoop(); @@ -437,7 +437,7 @@ TEST_F(WorkspaceEventHandlerTest, DeleteWhenDragging) { const gfx::Rect bounds(10, 20, 30, 40); scoped_ptr<aura::Window> window(CreateTestWindow(&delegate, bounds)); delegate.set_window_component(HTCAPTION); - aura::test::EventGenerator generator(window->GetRootWindow()); + ui::test::EventGenerator generator(window->GetRootWindow()); generator.MoveMouseToCenterOf(window.get()); generator.PressLeftButton(); generator.MoveMouseTo(generator.current_location() + gfx::Vector2d(50, 50)); @@ -480,7 +480,7 @@ TEST_F(WorkspaceEventHandlerTest, // First click will go to a client delegate.set_window_component(HTCLIENT); aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::test::EventGenerator generator(root, window.get()); + ui::test::EventGenerator generator(root, window.get()); generator.ClickLeftButton(); EXPECT_FALSE(window_state->IsMaximized()); @@ -508,7 +508,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleTapTwoDifferentTargetsDoesntMaximize) { // First tap will go to a client delegate.set_window_component(HTCLIENT); aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::test::EventGenerator generator(root, window.get()); + ui::test::EventGenerator generator(root, window.get()); generator.GestureTapAt(gfx::Point(25, 25)); EXPECT_FALSE(window_state->IsMaximized()); @@ -535,7 +535,7 @@ TEST_F(WorkspaceEventHandlerTest, // First click will go to a client delegate.set_window_component(HTCLIENT); aura::Window* root = Shell::GetPrimaryRootWindow(); - aura::test::EventGenerator generator(root, window.get()); + ui::test::EventGenerator generator(root, window.get()); generator.ClickLeftButton(); EXPECT_FALSE(window_state->IsMaximized()); diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index 9fae0c9..49af2b7 100644 --- a/ash/wm/workspace/workspace_window_resizer_unittest.cc +++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc @@ -20,11 +20,11 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/hit_test.h" #include "ui/events/gestures/gesture_configuration.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/insets.h" #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" @@ -514,7 +514,7 @@ TEST_F(WorkspaceWindowResizerTest, MouseMoveWithTouchDrag) { window2_->SetBounds(gfx::Rect(400, 200, 100, 200)); Shell* shell = Shell::GetInstance(); - aura::test::EventGenerator generator(window_->GetRootWindow()); + ui::test::EventGenerator generator(window_->GetRootWindow()); // The cursor should not be locked initially. EXPECT_FALSE(shell->cursor_manager()->IsCursorLocked()); @@ -1739,8 +1739,8 @@ TEST_F(WorkspaceWindowResizerTest, TouchResizeToEdge_RIGHT) { EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 200).ToString(), touch_resize_window_->bounds().ToString()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - touch_resize_window_.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + touch_resize_window_.get()); // Drag out of the right border a bit and check if the border is aligned with // the touch point. @@ -1773,8 +1773,8 @@ TEST_F(WorkspaceWindowResizerTest, TouchResizeToEdge_LEFT) { EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 200).ToString(), touch_resize_window_->bounds().ToString()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - touch_resize_window_.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + touch_resize_window_.get()); // Drag out of the left border a bit and check if the border is aligned with // the touch point. @@ -1807,8 +1807,8 @@ TEST_F(WorkspaceWindowResizerTest, TouchResizeToEdge_TOP) { EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 200).ToString(), touch_resize_window_->bounds().ToString()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - touch_resize_window_.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + touch_resize_window_.get()); // Drag out of the top border a bit and check if the border is aligned with // the touch point. @@ -1841,8 +1841,8 @@ TEST_F(WorkspaceWindowResizerTest, TouchResizeToEdge_BOTTOM) { EXPECT_EQ(gfx::Rect(100, 100, 600, kRootHeight - 200).ToString(), touch_resize_window_->bounds().ToString()); - aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), - touch_resize_window_.get()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + touch_resize_window_.get()); // Drag out of the bottom border a bit and check if the border is aligned with // the touch point. diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc index fcfa414..e00390e 100644 --- a/ash/wm/workspace_controller_unittest.cc +++ b/ash/wm/workspace_controller_unittest.cc @@ -22,7 +22,6 @@ #include "ash/wm/workspace/workspace_window_resizer.h" #include "base/strings/string_number_conversions.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" @@ -32,6 +31,7 @@ #include "ui/compositor/layer.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/window_animations.h" @@ -367,8 +367,8 @@ TEST_F(WorkspaceControllerTest, MinimizeFullscreenWindow) { TEST_F(WorkspaceControllerTest, ShelfStateUpdated) { // Since ShelfLayoutManager queries for mouse location, move the mouse so // it isn't over the shelf. - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(0, 0); scoped_ptr<Window> w1(CreateTestWindow()); @@ -575,8 +575,8 @@ TEST_F(WorkspaceControllerTest, VisibilityTests) { // Verifies windows that are offscreen don't move when switching workspaces. TEST_F(WorkspaceControllerTest, DontMoveOnSwitch) { - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(0, 0); scoped_ptr<Window> w1(CreateTestWindow()); @@ -603,8 +603,8 @@ TEST_F(WorkspaceControllerTest, DontMoveOnSwitch) { // Verifies that windows that are completely offscreen move when switching // workspaces. TEST_F(WorkspaceControllerTest, MoveOnSwitch) { - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(0, 0); scoped_ptr<Window> w1(CreateTestWindow()); @@ -1397,8 +1397,8 @@ TEST_F(WorkspaceControllerTestDragging, DragWindowOverlapShelf) { shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); // Drag near the shelf. - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(10, 10); generator.PressLeftButton(); generator.MoveMouseTo(100, shelf->GetIdealBounds().y() - 70); @@ -1428,8 +1428,8 @@ TEST_F(WorkspaceControllerTestDragging, DragWindowKeepsShelfAutohidden) { EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); // Drag very little. - aura::test::EventGenerator generator( - Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point()); generator.MoveMouseTo(10, 10); generator.PressLeftButton(); generator.MoveMouseTo(12, 12); diff --git a/athena/home/DEPS b/athena/home/DEPS index 5240e2d..63e9180 100644 --- a/athena/home/DEPS +++ b/athena/home/DEPS @@ -5,6 +5,7 @@ include_rules = [ "+third_party/skia/include", "+ui/aura", "+ui/app_list", + "+ui/events", "+ui/gfx/image", "+ui/views", "+ui/wm/core", diff --git a/athena/home/home_card_unittest.cc b/athena/home/home_card_unittest.cc index 302acc3..31d0de1 100644 --- a/athena/home/home_card_unittest.cc +++ b/athena/home/home_card_unittest.cc @@ -8,7 +8,7 @@ #include "athena/activity/public/activity_manager.h" #include "athena/test/athena_test_base.h" #include "athena/wm/public/window_manager.h" -#include "ui/aura/test/event_generator.h" +#include "ui/events/test/event_generator.h" namespace athena { @@ -62,7 +62,7 @@ TEST_F(HomeCardTest, AppSelection) { TEST_F(HomeCardTest, Accelerators) { EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState()); - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN); EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState()); diff --git a/athena/input/accelerator_manager_unittest.cc b/athena/input/accelerator_manager_unittest.cc index 4f4c753..cd74ee1 100644 --- a/athena/input/accelerator_manager_unittest.cc +++ b/athena/input/accelerator_manager_unittest.cc @@ -6,7 +6,7 @@ #include "athena/input/public/input_manager.h" #include "athena/test/athena_test_base.h" -#include "ui/aura/test/event_generator.h" +#include "ui/events/test/event_generator.h" namespace athena { namespace { @@ -71,7 +71,7 @@ TEST_F(InputManagerTest, Basic) { accelerator_manager->RegisterAccelerators( data, arraysize(data), &test_handler); - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.PressKey(ui::VKEY_A, ui::EF_NONE); EXPECT_EQ(kInvalidCommandId, test_handler.GetFiredCommandIdAndReset()); diff --git a/athena/screen/DEPS b/athena/screen/DEPS index 0dbb68d..2497d27 100644 --- a/athena/screen/DEPS +++ b/athena/screen/DEPS @@ -2,6 +2,7 @@ include_rules = [ "+athena/input/public", "+ui/aura", "+ui/compositor", + "+ui/events", "+ui/gfx", "+ui/views", "+ui/wm", diff --git a/athena/screen/screen_manager_unittest.cc b/athena/screen/screen_manager_unittest.cc index d3b60c1..5070cd3 100644 --- a/athena/screen/screen_manager_unittest.cc +++ b/athena/screen/screen_manager_unittest.cc @@ -9,9 +9,9 @@ #include "athena/common/container_priorities.h" #include "athena/test/athena_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" +#include "ui/events/test/event_generator.h" #include "ui/wm/core/window_util.h" typedef athena::test::AthenaTestBase ScreenManagerTest; @@ -124,7 +124,7 @@ TEST_F(ScreenManagerTest, GrabInputContainer) { EXPECT_TRUE(wm::CanActivateWindow(normal_window.get())); wm::ActivateWindow(normal_window.get()); - aura::test::EventGenerator event_generator(root_window()); + ui::test::EventGenerator event_generator(root_window()); event_generator.MoveMouseTo(0, 0); event_generator.ClickLeftButton(); EXPECT_EQ("1 1", normal_delegate.GetMouseButtonCountsAndReset()); @@ -189,7 +189,7 @@ TEST_F(ScreenManagerTest, GrabShouldNotBlockVirtualKeyboard) { vk_container, &vk_delegate, gfx::Rect(0, 20, 100, 80))); EXPECT_TRUE(wm::CanActivateWindow(vk_window.get())); - aura::test::EventGenerator event_generator(root_window()); + ui::test::EventGenerator event_generator(root_window()); event_generator.MoveMouseTo(10, 25); event_generator.ClickLeftButton(); EXPECT_EQ("0 0", grab_delegate.GetMouseButtonCountsAndReset()); @@ -207,7 +207,7 @@ TEST_F(ScreenManagerTest, GrabAndMouseCapture) { scoped_ptr<aura::Window> normal_window(CreateTestWindow( normal_container, &normal_delegate, gfx::Rect(0, 0, 100, 100))); - aura::test::EventGenerator event_generator(root_window()); + ui::test::EventGenerator event_generator(root_window()); event_generator.MoveMouseTo(0, 0); event_generator.PressLeftButton(); diff --git a/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc b/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc index b03c6fe71..ed22cac 100644 --- a/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc +++ b/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc @@ -17,12 +17,12 @@ #include "chrome/test/base/ui_test_utils.h" #include "content/public/test/browser_test_utils.h" #include "ui/aura/client/cursor_client.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window_tree_host.h" #include "ui/compositor/compositor.h" #include "ui/compositor/test/draw_waiter_for_test.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/test_event_handler.h" namespace ui { @@ -88,7 +88,7 @@ private: // after the touch exploration mode is turned off. IN_PROC_BROWSER_TEST_F(TouchExplorationTest, ToggleOnOff) { SwitchTouchExplorationMode(true); - aura::test::EventGenerator generator(root_window_); + ui::test::EventGenerator generator(root_window_); base::TimeDelta initial_time = Now(); ui::TouchEvent initial_press( @@ -140,7 +140,7 @@ IN_PROC_BROWSER_TEST_F(TouchExplorationTest, ToggleOnOff) { // finger is still on the screen. IN_PROC_BROWSER_TEST_F(TouchExplorationTest, SplitTapExplore) { SwitchTouchExplorationMode(true); - aura::test::EventGenerator generator(root_window_); + ui::test::EventGenerator generator(root_window_); aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(root_window_); diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc index ee1cc92..61eb0a9 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc @@ -58,9 +58,9 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/app_list/views/apps_grid_view.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/events/event.h" +#include "ui/events/test/event_generator.h" using apps::AppWindow; using extensions::Extension; @@ -268,7 +268,7 @@ class ShelfAppBrowserTest : public ExtensionBrowserTest { // Try to rip off |item_index|. void RipOffItemIndex(int index, - aura::test::EventGenerator* generator, + ui::test::EventGenerator* generator, ash::test::ShelfViewTestAPI* test, RipOffCommand command) { ash::ShelfButton* button = test->GetButton(index); @@ -1606,8 +1606,8 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, ActivateAfterSessionRestore) { // TODO(skuhne): Test is flaky with a real compositor: crbug.com/331924 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, DISABLED_DragAndDrop) { // Get a number of interfaces we need. - aura::test::EventGenerator generator( - ash::Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow(), + gfx::Point()); ash::test::ShelfViewTestAPI test( ash::test::ShelfTestAPI(shelf_).shelf_view()); AppListService* service = AppListService::Get(chrome::GetActiveDesktop()); @@ -1752,7 +1752,7 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTestWithMultiMonitor, aura::Window* secondary_root_window = ash::Shell::GetAllRootWindows()[1]; ash::Shelf* secondary_shelf = ash::Shelf::ForWindow(secondary_root_window); - aura::test::EventGenerator generator(secondary_root_window, gfx::Point()); + ui::test::EventGenerator generator(secondary_root_window, gfx::Point()); ash::test::ShelfViewTestAPI test( ash::test::ShelfTestAPI(secondary_shelf).shelf_view()); AppListService* service = AppListService::Get(chrome::GetActiveDesktop()); @@ -1831,8 +1831,8 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTestWithMultiMonitor, // Do tests for removal of items from the shelf by dragging. IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, DragOffShelf) { - aura::test::EventGenerator generator( - ash::Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow(), + gfx::Point()); ash::test::ShelfViewTestAPI test( ash::test::ShelfTestAPI(shelf_).shelf_view()); test.SetAnimationDuration(1); // Speed up animations for test. @@ -1934,8 +1934,8 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, DragOffShelf) { // Check that clicking on an app shelf item launches a new browser. IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, ClickItem) { // Get a number of interfaces we need. - aura::test::EventGenerator generator( - ash::Shell::GetPrimaryRootWindow(), gfx::Point()); + ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow(), + gfx::Point()); ash::test::ShelfViewTestAPI test( ash::test::ShelfTestAPI(shelf_).shelf_view()); AppListService* service = AppListService::Get(chrome::GetActiveDesktop()); diff --git a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc index a3852d2..1d518bb 100644 --- a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc +++ b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc @@ -22,9 +22,9 @@ #include "content/public/browser/notification_service.h" #include "content/public/common/url_constants.h" #include "content/public/test/test_utils.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #if defined(OS_CHROMEOS) #include "chromeos/chromeos_switches.h" @@ -80,7 +80,7 @@ class TabScrubberTest : public InProcessBrowserTest, void SendScrubEvent(Browser* browser, int index) { aura::Window* window = browser->window()->GetNativeWindow(); aura::Window* root = window->GetRootWindow(); - aura::test::EventGenerator event_generator(root, window); + ui::test::EventGenerator event_generator(root, window); int active_index = browser->tab_strip_model()->active_index(); TabScrubber::Direction direction = index < active_index ? TabScrubber::LEFT : TabScrubber::RIGHT; @@ -107,7 +107,7 @@ class TabScrubberTest : public InProcessBrowserTest, void Scrub(Browser* browser, int index, ScrubType scrub_type) { aura::Window* window = browser->window()->GetNativeWindow(); aura::Window* root = window->GetRootWindow(); - aura::test::EventGenerator event_generator(root, window); + ui::test::EventGenerator event_generator(root, window); event_generator.set_async(true); activation_order_.clear(); int active_index = browser->tab_strip_model()->active_index(); @@ -150,7 +150,7 @@ class TabScrubberTest : public InProcessBrowserTest, void SendScrubSequence(Browser* browser, int x_offset, int index) { aura::Window* window = browser->window()->GetNativeWindow(); aura::Window* root = window->GetRootWindow(); - aura::test::EventGenerator event_generator(root, window); + ui::test::EventGenerator event_generator(root, window); bool wait_for_active = false; if (index != browser->tab_strip_model()->active_index()) { wait_for_active = true; diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc index cc064e1..46e29bd 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc @@ -18,7 +18,6 @@ #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/interactive_test_utils.h" #include "grit/generated_resources.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/clipboard/clipboard.h" @@ -28,6 +27,7 @@ #include "ui/base/ui_base_switches.h" #include "ui/events/event_processor.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #include "ui/views/controls/textfield/textfield_test_api.h" class OmniboxViewViewsTest : public InProcessBrowserTest { @@ -73,8 +73,8 @@ class OmniboxViewViewsTest : public InProcessBrowserTest { void TapBrowserWindowCenter() { gfx::Point center = BrowserView::GetBrowserViewForBrowser( browser())->GetBoundsInScreen().CenterPoint(); - aura::test::EventGenerator generator(browser()->window()-> - GetNativeWindow()->GetRootWindow()); + ui::test::EventGenerator generator( + browser()->window()->GetNativeWindow()->GetRootWindow()); generator.GestureTapAt(center); } diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index c7226a6..9632c6c 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc @@ -51,8 +51,9 @@ #include "ash/wm/window_util.h" #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" #include "ui/aura/client/screen_position_client.h" -#include "ui/aura/test/event_generator.h" +#include "ui/aura/test/event_generator_delegate_aura.h" #include "ui/aura/window_event_dispatcher.h" +#include "ui/events/test/event_generator.h" #endif using content::WebContents; @@ -360,8 +361,8 @@ class DetachToBrowserTabDragControllerTest virtual void SetUpOnMainThread() OVERRIDE { #if defined(OS_CHROMEOS) - event_generator_.reset(new aura::test::EventGenerator( - ash::Shell::GetPrimaryRootWindow())); + event_generator_.reset( + new ui::test::EventGenerator(ash::Shell::GetPrimaryRootWindow())); #endif } @@ -375,7 +376,7 @@ class DetachToBrowserTabDragControllerTest if (input_source() == INPUT_SOURCE_MOUSE) return; #if defined(OS_CHROMEOS) - event_generator_.reset(new aura::test::EventGenerator( + event_generator_.reset(new ui::test::EventGenerator( new ScreenEventGeneratorDelegate(ash::wm::GetRootWindowAt(point)))); #endif } @@ -529,7 +530,7 @@ class DetachToBrowserTabDragControllerTest private: #if defined(OS_CHROMEOS) - scoped_ptr<aura::test::EventGenerator> event_generator_; + scoped_ptr<ui::test::EventGenerator> event_generator_; #endif DISALLOW_COPY_AND_ASSIGN(DetachToBrowserTabDragControllerTest); diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc index a688ebf..5e1e389 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc @@ -13,9 +13,9 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/test/base/in_process_browser_test.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/test/ui_controls.h" +#include "ui/events/test/event_generator.h" #include "ui/views/controls/menu/menu_controller.h" #include "ui/views/view.h" #include "ui/views/view_model.h" @@ -54,7 +54,7 @@ gfx::Rect GetChromeIconBoundsForRootWindow(aura::Window* root_window) { } void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) { - aura::test::EventGenerator generator(root_window); + ui::test::EventGenerator generator(root_window); gfx::Point center = GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); gfx::Display display = diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index 2e4cab0..a5cf62b 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc @@ -39,7 +39,6 @@ #include "ui/aura/env.h" #include "ui/aura/layout_manager.h" #include "ui/aura/test/aura_test_helper.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_cursor_client.h" #include "ui/aura/test/test_screen.h" #include "ui/aura/test/test_window_delegate.h" @@ -52,6 +51,7 @@ #include "ui/events/event.h" #include "ui/events/event_utils.h" #include "ui/events/gestures/gesture_configuration.h" +#include "ui/events/test/event_generator.h" #include "ui/wm/core/default_activation_client.h" using testing::_; @@ -715,7 +715,7 @@ TEST_F(RenderWidgetHostViewAuraTest, DestroyPopupClickOutsidePopup) { EXPECT_FALSE(parent_window->GetBoundsInRootWindow().Contains(click_point)); TestWindowObserver observer(window); - aura::test::EventGenerator generator(window->GetRootWindow(), click_point); + ui::test::EventGenerator generator(window->GetRootWindow(), click_point); generator.ClickLeftButton(); ASSERT_TRUE(parent_view_->HasFocus()); ASSERT_TRUE(observer.destroyed()); @@ -742,7 +742,7 @@ TEST_F(RenderWidgetHostViewAuraTest, DestroyPopupTapOutsidePopup) { EXPECT_FALSE(parent_window->GetBoundsInRootWindow().Contains(tap_point)); TestWindowObserver observer(window); - aura::test::EventGenerator generator(window->GetRootWindow(), tap_point); + ui::test::EventGenerator generator(window->GetRootWindow(), tap_point); generator.GestureTapAt(tap_point); ASSERT_TRUE(parent_view_->HasFocus()); ASSERT_TRUE(observer.destroyed()); diff --git a/content/browser/web_contents/aura/window_slider_unittest.cc b/content/browser/web_contents/aura/window_slider_unittest.cc index b6bd738..da9d1c6 100644 --- a/content/browser/web_contents/aura/window_slider_unittest.cc +++ b/content/browser/web_contents/aura/window_slider_unittest.cc @@ -8,7 +8,6 @@ #include "base/time/time.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/base/hit_test.h" @@ -17,6 +16,7 @@ #include "ui/compositor/test/layer_animator_test_controller.h" #include "ui/events/event_processor.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/frame_time.h" namespace content { @@ -214,7 +214,7 @@ TEST_F(WindowSliderTest, WindowSlideUsingGesture) { window->SetBounds(gfx::Rect(0, 0, 400, 400)); WindowSliderDelegateTest slider_delegate; - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); // Generate a horizontal overscroll. WindowSlider* slider = @@ -307,7 +307,7 @@ TEST_F(WindowSliderTest, WindowSlideIsCancelledOnEvent) { new WindowSlider(&slider_delegate, root_window(), window.get()); for (int i = 0; events[i]; ++i) { // Generate a horizontal overscroll. - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.GestureScrollSequenceWithCallback( gfx::Point(10, 10), gfx::Point(80, 10), @@ -349,7 +349,7 @@ TEST_F(WindowSliderTest, WindowSlideInterruptedThenContinues) { gfx::Point(55, 10), 0, 0); - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); // Start the scroll sequence. Scroll forward so that |window|'s layer is the // one animating. @@ -449,7 +449,7 @@ TEST_F(WindowSliderTest, OwnerWindowChangesDuringWindowSlide) { // Generate a horizontal scroll, and change the owner in the middle of the // scroll. - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); aura::Window* old_window = window.get(); generator.GestureScrollSequenceWithCallback( gfx::Point(10, 10), @@ -481,7 +481,7 @@ TEST_F(WindowSliderTest, NoSlideWhenLayerCantBeCreated) { WindowSlider* slider = new WindowSlider(&slider_delegate, root_window(), window.get()); - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); // No slide in progress should be reported during scroll since the layer // wasn't created. @@ -527,7 +527,7 @@ TEST_F(WindowSliderTest, OwnerIsDestroyedOnSliderDestroy) { EXPECT_EQ(child_windows + 1, root_window()->children().size()); WindowSliderDeleteOwnerOnDestroy slider_delegate(window); - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); // Generate a horizontal overscroll. scoped_ptr<WindowSlider> slider( @@ -558,7 +558,7 @@ TEST_F(WindowSliderTest, OwnerIsDestroyedOnSlideComplete) { EXPECT_EQ(child_windows + 1, root_window()->children().size()); WindowSliderDeleteOwnerOnComplete slider_delegate(window); - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); // Generate a horizontal overscroll. new WindowSlider(&slider_delegate, root_window(), window); @@ -595,7 +595,7 @@ TEST_F(WindowSliderTest, SwipeDuringSwipeAnimation) { animator->set_disable_timer_for_test(true); ui::LayerAnimatorTestController test_controller(animator); - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); // Swipe forward so that |window|'s layer is the one animating. generator.GestureScrollSequence( diff --git a/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc b/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc index a44174e..421f4ba 100644 --- a/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc +++ b/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc @@ -19,12 +19,12 @@ #include "content/public/test/test_utils.h" #include "content/shell/browser/shell.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/ui_base_switches.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" using blink::WebInputEvent; @@ -149,7 +149,7 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, RenderWidgetHostViewAura* rwhva = static_cast<RenderWidgetHostViewAura*>( web_contents->GetRenderWidgetHostView()); aura::Window* content = web_contents->GetContentNativeView(); - aura::test::EventGenerator generator(content->GetRootWindow(), content); + ui::test::EventGenerator generator(content->GetRootWindow(), content); gfx::Rect bounds = content->GetBoundsInRootWindow(); touch_editable->Reset(); @@ -331,7 +331,7 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, RenderWidgetHostViewAura* rwhva = static_cast<RenderWidgetHostViewAura*>( web_contents->GetRenderWidgetHostView()); aura::Window* content = web_contents->GetContentNativeView(); - aura::test::EventGenerator generator(content->GetRootWindow(), content); + ui::test::EventGenerator generator(content->GetRootWindow(), content); gfx::Rect bounds = content->GetBoundsInRootWindow(); EXPECT_EQ(GetRenderWidgetHostViewAura(touch_editable), rwhva); diff --git a/content/browser/web_contents/web_contents_view_aura_browsertest.cc b/content/browser/web_contents/web_contents_view_aura_browsertest.cc index 0581bf0..5be3ab8 100644 --- a/content/browser/web_contents/web_contents_view_aura_browsertest.cc +++ b/content/browser/web_contents/web_contents_view_aura_browsertest.cc @@ -27,12 +27,12 @@ #include "content/public/test/test_renderer_host.h" #include "content/public/test/test_utils.h" #include "content/shell/browser/shell.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/events/event_processor.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" namespace content { @@ -184,7 +184,7 @@ class WebContentsViewAuraTest : public ContentBrowserTest { aura::Window* content = web_contents->GetContentNativeView(); gfx::Rect bounds = content->GetBoundsInRootWindow(); - aura::test::EventGenerator generator(content->GetRootWindow(), content); + ui::test::EventGenerator generator(content->GetRootWindow(), content); const int kScrollDurationMs = 20; const int kScrollSteps = 10; @@ -445,7 +445,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, MAYBE_OverscrollScreenshot) { content::TitleWatcher title_watcher(web_contents, expected_title); aura::Window* content = web_contents->GetContentNativeView(); gfx::Rect bounds = content->GetBoundsInRootWindow(); - aura::test::EventGenerator generator(content->GetRootWindow(), content); + ui::test::EventGenerator generator(content->GetRootWindow(), content); generator.GestureScrollSequence( gfx::Point(bounds.x() + 2, bounds.y() + 10), gfx::Point(bounds.right() - 10, bounds.y() + 10), @@ -618,7 +618,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, aura::Window* content = web_contents->GetContentNativeView(); gfx::Rect bounds = content->GetBoundsInRootWindow(); - aura::test::EventGenerator generator(content->GetRootWindow(), content); + ui::test::EventGenerator generator(content->GetRootWindow(), content); generator.GestureScrollSequence( gfx::Point(bounds.x() + 2, bounds.y() + 10), gfx::Point(bounds.right() - 10, bounds.y() + 10), @@ -639,7 +639,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, ContentWindowClose) { aura::Window* content = web_contents->GetContentNativeView(); gfx::Rect bounds = content->GetBoundsInRootWindow(); - aura::test::EventGenerator generator(content->GetRootWindow(), content); + ui::test::EventGenerator generator(content->GetRootWindow(), content); generator.GestureScrollSequence( gfx::Point(bounds.x() + 2, bounds.y() + 10), gfx::Point(bounds.right() - 10, bounds.y() + 10), @@ -687,7 +687,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, aura::Window* content = web_contents->GetContentNativeView(); gfx::Rect bounds = content->GetBoundsInRootWindow(); - aura::test::EventGenerator generator(content->GetRootWindow(), content); + ui::test::EventGenerator generator(content->GetRootWindow(), content); // Do a swipe left to start a forward navigation. Then quickly do a swipe // right. diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn index c3a6942..6395c56 100644 --- a/ui/aura/BUILD.gn +++ b/ui/aura/BUILD.gn @@ -150,8 +150,8 @@ source_set("test_support") { "test/aura_test_utils.cc", "test/aura_test_utils.h", "test/env_test_helper.h", - "test/event_generator.cc", - "test/event_generator.h", + "test/event_generator_delegate_aura.cc", + "test/event_generator_delegate_aura.h", "test/test_cursor_client.cc", "test/test_cursor_client.h", "test/test_focus_client.cc", diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp index 6a5788f..84e5477 100644 --- a/ui/aura/aura.gyp +++ b/ui/aura/aura.gyp @@ -168,8 +168,8 @@ 'test/aura_test_utils.cc', 'test/aura_test_utils.h', 'test/env_test_helper.h', - 'test/event_generator.cc', - 'test/event_generator.h', + 'test/event_generator_delegate_aura.cc', + 'test/event_generator_delegate_aura.h', 'test/test_cursor_client.cc', 'test/test_cursor_client.h', 'test/test_focus_client.cc', diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc index 872fded..ad99093 100644 --- a/ui/aura/gestures/gesture_recognizer_unittest.cc +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc @@ -10,7 +10,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/env.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" @@ -24,6 +23,7 @@ #include "ui/events/gestures/gesture_recognizer_impl.h" #include "ui/events/gestures/gesture_sequence.h" #include "ui/events/gestures/gesture_types.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/events_test_utils.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" @@ -2472,7 +2472,7 @@ TEST_P(GestureRecognizerTest, GestureEndLocation) { GestureEventConsumeDelegate delegate; scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( &delegate, -1234, gfx::Rect(10, 10, 300, 300), root_window())); - EventGenerator generator(root_window(), window.get()); + ui::test::EventGenerator generator(root_window(), window.get()); const gfx::Point begin(20, 20); const gfx::Point end(150, 150); const gfx::Vector2d window_offset = @@ -2495,7 +2495,7 @@ TEST_P(GestureRecognizerTest, CaptureSendsGestureEnd) { scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( delegate.get(), -1234, gfx::Rect(10, 10, 300, 300), root_window())); - EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseRelativeTo(window.get(), gfx::Point(10, 10)); generator.PressTouch(); @@ -2526,7 +2526,7 @@ TEST_P(GestureRecognizerTest, CaptureDoesNotCancelFinishedTouches) { -1234, gfx::Rect(10, 10, 300, 300), root_window())); window1->SetCapture(); - EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); TimedEvents tes; // Generate two touch-press events on the window. @@ -2865,7 +2865,7 @@ TEST_P(GestureRecognizerTest, MultiFingerSwipe) { gfx::Point(80, 50) }; - aura::test::EventGenerator generator(root_window(), window.get()); + ui::test::EventGenerator generator(root_window(), window.get()); // The unified gesture recognizer assumes a finger has stopped if it hasn't // moved for too long. See ui/events/gesture_detection/velocity_tracker.cc's diff --git a/ui/aura/test/event_generator.cc b/ui/aura/test/event_generator_delegate_aura.cc index e899afd..a32ab5b 100644 --- a/ui/aura/test/event_generator.cc +++ b/ui/aura/test/event_generator_delegate_aura.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/aura/test/event_generator.h" +#include "ui/aura/test/event_generator_delegate_aura.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/window_event_dispatcher.h" diff --git a/ui/aura/test/event_generator.h b/ui/aura/test/event_generator_delegate_aura.h index aed36d6..5850789 100644 --- a/ui/aura/test/event_generator.h +++ b/ui/aura/test/event_generator_delegate_aura.h @@ -1,11 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(tapted): Rename this file event_generator_delegate_aura.h. - -#ifndef UI_AURA_TEST_EVENT_GENERATOR_H_ -#define UI_AURA_TEST_EVENT_GENERATOR_H_ +#ifndef UI_AURA_TEST_EVENT_GENERATOR_DELEGATE_AURA_H_ +#define UI_AURA_TEST_EVENT_GENERATOR_DELEGATE_AURA_H_ #include "ui/events/test/event_generator.h" @@ -51,11 +49,7 @@ class EventGeneratorDelegateAura : public ui::test::EventGeneratorDelegate { DISALLOW_COPY_AND_ASSIGN(EventGeneratorDelegateAura); }; -// Expose the EventGenerator from ui::test in the aura::test namespace. -// TODO(tapted): Remove this. -using ui::test::EventGenerator; - } // namespace test } // namespace aura -#endif // UI_AURA_TEST_EVENT_GENERATOR_H_ +#endif // UI_AURA_TEST_EVENT_GENERATOR_DELEGATE_AURA_H_ diff --git a/ui/aura/window_event_dispatcher_unittest.cc b/ui/aura/window_event_dispatcher_unittest.cc index 8b97aa4..a6cca1a 100644 --- a/ui/aura/window_event_dispatcher_unittest.cc +++ b/ui/aura/window_event_dispatcher_unittest.cc @@ -15,7 +15,6 @@ #include "ui/aura/env.h" #include "ui/aura/test/aura_test_base.h" #include "ui/aura/test/env_test_helper.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_cursor_client.h" #include "ui/aura/test/test_screen.h" #include "ui/aura/test/test_window_delegate.h" @@ -28,6 +27,7 @@ #include "ui/events/event_utils.h" #include "ui/events/gestures/gesture_configuration.h" #include "ui/events/keycodes/keyboard_codes.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/test_event_handler.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" @@ -318,7 +318,7 @@ TEST_F(WindowEventDispatcherTest, CanProcessEventsWithinSubtree) { { // Attempting to send a key event to w1 (not in the lock container) should // cause focus to be reset. - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.PressKey(ui::VKEY_SPACE, 0); EXPECT_EQ(NULL, client::GetFocusClient(w1)->GetFocusedWindow()); EXPECT_FALSE(IsFocusedWindow(w1)); @@ -327,12 +327,12 @@ TEST_F(WindowEventDispatcherTest, CanProcessEventsWithinSubtree) { { // Events sent to a window not in the lock container will not be processed. // i.e. never sent to the non-lock container's event filter. - test::EventGenerator generator(root_window(), w1); + ui::test::EventGenerator generator(root_window(), w1); generator.ClickLeftButton(); EXPECT_EQ(0, nonlock_ef.num_mouse_events()); // Events sent to a window in the lock container will be processed. - test::EventGenerator generator3(root_window(), w3.get()); + ui::test::EventGenerator generator3(root_window(), w3.get()); generator3.PressLeftButton(); EXPECT_EQ(1, lock_ef.num_mouse_events()); } @@ -826,7 +826,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeldOnScroll) { &delegate, 1, gfx::Rect(50, 50, 100, 100), root_window())); window->AddPreTargetHandler(&handler); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.GestureScrollSequence( gfx::Point(60, 60), gfx::Point(10, 60), base::TimeDelta::FromMilliseconds(100), 25); @@ -1163,7 +1163,7 @@ TEST_F(WindowEventDispatcherTest, DeleteWindowDuringDispatch) { w1->AddPreTargetHandler(&w1_filter); client::GetFocusClient(w1.get())->FocusWindow(w11); - test::EventGenerator generator(root_window(), w11); + ui::test::EventGenerator generator(root_window(), w11); // First up, no one deletes anything. tracker.Add(w11); @@ -1227,7 +1227,7 @@ TEST_F(WindowEventDispatcherTest, DetachesParentOnTapDelegate delegate; scoped_ptr<Window> parent(CreateNormalWindow(22, w1.get(), NULL)); Window* child = CreateNormalWindow(11, parent.get(), &delegate); - test::EventGenerator generator(root_window(), child); + ui::test::EventGenerator generator(root_window(), child); generator.GestureTapAt(gfx::Point(40, 40)); } @@ -1236,7 +1236,7 @@ namespace { // A window delegate that processes nested gestures on tap. class NestedGestureDelegate : public test::TestWindowDelegate { public: - NestedGestureDelegate(test::EventGenerator* generator, + NestedGestureDelegate(ui::test::EventGenerator* generator, const gfx::Point tap_location) : generator_(generator), tap_location_(tap_location), @@ -1264,7 +1264,7 @@ class NestedGestureDelegate : public test::TestWindowDelegate { } } - test::EventGenerator* generator_; + ui::test::EventGenerator* generator_; const gfx::Point tap_location_; int gesture_end_count_; DISALLOW_COPY_AND_ASSIGN(NestedGestureDelegate); @@ -1278,13 +1278,13 @@ TEST_F(WindowEventDispatcherTest, GestureEndDeliveredAfterNestedGestures) { scoped_ptr<Window> w1(CreateNormalWindow(1, root_window(), &d1)); w1->SetBounds(gfx::Rect(0, 0, 100, 100)); - test::EventGenerator nested_generator(root_window(), w1.get()); + ui::test::EventGenerator nested_generator(root_window(), w1.get()); NestedGestureDelegate d2(&nested_generator, w1->bounds().CenterPoint()); scoped_ptr<Window> w2(CreateNormalWindow(1, root_window(), &d2)); w2->SetBounds(gfx::Rect(100, 0, 100, 100)); // Tap on w2 which triggers nested gestures for w1. - test::EventGenerator generator(root_window(), w2.get()); + ui::test::EventGenerator generator(root_window(), w2.get()); generator.GestureTapAt(w2->bounds().CenterPoint()); // Both windows should get their gesture end events. @@ -1401,11 +1401,11 @@ TEST_F(WindowEventDispatcherTest, GestureRepostEventOrder) { // Generate a tap down gesture for the repost_source. This will be reposted // to repost_target. - test::EventGenerator repost_generator(root_window(), repost_source.get()); + ui::test::EventGenerator repost_generator(root_window(), repost_source.get()); repost_generator.GestureTapAt(gfx::Point(40, 40)); RunAllPendingInMessageLoop(); - test::EventGenerator scroll_generator(root_window(), repost_target.get()); + ui::test::EventGenerator scroll_generator(root_window(), repost_target.get()); scroll_generator.GestureScrollSequence( gfx::Point(80, 80), gfx::Point(100, 100), @@ -1465,7 +1465,7 @@ TEST_F(WindowEventDispatcherTest, DeleteWindowDuringMouseMovedDispatch) { w1->SetBounds(gfx::Rect(20, 20, 60, 60)); EXPECT_EQ(NULL, host()->dispatcher()->mouse_moved_handler()); - test::EventGenerator generator(root_window(), w1.get()); + ui::test::EventGenerator generator(root_window(), w1.get()); // Move mouse over window 1 to set it as the |mouse_moved_handler_| for the // root window. @@ -1966,7 +1966,7 @@ TEST_F(WindowEventDispatcherTestInHighDPI, TouchMovesHeldOnScroll) { &delegate, 1, gfx::Rect(50, 50, 100, 100), root_window())); window->AddPreTargetHandler(&handler); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.GestureScrollSequence( gfx::Point(120, 120), gfx::Point(20, 120), base::TimeDelta::FromMilliseconds(100), 25); @@ -2008,7 +2008,7 @@ class SelfDestructDelegate : public test::TestWindowDelegate { }; TEST_F(WindowEventDispatcherTest, SynthesizedLocatedEvent) { - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseTo(10, 10); EXPECT_EQ("10,10", Env::GetInstance()->last_mouse_location().ToString()); diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index 52c33ef..ae548c4 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc @@ -20,7 +20,6 @@ #include "ui/aura/client/window_tree_client.h" #include "ui/aura/test/aura_test_base.h" #include "ui/aura/test/aura_test_utils.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/test/window_test_api.h" @@ -39,6 +38,7 @@ #include "ui/events/event_utils.h" #include "ui/events/gestures/gesture_configuration.h" #include "ui/events/keycodes/keyboard_codes.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/canvas.h" #include "ui/gfx/screen.h" #include "ui/gfx/skia_util.h" @@ -781,7 +781,7 @@ TEST_F(WindowTest, CaptureTests) { EXPECT_TRUE(window->HasCapture()); EXPECT_EQ(0, delegate.capture_lost_count()); EXPECT_EQ(0, delegate.capture_changed_event_count()); - EventGenerator generator(root_window(), gfx::Point(50, 50)); + ui::test::EventGenerator generator(root_window(), gfx::Point(50, 50)); generator.PressLeftButton(); EXPECT_EQ(1, delegate.mouse_event_count()); generator.ReleaseLeftButton(); @@ -1038,7 +1038,7 @@ TEST_F(WindowTest, ChangeCaptureWhileMouseDown) { EXPECT_TRUE(window->HasCapture()); EXPECT_EQ(0, delegate.capture_lost_count()); EXPECT_EQ(0, delegate.capture_changed_event_count()); - EventGenerator generator(root_window(), gfx::Point(50, 50)); + ui::test::EventGenerator generator(root_window(), gfx::Point(50, 50)); generator.PressLeftButton(); EXPECT_EQ(0, delegate.capture_lost_count()); EXPECT_EQ(0, delegate.capture_changed_event_count()); @@ -1141,7 +1141,7 @@ TEST_F(WindowTest, MouseEnterExit) { CreateTestWindowWithDelegate(&d2, 2, gfx::Rect(70, 70, 50, 50), root_window())); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseToCenterOf(w1.get()); EXPECT_TRUE(d1.entered()); EXPECT_FALSE(d1.exited()); @@ -1162,7 +1162,7 @@ TEST_F(WindowTest, WindowTreeHostExit) { CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50), root_window())); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseToCenterOf(w1.get()); EXPECT_TRUE(d1.entered()); EXPECT_FALSE(d1.exited()); @@ -1188,7 +1188,7 @@ TEST_F(WindowTest, MouseEnterExitWithClick) { CreateTestWindowWithDelegate(&d2, 2, gfx::Rect(70, 70, 50, 50), root_window())); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseToCenterOf(w1.get()); EXPECT_TRUE(d1.entered()); EXPECT_FALSE(d1.exited()); @@ -1214,7 +1214,7 @@ TEST_F(WindowTest, MouseEnterExitWhenDeleteWithCapture) { CreateTestWindowWithDelegate(&delegate, 1, gfx::Rect(10, 10, 50, 50), root_window())); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseToCenterOf(window.get()); EXPECT_TRUE(delegate.entered()); EXPECT_FALSE(delegate.exited()); @@ -1242,7 +1242,7 @@ TEST_F(WindowTest, MouseEnterExitWithDelete) { CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50), root_window())); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseToCenterOf(w1.get()); EXPECT_TRUE(d1.entered()); EXPECT_FALSE(d1.exited()); @@ -1276,7 +1276,7 @@ TEST_F(WindowTest, MouseEnterExitWithHide) { CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50), root_window())); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseToCenterOf(w1.get()); EXPECT_TRUE(d1.entered()); EXPECT_FALSE(d1.exited()); @@ -1308,7 +1308,7 @@ TEST_F(WindowTest, MouseEnterExitWithParentHide) { MouseEnterExitWindowDelegate d2; Window* w2 = CreateTestWindowWithDelegate(&d2, 2, gfx::Rect(10, 10, 50, 50), w1.get()); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseToCenterOf(w2); // Enters / exits can be send asynchronously. RunAllPendingInMessageLoop(); @@ -1332,7 +1332,7 @@ TEST_F(WindowTest, MouseEnterExitWithParentDelete) { MouseEnterExitWindowDelegate d2; Window* w2 = CreateTestWindowWithDelegate(&d2, 2, gfx::Rect(10, 10, 50, 50), w1.get()); - test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseToCenterOf(w2); // Enters / exits can be send asynchronously. @@ -2023,7 +2023,7 @@ TEST_F(WindowTest, VisibilityClientIsVisible) { TEST_F(WindowTest, MouseEventsOnWindowChange) { gfx::Size size = host()->GetBounds().size(); - EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseTo(50, 50); EventCountDelegate d1; diff --git a/ui/chromeos/touch_exploration_controller_unittest.cc b/ui/chromeos/touch_exploration_controller_unittest.cc index b794027..0da7268 100644 --- a/ui/chromeos/touch_exploration_controller_unittest.cc +++ b/ui/chromeos/touch_exploration_controller_unittest.cc @@ -8,12 +8,12 @@ #include "base/time/time.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_cursor_client.h" #include "ui/aura/window.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" #include "ui/events/gestures/gesture_provider_aura.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/events_test_utils.h" #include "ui/gfx/geometry/point.h" #include "ui/gl/gl_implementation.h" @@ -171,7 +171,7 @@ class TouchExplorationTest : public aura::test::AuraTestBase { aura::test::AuraTestBase::SetUp(); cursor_client_.reset(new aura::test::TestCursorClient(root_window())); root_window()->AddPreTargetHandler(&event_capturer_); - generator_.reset(new aura::test::EventGenerator(root_window())); + generator_.reset(new test::EventGenerator(root_window())); // The generator takes ownership of the clock. generator_->SetTickClock(scoped_ptr<base::TickClock>(simulated_clock_)); cursor_client()->ShowCursor(); @@ -315,7 +315,7 @@ class TouchExplorationTest : public aura::test::AuraTestBase { simulated_clock_->NowTicks().ToInternalValue()); } - scoped_ptr<aura::test::EventGenerator> generator_; + scoped_ptr<test::EventGenerator> generator_; ui::GestureDetector::Config gesture_detector_config_; // Owned by |generator_|. base::SimpleTestTickClock* simulated_clock_; diff --git a/ui/keyboard/keyboard_controller_unittest.cc b/ui/keyboard/keyboard_controller_unittest.cc index a39bee8..7f97a5f 100644 --- a/ui/keyboard/keyboard_controller_unittest.cc +++ b/ui/keyboard/keyboard_controller_unittest.cc @@ -12,7 +12,6 @@ #include "ui/aura/client/focus_client.h" #include "ui/aura/layout_manager.h" #include "ui/aura/test/aura_test_helper.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" @@ -27,6 +26,7 @@ #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/compositor/test/context_factories_for_test.h" #include "ui/compositor/test/layer_animator_test_controller.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/geometry/rect.h" #include "ui/keyboard/keyboard_controller_observer.h" #include "ui/keyboard/keyboard_controller_proxy.h" @@ -294,7 +294,7 @@ TEST_F(KeyboardControllerTest, ClickDoesNotFocusKeyboard) { EventObserver observer; keyboard_container->AddPreTargetHandler(&observer); - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); generator.MoveMouseTo(proxy()->GetKeyboardWindow()->bounds().CenterPoint()); generator.ClickLeftButton(); EXPECT_TRUE(window->HasFocus()); diff --git a/ui/views/corewm/capture_controller_unittest.cc b/ui/views/corewm/capture_controller_unittest.cc index ffece4a..9a536ae 100644 --- a/ui/views/corewm/capture_controller_unittest.cc +++ b/ui/views/corewm/capture_controller_unittest.cc @@ -7,13 +7,13 @@ #include "base/logging.h" #include "ui/aura/env.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_screen.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #include "ui/views/test/views_test_base.h" #include "ui/views/view.h" #include "ui/views/widget/root_view.h" @@ -137,7 +137,7 @@ TEST_F(CaptureControllerTest, ResetOtherWindowCaptureOnCapture) { TEST_F(CaptureControllerTest, TouchTargetResetOnCaptureChange) { // Create a window inside the WindowEventDispatcher. scoped_ptr<aura::Window> w1(CreateNormalWindow(1, root_window(), NULL)); - aura::test::EventGenerator event_generator1(root_window()); + ui::test::EventGenerator event_generator1(root_window()); event_generator1.PressTouch(); w1->SetCapture(); // Both capture clients should return the same capture window. diff --git a/ui/views/corewm/desktop_capture_controller_unittest.cc b/ui/views/corewm/desktop_capture_controller_unittest.cc index 27736f9..a7628a6 100644 --- a/ui/views/corewm/desktop_capture_controller_unittest.cc +++ b/ui/views/corewm/desktop_capture_controller_unittest.cc @@ -7,13 +7,13 @@ #include "base/logging.h" #include "base/path_service.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_tree_host.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" #include "ui/events/event.h" +#include "ui/events/test/event_generator.h" #include "ui/gl/gl_surface.h" #include "ui/views/test/views_test_base.h" #include "ui/views/view.h" @@ -87,7 +87,7 @@ views::Widget* CreateWidget() { TEST_F(DesktopCaptureControllerTest, ResetMouseHandlers) { scoped_ptr<Widget> w1(CreateWidget()); scoped_ptr<Widget> w2(CreateWidget()); - aura::test::EventGenerator generator1(w1->GetNativeView()->GetRootWindow()); + ui::test::EventGenerator generator1(w1->GetNativeView()->GetRootWindow()); generator1.MoveMouseToCenterOf(w1->GetNativeView()); generator1.PressLeftButton(); EXPECT_FALSE(w1->HasCapture()); diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc index 8cce09c..9fbb63c 100644 --- a/ui/views/corewm/tooltip_controller_unittest.cc +++ b/ui/views/corewm/tooltip_controller_unittest.cc @@ -9,12 +9,12 @@ #include "ui/aura/client/screen_position_client.h" #include "ui/aura/env.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_screen.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/font.h" #include "ui/gfx/point.h" #include "ui/gfx/screen.h" @@ -101,7 +101,7 @@ class TooltipControllerTest : public aura::test::AuraTestBase { view_->SetBoundsRect(widget_->GetContentsView()->GetLocalBounds()); helper_.reset(new TooltipControllerTestHelper( GetController(widget_.get()))); - generator_.reset(new aura::test::EventGenerator(GetRootWindow())); + generator_.reset(new ui::test::EventGenerator(GetRootWindow())); } virtual void TearDown() OVERRIDE { @@ -137,7 +137,7 @@ class TooltipControllerTest : public aura::test::AuraTestBase { scoped_ptr<views::Widget> widget_; TooltipTestView* view_; scoped_ptr<TooltipControllerTestHelper> helper_; - scoped_ptr<aura::test::EventGenerator> generator_; + scoped_ptr<ui::test::EventGenerator> generator_; private: scoped_ptr<TooltipController> controller_; @@ -600,7 +600,7 @@ class TooltipControllerTest2 : public aura::test::AuraTestBase { root_window()->AddPreTargetHandler(controller_.get()); SetTooltipClient(root_window(), controller_.get()); helper_.reset(new TooltipControllerTestHelper(controller_.get())); - generator_.reset(new aura::test::EventGenerator(root_window())); + generator_.reset(new ui::test::EventGenerator(root_window())); } virtual void TearDown() OVERRIDE { @@ -617,7 +617,7 @@ class TooltipControllerTest2 : public aura::test::AuraTestBase { // Owned by |controller_|. TestTooltip* test_tooltip_; scoped_ptr<TooltipControllerTestHelper> helper_; - scoped_ptr<aura::test::EventGenerator> generator_; + scoped_ptr<ui::test::EventGenerator> generator_; private: scoped_ptr<TooltipController> controller_; @@ -677,7 +677,7 @@ class TooltipControllerTest3 : public aura::test::AuraTestBase { widget_->GetContentsView()->AddChildView(view_); view_->SetBoundsRect(widget_->GetContentsView()->GetLocalBounds()); - generator_.reset(new aura::test::EventGenerator(GetRootWindow())); + generator_.reset(new ui::test::EventGenerator(GetRootWindow())); controller_.reset(new TooltipController( scoped_ptr<views::corewm::Tooltip>(test_tooltip_))); GetRootWindow()->RemovePreTargetHandler( @@ -706,7 +706,7 @@ class TooltipControllerTest3 : public aura::test::AuraTestBase { // Owned by |controller_|. TestTooltip* test_tooltip_; scoped_ptr<TooltipControllerTestHelper> helper_; - scoped_ptr<aura::test::EventGenerator> generator_; + scoped_ptr<ui::test::EventGenerator> generator_; scoped_ptr<views::Widget> widget_; TooltipTestView* view_; diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc index 0af64c3..73cf4f0 100644 --- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc +++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc @@ -6,11 +6,11 @@ #include "base/strings/utf_string_conversions.h" #include "grit/ui_resources.h" #include "ui/aura/client/screen_position_client.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/touch/touch_editing_controller.h" #include "ui/base/ui_base_switches.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/canvas.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" @@ -543,7 +543,7 @@ TEST_F(TouchSelectionControllerImplTest, DoubleTapInTextfieldWithCursorHandleShouldSelectText) { CreateTextfield(); textfield_->SetText(ASCIIToUTF16("some text")); - aura::test::EventGenerator generator( + ui::test::EventGenerator generator( textfield_->GetWidget()->GetNativeView()->GetRootWindow()); // Tap the textfield to invoke touch selection. @@ -804,7 +804,7 @@ TEST_F(TouchSelectionControllerImplTest, MouseEventDeactivatesTouchSelection) { CreateTextfield(); EXPECT_FALSE(GetSelectionController()); - aura::test::EventGenerator generator( + ui::test::EventGenerator generator( textfield_widget_->GetNativeView()->GetRootWindow()); generator.set_current_location(gfx::Point(5, 5)); @@ -845,7 +845,7 @@ TEST_F(TouchSelectionControllerImplTest, KeyEventDeactivatesTouchSelection) { CreateTextfield(); EXPECT_FALSE(GetSelectionController()); - aura::test::EventGenerator generator( + ui::test::EventGenerator generator( textfield_widget_->GetNativeView()->GetRootWindow()); RunPendingMessages(); diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc index f52fe91..72bc3fb 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc @@ -8,10 +8,10 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/window_tree_client.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" +#include "ui/events/test/event_generator.h" #include "ui/views/test/views_test_base.h" #include "ui/views/test/widget_test.h" #include "ui/views/widget/widget.h" diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc index 0451d78..75a71ac 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc +++ b/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc @@ -7,11 +7,11 @@ #include "base/memory/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/hit_test.h" #include "ui/base/x/x11_util.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/display_observer.h" #include "ui/gfx/x/x11_types.h" #include "ui/views/test/views_test_base.h" @@ -290,7 +290,7 @@ TEST_F(DesktopScreenX11Test, DoubleClickHeaderMaximizes) { DesktopWindowTreeHostX11::GetHostForXID(window->GetHost()-> GetAcceleratedWidget()); - aura::test::EventGenerator generator(window); + ui::test::EventGenerator generator(window); generator.ClickLeftButton(); generator.DoubleClickLeftButton(); RunPendingMessages(); @@ -316,7 +316,7 @@ TEST_F(DesktopScreenX11Test, DoubleClickTwoDifferentTargetsDoesntMaximizes) { DesktopWindowTreeHostX11::GetHostForXID(window->GetHost()-> GetAcceleratedWidget()); - aura::test::EventGenerator generator(window); + ui::test::EventGenerator generator(window); native_widget->set_window_component(HTCLIENT); generator.ClickLeftButton(); native_widget->set_window_component(HTCAPTION); @@ -343,7 +343,7 @@ TEST_F(DesktopScreenX11Test, RightClickDuringDoubleClickDoesntMaximize) { DesktopWindowTreeHostX11::GetHostForXID(window->GetHost()-> GetAcceleratedWidget())); - aura::test::EventGenerator generator(window); + ui::test::EventGenerator generator(window); native_widget->set_window_component(HTCLIENT); generator.ClickLeftButton(); native_widget->set_window_component(HTCAPTION); diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc index 9f29b06..b173354 100644 --- a/ui/views/widget/widget_interactive_uitest.cc +++ b/ui/views/widget/widget_interactive_uitest.cc @@ -11,13 +11,13 @@ #include "base/strings/utf_string_conversions.h" #include "ui/aura/client/focus_client.h" #include "ui/aura/env.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_switches.h" #include "ui/events/event_processor.h" +#include "ui/events/test/event_generator.h" #include "ui/gfx/native_widget_types.h" #include "ui/gl/gl_surface.h" #include "ui/views/controls/textfield/textfield.h" @@ -769,7 +769,7 @@ TEST_F(WidgetTestInteractive, TouchSelectionQuickMenuIsNotActivated) { RunPendingMessages(); - aura::test::EventGenerator generator(widget.GetNativeView()->GetRootWindow()); + ui::test::EventGenerator generator(widget.GetNativeView()->GetRootWindow()); generator.GestureTapAt(gfx::Point(10, 10)); ShowQuickMenuImmediately(static_cast<TouchSelectionControllerImpl*>( textfield_test_api.touch_selection_controller())); diff --git a/ui/wm/core/compound_event_filter_unittest.cc b/ui/wm/core/compound_event_filter_unittest.cc index 0ecea95..85282fc 100644 --- a/ui/wm/core/compound_event_filter_unittest.cc +++ b/ui/wm/core/compound_event_filter_unittest.cc @@ -7,13 +7,13 @@ #include "ui/aura/client/cursor_client.h" #include "ui/aura/env.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_cursor_client.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" +#include "ui/events/test/event_generator.h" #include "ui/wm/core/default_activation_client.h" #include "ui/wm/public/activation_client.h" @@ -180,7 +180,7 @@ TEST_F(CompoundEventFilterTest, FilterConsumedGesture) { // Tap on the window should not focus it since the filter will be consuming // the gestures. - aura::test::EventGenerator generator(root_window(), gfx::Point(50, 50)); + ui::test::EventGenerator generator(root_window(), gfx::Point(50, 50)); generator.PressTouch(); EXPECT_FALSE(window->HasFocus()); @@ -191,7 +191,7 @@ TEST_F(CompoundEventFilterTest, FilterConsumedGesture) { // Verifies we don't attempt to hide the mouse when the mouse is down and a // touch event comes in. TEST_F(CompoundEventFilterTest, DontHideWhenMouseDown) { - aura::test::EventGenerator event_generator(root_window()); + ui::test::EventGenerator event_generator(root_window()); scoped_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter); aura::Env::GetInstance()->AddPreTargetHandler(compound_filter.get()); diff --git a/ui/wm/core/focus_controller_unittest.cc b/ui/wm/core/focus_controller_unittest.cc index 5d65943..a10cef3 100644 --- a/ui/wm/core/focus_controller_unittest.cc +++ b/ui/wm/core/focus_controller_unittest.cc @@ -10,7 +10,6 @@ #include "ui/aura/client/default_capture_client.h" #include "ui/aura/client/focus_change_observer.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" @@ -21,6 +20,7 @@ #include "ui/events/event.h" #include "ui/events/event_constants.h" #include "ui/events/event_handler.h" +#include "ui/events/test/event_generator.h" #include "ui/wm/core/base_focus_rules.h" #include "ui/wm/core/wm_state.h" #include "ui/wm/public/activation_change_observer.h" @@ -772,7 +772,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase { aura::Window* w2 = root_window()->GetChildById(2); aura::client::GetCaptureClient(root_window())->SetCapture(w2); - aura::test::EventGenerator generator(root_window(), w2); + ui::test::EventGenerator generator(root_window(), w2); generator.ClickLeftButton(); EXPECT_EQ(1, GetActiveWindowId()); @@ -909,7 +909,7 @@ class FocusControllerMouseEventTest : public FocusControllerDirectTestBase { aura::Window* w1 = root_window()->GetChildById(1); SimpleEventHandler handler; root_window()->PrependPreTargetHandler(&handler); - aura::test::EventGenerator generator(root_window(), w1); + ui::test::EventGenerator generator(root_window(), w1); generator.ClickLeftButton(); EXPECT_EQ(NULL, GetActiveWindow()); generator.GestureTapAt(w1->bounds().CenterPoint()); @@ -922,17 +922,17 @@ class FocusControllerMouseEventTest : public FocusControllerDirectTestBase { private: // Overridden from FocusControllerTestBase: virtual void FocusWindowDirect(aura::Window* window) OVERRIDE { - aura::test::EventGenerator generator(root_window(), window); + ui::test::EventGenerator generator(root_window(), window); generator.ClickLeftButton(); } virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE { - aura::test::EventGenerator generator(root_window(), window); + ui::test::EventGenerator generator(root_window(), window); generator.ClickLeftButton(); } virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE { aura::Window* next_activatable = test_focus_rules()->GetNextActivatableWindow(window); - aura::test::EventGenerator generator(root_window(), next_activatable); + ui::test::EventGenerator generator(root_window(), next_activatable); generator.ClickLeftButton(); } virtual bool IsInputEvent() OVERRIDE { return true; } @@ -947,17 +947,17 @@ class FocusControllerGestureEventTest : public FocusControllerDirectTestBase { private: // Overridden from FocusControllerTestBase: virtual void FocusWindowDirect(aura::Window* window) OVERRIDE { - aura::test::EventGenerator generator(root_window(), window); + ui::test::EventGenerator generator(root_window(), window); generator.GestureTapAt(window->bounds().CenterPoint()); } virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE { - aura::test::EventGenerator generator(root_window(), window); + ui::test::EventGenerator generator(root_window(), window); generator.GestureTapAt(window->bounds().CenterPoint()); } virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE { aura::Window* next_activatable = test_focus_rules()->GetNextActivatableWindow(window); - aura::test::EventGenerator generator(root_window(), next_activatable); + ui::test::EventGenerator generator(root_window(), next_activatable); generator.GestureTapAt(window->bounds().CenterPoint()); } virtual bool IsInputEvent() OVERRIDE { return true; } diff --git a/ui/wm/core/input_method_event_filter_unittest.cc b/ui/wm/core/input_method_event_filter_unittest.cc index 4a96745..810ba2a 100644 --- a/ui/wm/core/input_method_event_filter_unittest.cc +++ b/ui/wm/core/input_method_event_filter_unittest.cc @@ -7,20 +7,20 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/test/aura_test_base.h" -#include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/ime/dummy_text_input_client.h" #include "ui/base/ime/input_method.h" #include "ui/base/ime/text_input_focus_manager.h" #include "ui/base/ui_base_switches_util.h" +#include "ui/events/test/event_generator.h" #include "ui/events/test/test_event_handler.h" #include "ui/wm/core/compound_event_filter.h" #include "ui/wm/core/default_activation_client.h" #include "ui/wm/public/activation_client.h" #if !defined(OS_WIN) && !defined(USE_X11) -// On platforms except Windows and X11, aura::test::EventGenerator::PressKey +// On platforms except Windows and X11, ui::test::EventGenerator::PressKey // generates a key event without native_event(), which is not supported by // ui::MockInputMethod. #define TestInputMethodKeyEventPropagation \ @@ -103,7 +103,7 @@ TEST_F(InputMethodEventFilterTest, TestInputMethodKeyEventPropagation) { // automatically set up by AshTestBase, consumes it and sends a new // ui::ET_TRANSLATED_KEY_* event to the root window, which will be consumed by // the test event filter. - aura::test::EventGenerator generator(root_window()); + ui::test::EventGenerator generator(root_window()); EXPECT_EQ(0, test_filter_.num_key_events()); generator.PressKey(ui::VKEY_SPACE, 0); EXPECT_EQ(1, test_filter_.num_key_events()); |