| Index: ash/accelerators/accelerator_controller_unittest.cc
|
| diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
|
| index 4c00f72734149fb158380a5edab6b0ca8579c21d..5487d0561d489805e9e6de1d9b4cf8796435fbef 100644
|
| --- a/ash/accelerators/accelerator_controller_unittest.cc
|
| +++ b/ash/accelerators/accelerator_controller_unittest.cc
|
| @@ -18,6 +18,7 @@
|
| #include "ash/test/test_shell_delegate.h"
|
| #include "ash/volume_control_delegate.h"
|
| #include "ash/wm/window_util.h"
|
| +#include "ash/wm/workspace/snap_sizer.h"
|
| #include "ui/aura/root_window.h"
|
| #include "ui/aura/test/test_window_delegate.h"
|
| #include "ui/aura/test/test_windows.h"
|
| @@ -501,28 +502,29 @@ TEST_F(AcceleratorControllerTest, WindowSnap) {
|
| wm::ActivateWindow(window.get());
|
|
|
| {
|
| - GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy);
|
| - gfx::Rect snap_left = window->bounds();
|
| - GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy);
|
| - EXPECT_NE(window->bounds().ToString(), snap_left.ToString());
|
| - GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy);
|
| + internal::SnapSizer snap_sizer_left(window.get(),
|
| + gfx::Point(),
|
| + internal::SnapSizer::LEFT_EDGE,
|
| + internal::SnapSizer::STEP_NO);
|
| + gfx::Rect snap_left = snap_sizer_left.target_bounds();
|
| EXPECT_NE(window->bounds().ToString(), snap_left.ToString());
|
|
|
| - // It should cycle back to the first snapped position.
|
| GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy);
|
| EXPECT_EQ(window->bounds().ToString(), snap_left.ToString());
|
| - }
|
| - {
|
| - GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy);
|
| - gfx::Rect snap_right = window->bounds();
|
| - GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy);
|
| - EXPECT_NE(window->bounds().ToString(), snap_right.ToString());
|
| - GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy);
|
| +
|
| + internal::SnapSizer snap_sizer_right(window.get(),
|
| + gfx::Point(),
|
| + internal::SnapSizer::RIGHT_EDGE,
|
| + internal::SnapSizer::STEP_NO);
|
| + gfx::Rect snap_right = snap_sizer_right.target_bounds();
|
| + EXPECT_NE(snap_left.ToString(), snap_right.ToString());
|
| EXPECT_NE(window->bounds().ToString(), snap_right.ToString());
|
|
|
| - // It should cycle back to the first snapped position.
|
| GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy);
|
| EXPECT_EQ(window->bounds().ToString(), snap_right.ToString());
|
| +
|
| + // Restore the window because side maximizing stores restore bounds.
|
| + wm::RestoreWindow(window.get());
|
| }
|
| {
|
| gfx::Rect normal_bounds = window->bounds();
|
|
|