Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / ash / wm / workspace / workspace_window_resizer_unittest.cc
index 42eea1d..49af2b7 100644 (file)
@@ -4,8 +4,6 @@
 
 #include "ash/wm/workspace/workspace_window_resizer.h"
 
-#include "ash/ash_constants.h"
-#include "ash/ash_switches.h"
 #include "ash/display/display_manager.h"
 #include "ash/root_window_controller.h"
 #include "ash/screen_util.h"
 #include "ash/test/ash_test_base.h"
 #include "ash/wm/window_state.h"
 #include "ash/wm/window_util.h"
+#include "ash/wm/wm_event.h"
 #include "ash/wm/workspace/phantom_window_controller.h"
-#include "ash/wm/workspace/snap_sizer.h"
 #include "ash/wm/workspace_controller.h"
 #include "base/command_line.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/stringprintf.h"
 #include "ui/aura/client/aura_constants.h"
-#include "ui/aura/root_window.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"
 
 namespace ash {
-namespace internal {
 namespace {
 
 const int kRootHeight = 600;
@@ -77,6 +75,8 @@ class WorkspaceWindowResizerTest : public test::AshTestBase {
   virtual void SetUp() OVERRIDE {
     AshTestBase::SetUp();
     UpdateDisplay(base::StringPrintf("800x%d", kRootHeight));
+    // Ignore the touch slop region.
+    ui::GestureConfiguration::set_max_touch_move_in_pixels_for_click(0);
 
     aura::Window* root = Shell::GetPrimaryRootWindow();
     gfx::Rect root_bounds(root->bounds());
@@ -180,7 +180,7 @@ class WorkspaceWindowResizerTest : public test::AshTestBase {
     return std::vector<aura::Window*>();
   }
 
-  internal::ShelfLayoutManager* shelf_layout_manager() {
+  ShelfLayoutManager* shelf_layout_manager() {
     return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
   }
 
@@ -189,14 +189,6 @@ class WorkspaceWindowResizerTest : public test::AshTestBase {
     touch_resize_window_.reset(
         CreateTestWindowInShellWithDelegate(&touch_resize_delegate_, 0,
                                             bounds));
-    gfx::Insets mouse_outer_insets(-ash::kResizeOutsideBoundsSize,
-                                   -ash::kResizeOutsideBoundsSize,
-                                   -ash::kResizeOutsideBoundsSize,
-                                   -ash::kResizeOutsideBoundsSize);
-    gfx::Insets touch_outer_insets = mouse_outer_insets.Scale(
-        ash::kResizeOutsideBoundsScaleForTouch);
-    touch_resize_window_->SetHitTestBoundsOverrideOuter(mouse_outer_insets,
-                                                        touch_outer_insets);
   }
 
   TestWindowDelegate delegate_;
@@ -216,21 +208,6 @@ class WorkspaceWindowResizerTest : public test::AshTestBase {
   DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizerTest);
 };
 
-class WorkspaceWindowResizerTestSticky : public WorkspaceWindowResizerTest {
- public:
-  WorkspaceWindowResizerTestSticky() {}
-  virtual ~WorkspaceWindowResizerTestSticky() {}
-
-  virtual void SetUp() OVERRIDE {
-    CommandLine::ForCurrentProcess()->AppendSwitch(
-        ash::switches::kAshEnableStickyEdges);
-    WorkspaceWindowResizerTest::SetUp();
-  }
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizerTestSticky);
-};
-
 // Assertions around attached window resize dragging from the right with 2
 // windows.
 TEST_F(WorkspaceWindowResizerTest, AttachedResize_RIGHT_2) {
@@ -537,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());
@@ -582,9 +559,8 @@ TEST_F(WorkspaceWindowResizerTest, Edge) {
   wm::WindowState* window_state = wm::GetWindowState(window_.get());
 
   {
-    internal::SnapSizer snap_sizer(window_state, gfx::Point(),
-        internal::SnapSizer::LEFT_EDGE, internal::SnapSizer::OTHER_INPUT);
-    gfx::Rect expected_bounds(snap_sizer.target_bounds());
+    gfx::Rect expected_bounds_in_parent(
+        wm::GetDefaultLeftSnappedWindowBoundsInParent(window_.get()));
 
     scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
         window_.get(), gfx::Point(), HTCAPTION));
@@ -592,23 +568,24 @@ TEST_F(WorkspaceWindowResizerTest, Edge) {
     resizer->Drag(CalculateDragPoint(*resizer, 0, 10), 0);
     resizer->CompleteDrag();
 
-    EXPECT_EQ(expected_bounds.ToString(), window_->bounds().ToString());
+    EXPECT_EQ(expected_bounds_in_parent.ToString(),
+              window_->bounds().ToString());
     ASSERT_TRUE(window_state->HasRestoreBounds());
     EXPECT_EQ("20,30 400x60",
               window_state->GetRestoreBoundsInScreen().ToString());
   }
   // Try the same with the right side.
   {
-    internal::SnapSizer snap_sizer(window_state, gfx::Point(),
-        internal::SnapSizer::RIGHT_EDGE, internal::SnapSizer::OTHER_INPUT);
-    gfx::Rect expected_bounds(snap_sizer.target_bounds());
+    gfx::Rect expected_bounds_in_parent(
+        wm::GetDefaultRightSnappedWindowBoundsInParent(window_.get()));
 
     scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
         window_.get(), gfx::Point(), HTCAPTION));
     ASSERT_TRUE(resizer.get());
     resizer->Drag(CalculateDragPoint(*resizer, 800, 10), 0);
     resizer->CompleteDrag();
-    EXPECT_EQ(expected_bounds.ToString(), window_->bounds().ToString());
+    EXPECT_EQ(expected_bounds_in_parent.ToString(),
+              window_->bounds().ToString());
     ASSERT_TRUE(window_state->HasRestoreBounds());
     EXPECT_EQ("20,30 400x60",
               window_state->GetRestoreBoundsInScreen().ToString());
@@ -691,6 +668,90 @@ TEST_F(WorkspaceWindowResizerTest, CancelSnapPhantom) {
   }
 }
 
+// Verifies that dragging a snapped window unsnaps it.
+TEST_F(WorkspaceWindowResizerTest, DragSnapped) {
+  wm::WindowState* window_state = ash::wm::GetWindowState(window_.get());
+
+  const gfx::Rect kInitialBounds(100, 100, 100, 100);
+  window_->SetBounds(kInitialBounds);
+  window_->Show();
+  const wm::WMEvent snap_event(wm::WM_EVENT_SNAP_LEFT);
+  window_state->OnWMEvent(&snap_event);
+  EXPECT_EQ(wm::WINDOW_STATE_TYPE_LEFT_SNAPPED, window_state->GetStateType());
+  gfx::Rect snapped_bounds = window_->bounds();
+  EXPECT_NE(snapped_bounds.ToString(), kInitialBounds.ToString());
+  EXPECT_EQ(window_state->GetRestoreBoundsInParent().ToString(),
+            kInitialBounds.ToString());
+
+  // Dragging a side snapped window should unsnap it.
+  scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
+      window_.get(), gfx::Point(), HTCAPTION));
+  resizer->Drag(CalculateDragPoint(*resizer, 10, 0), 0);
+  resizer->CompleteDrag();
+  EXPECT_EQ(wm::WINDOW_STATE_TYPE_NORMAL, window_state->GetStateType());
+  EXPECT_EQ("10,0 100x100", window_->bounds().ToString());
+  EXPECT_FALSE(window_state->HasRestoreBounds());
+}
+
+// Verifies the behavior of resizing a side snapped window.
+TEST_F(WorkspaceWindowResizerTest, ResizeSnapped) {
+  wm::WindowState* window_state = ash::wm::GetWindowState(window_.get());
+
+  const gfx::Rect kInitialBounds(100, 100, 100, 100);
+  window_->SetBounds(kInitialBounds);
+  window_->Show();
+
+  const wm::WMEvent snap_event(wm::WM_EVENT_SNAP_LEFT);
+  window_state->OnWMEvent(&snap_event);
+  EXPECT_EQ(wm::WINDOW_STATE_TYPE_LEFT_SNAPPED, window_state->GetStateType());
+  gfx::Rect snapped_bounds = window_->bounds();
+  EXPECT_NE(snapped_bounds.ToString(), kInitialBounds.ToString());
+  EXPECT_EQ(window_state->GetRestoreBoundsInParent().ToString(),
+            kInitialBounds.ToString());
+
+  {
+    // 1) Resizing a side snapped window to make it wider should not unsnap the
+    // window.
+    scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
+        window_.get(), gfx::Point(), HTRIGHT));
+    resizer->Drag(CalculateDragPoint(*resizer, 10, 0), 0);
+    resizer->CompleteDrag();
+    EXPECT_EQ(wm::WINDOW_STATE_TYPE_LEFT_SNAPPED, window_state->GetStateType());
+    snapped_bounds.Inset(0, 0, -10, 0);
+    EXPECT_EQ(snapped_bounds.ToString(), window_->bounds().ToString());
+    EXPECT_EQ(window_state->GetRestoreBoundsInParent().ToString(),
+              kInitialBounds.ToString());
+  }
+
+  {
+    // 2) Resizing a side snapped window vertically and then undoing the change
+    // should not unsnap.
+    scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
+        window_.get(), gfx::Point(), HTBOTTOM));
+    resizer->Drag(CalculateDragPoint(*resizer, 0, -30), 0);
+    resizer->Drag(CalculateDragPoint(*resizer, 0, 0), 0);
+    resizer->CompleteDrag();
+    EXPECT_EQ(wm::WINDOW_STATE_TYPE_LEFT_SNAPPED, window_state->GetStateType());
+    EXPECT_EQ(snapped_bounds.ToString(), window_->bounds().ToString());
+    EXPECT_EQ(window_state->GetRestoreBoundsInParent().ToString(),
+              kInitialBounds.ToString());
+  }
+
+  {
+    // 3) Resizing a side snapped window vertically and then not undoing the
+    // change should unsnap.
+    scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
+        window_.get(), gfx::Point(), HTBOTTOM));
+    resizer->Drag(CalculateDragPoint(*resizer, 0, -10), 0);
+    resizer->CompleteDrag();
+    EXPECT_EQ(wm::WINDOW_STATE_TYPE_NORMAL, window_state->GetStateType());
+    gfx::Rect expected_bounds(snapped_bounds);
+    expected_bounds.Inset(0, 0, 0, 10);
+    EXPECT_EQ(expected_bounds.ToString(), window_->bounds().ToString());
+    EXPECT_FALSE(window_state->HasRestoreBounds());
+  }
+}
+
 // Verifies windows are correctly restacked when reordering multiple windows.
 TEST_F(WorkspaceWindowResizerTest, RestackAttached) {
   window_->SetBounds(gfx::Rect(   0, 0, 200, 300));
@@ -1061,121 +1122,52 @@ TEST_F(WorkspaceWindowResizerTest, SnapToWorkArea_BOTTOMLEFT) {
   EXPECT_EQ(work_area.bottom() - 200, window_->bounds().height());
 }
 
-// Verifies sticking to edges works.
-TEST_F(WorkspaceWindowResizerTestSticky, StickToEdge) {
-  Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager()->
-      SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
-  window_->SetBounds(gfx::Rect(96, 112, 320, 160));
-  // Click 50px to the right so that the mouse pointer does not leave the
-  // workspace ensuring sticky behavior.
-  scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
-      window_.get(),
-      window_->bounds().origin() + gfx::Vector2d(50, 0),
-      HTCAPTION));
-  ASSERT_TRUE(resizer.get());
-  // Move to an x-coordinate of 15, which should not stick.
-  resizer->Drag(CalculateDragPoint(*resizer, 15 - 96, 0), 0);
-  // Move to -15, should still stick to 0.
-  resizer->Drag(CalculateDragPoint(*resizer, -15 - 96, 0), 0);
-  EXPECT_EQ("0,112 320x160", window_->bounds().ToString());
-  // At -100 should move past edge.
-  resizer->Drag(CalculateDragPoint(*resizer, -100 - 96, 0), 0);
-  EXPECT_EQ("-100,112 320x160", window_->bounds().ToString());
-  resizer->Drag(CalculateDragPoint(*resizer, -101 - 96, 0), 0);
-  EXPECT_EQ("-101,112 320x160", window_->bounds().ToString());
-
-  // Right side should similarly stick.
-  resizer->Drag(CalculateDragPoint(*resizer, 800 - 320 - 96 - 15, 0), 0);
-  EXPECT_EQ("465,112 320x160", window_->bounds().ToString());
-  resizer->Drag(CalculateDragPoint(*resizer, 800 - 320 - 96 + 15, 0), 0);
-  EXPECT_EQ("480,112 320x160", window_->bounds().ToString());
-  resizer->Drag(CalculateDragPoint(*resizer, 800 - 320 - 96 + 100, 0), 0);
-  EXPECT_EQ("580,112 320x160", window_->bounds().ToString());
-  resizer->Drag(CalculateDragPoint(*resizer, 800 - 320 - 96 + 101, 0), 0);
-  EXPECT_EQ("581,112 320x160", window_->bounds().ToString());
-
-  // And the bottom should stick too.
-  resizer->Drag(CalculateDragPoint(*resizer, 0, 600 - 160 - 112 - 3 + 15), 0);
-  EXPECT_EQ("96,437 320x160", window_->bounds().ToString());
-  resizer->Drag(CalculateDragPoint(*resizer, 0, 600 - 160 - 112 - 2 + 100), 0);
-  EXPECT_EQ("96,538 320x160", window_->bounds().ToString());
-  resizer->Drag(CalculateDragPoint(*resizer, 0, 600 - 160 - 112 - 2 + 101), 0);
-  EXPECT_EQ("96,539 320x160", window_->bounds().ToString());
-
-  // No need to test dragging < 0 as we force that to 0.
-}
-
-// Verifies not sticking to edges when a mouse pointer is outside of work area.
-TEST_F(WorkspaceWindowResizerTestSticky, NoStickToEdgeWhenOutside) {
-  Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager()->
-      SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
-  window_->SetBounds(gfx::Rect(96, 112, 320, 160));
-  scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
-      window_.get(), gfx::Point(), HTCAPTION));
-  ASSERT_TRUE(resizer.get());
-  // Move to an x-coordinate of 15, which should not stick.
-  resizer->Drag(CalculateDragPoint(*resizer, 15 - 96, 0), 0);
-  // Move to -15, should still stick to 0.
-  resizer->Drag(CalculateDragPoint(*resizer, -15 - 96, 0), 0);
-  EXPECT_EQ("-15,112 320x160", window_->bounds().ToString());
-}
+// Verifies window sticks to both window and work area.
+TEST_F(WorkspaceWindowResizerTest, StickToBothEdgeAndWindow) {
+  window_->SetBounds(gfx::Rect(10, 10, 20, 50));
+  window_->Show();
+  window2_->SetBounds(gfx::Rect(150, 160, 25, 1000));
+  window2_->Show();
 
-// Verifies a resize sticks when dragging TOPLEFT.
-TEST_F(WorkspaceWindowResizerTestSticky, StickToWorkArea_TOPLEFT) {
-  window_->SetBounds(gfx::Rect(100, 200, 20, 30));
   scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
-      window_.get(), gfx::Point(), HTTOPLEFT));
+      window_.get(), gfx::Point(10, 10), HTCAPTION));
   ASSERT_TRUE(resizer.get());
