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..87254cedcd2b2f312e55ebacc22db159b785de89 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,26 +502,24 @@ 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(), |
varkha
2013/08/30 17:13:25
"using internal::SnapSizer" could shorten this sim
pkotwicz
2013/08/30 21:10:57
I do not think that there is much gained via "usin
|
+ 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()); |
} |