-  resizer->Drag(CalculateDragPoint(*resizer, -15 - 100, -15 -200), 0);
-  EXPECT_EQ("0,0 120x230", window_->bounds().ToString());
-}
 
-// Verifies a resize sticks when dragging TOPRIGHT.
-TEST_F(WorkspaceWindowResizerTestSticky, StickToWorkArea_TOPRIGHT) {
-  window_->SetBounds(gfx::Rect(100, 200, 20, 30));
-  gfx::Rect work_area(ScreenUtil::GetDisplayWorkAreaBoundsInParent(
-                          window_.get()));
-  scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
-      window_.get(), gfx::Point(), HTTOPRIGHT));
-  ASSERT_TRUE(resizer.get());
-  resizer->Drag(CalculateDragPoint(*resizer, work_area.right() - 100 + 20,
-                                   -200 - 15), 0);
-  EXPECT_EQ(100, window_->bounds().x());
-  EXPECT_EQ(work_area.y(), window_->bounds().y());
-  EXPECT_EQ(work_area.right() - 100, window_->bounds().width());
-  EXPECT_EQ(230, window_->bounds().height());
-}
+  // Move |window| one pixel to the left of |window2|. Should snap to right.
+  resizer->Drag(CalculateDragPoint(*resizer, 119, 145), 0);
+  gfx::Rect expected(130, 160, 20, 50);
+  EXPECT_EQ(expected.ToString(), window_->bounds().ToString());
 
-// Verifies a resize snap when dragging BOTTOMRIGHT.
-TEST_F(WorkspaceWindowResizerTestSticky, StickToWorkArea_BOTTOMRIGHT) {
-  window_->SetBounds(gfx::Rect(100, 200, 20, 30));
   gfx::Rect work_area(ScreenUtil::GetDisplayWorkAreaBoundsInParent(
                           window_.get()));
-  scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
-      window_.get(), gfx::Point(), HTBOTTOMRIGHT));
-  ASSERT_TRUE(resizer.get());
-  resizer->Drag(CalculateDragPoint(*resizer, work_area.right() - 100 - 20 + 15,
-                                   work_area.bottom() - 200 - 30 + 15), 0);
-  EXPECT_EQ(100, window_->bounds().x());
-  EXPECT_EQ(200, window_->bounds().y());
-  EXPECT_EQ(work_area.right() - 100, window_->bounds().width());
-  EXPECT_EQ(work_area.bottom() - 200, window_->bounds().height());
-}
 
-// Verifies a resize snap when dragging BOTTOMLEFT.
-TEST_F(WorkspaceWindowResizerTestSticky, StickToWorkArea_BOTTOMLEFT) {
-  window_->SetBounds(gfx::Rect(100, 200, 20, 30));
-  gfx::Rect work_area(ScreenUtil::GetDisplayWorkAreaBoundsInParent(
-                          window_.get()));
-  scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
-      window_.get(), gfx::Point(), HTBOTTOMLEFT));
-  ASSERT_TRUE(resizer.get());
-  resizer->Drag(CalculateDragPoint(*resizer, -15 - 100,
-                                   work_area.bottom() - 200 - 30 + 15), 0);
-  EXPECT_EQ(0, window_->bounds().x());
-  EXPECT_EQ(200, window_->bounds().y());
-  EXPECT_EQ(120, window_->bounds().width());
-  EXPECT_EQ(work_area.bottom() - 200, window_->bounds().height());
+  // The initial y position of |window_|.
+  int initial_y = 10;
+  // The drag position where the window is exactly attached to the bottom.
+  int attach_y = work_area.bottom() - window_->bounds().height() - initial_y;
+
+  // Dragging 10px above should not attach to the bottom.
+  resizer->Drag(CalculateDragPoint(*resizer, 119, attach_y - 10), 0);
+  expected.set_y(attach_y + initial_y - 10);
+  EXPECT_EQ(expected.ToString(), window_->bounds().ToString());
+
+  // Stick to the work area.
+  resizer->Drag(CalculateDragPoint(*resizer, 119, attach_y - 1), 0);
+  expected.set_y(attach_y + initial_y);
+  EXPECT_EQ(expected.ToString(), window_->bounds().ToString());
+
+  resizer->Drag(CalculateDragPoint(*resizer, 119, attach_y), 0);
+  expected.set_y(attach_y + initial_y);
+  EXPECT_EQ(expected.ToString(), window_->bounds().ToString());
+
+  resizer->Drag(CalculateDragPoint(*resizer, 119, attach_y + 1), 0);
+  expected.set_y(attach_y + initial_y);
+  EXPECT_EQ(expected.ToString(), window_->bounds().ToString());
+
+  // Moving down further should move the window.
+  resizer->Drag(CalculateDragPoint(*resizer, 119, attach_y + 18), 0);
+  expected.set_y(attach_y + initial_y + 18);
+  EXPECT_EQ(expected.ToString(), window_->bounds().ToString());
 }
 
 TEST_F(WorkspaceWindowResizerTest, CtrlDragResizeToExactPosition) {
@@ -1483,10 +1475,7 @@ TEST_F(WorkspaceWindowResizerTest, PhantomSnapMaxSize) {
     scoped_ptr<WindowResizer> resizer(CreateResizerForTest(
         window_.get(), gfx::Point(), HTCAPTION));
     resizer->Drag(CalculateDragPoint(*resizer, 801, 0), 0);
-    if (switches::UseDockedWindows())
-      EXPECT_TRUE(snap_phantom_window_controller());
-    else
-      EXPECT_FALSE(snap_phantom_window_controller());
+    EXPECT_TRUE(snap_phantom_window_controller());
     resizer->RevertDrag();
   }
   {
@@ -1750,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.
@@ -1784,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.
@@ -1818,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.
@@ -1852,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.
@@ -1879,5 +1868,4 @@ TEST_F(WorkspaceWindowResizerTest, TouchResizeToEdge_BOTTOM) {
             touch_resize_window_->bounds().ToString());
 }
 
-}  // namespace internal
 }  // namespace ash