Index: ash/wm/toplevel_window_event_handler_unittest.cc |
diff --git a/ash/wm/toplevel_window_event_handler_unittest.cc b/ash/wm/toplevel_window_event_handler_unittest.cc |
index 036cabffcc2c5bef86f21841a3f781a78d5f4320..dc9b3a026411e2c3047fad8baad4809fd784c71e 100644 |
--- a/ash/wm/toplevel_window_event_handler_unittest.cc |
+++ b/ash/wm/toplevel_window_event_handler_unittest.cc |
@@ -404,39 +404,45 @@ TEST_F(ToplevelWindowEventHandlerTest, GestureDrag) { |
gfx::Point location(5, 5); |
target->SetProperty(aura::client::kCanMaximizeKey, true); |
- // Snap right; |
gfx::Point end = location; |
- end.Offset(100, 0); |
- generator.GestureScrollSequence(location, end, |
- base::TimeDelta::FromMilliseconds(5), |
- 10); |
- RunAllPendingInMessageLoop(); |
- // Verify that the window has moved after the gesture. |
- EXPECT_NE(old_bounds.ToString(), target->bounds().ToString()); |
+ // Snap right; |
{ |
+ // Get the expected snapped bounds before snapping. |
internal::SnapSizer sizer(target.get(), location, |
internal::SnapSizer::RIGHT_EDGE, |
internal::SnapSizer::OTHER_INPUT); |
- EXPECT_EQ(sizer.target_bounds().ToString(), target->bounds().ToString()); |
+ gfx::Rect snapped_bounds = sizer.GetSnapBounds(target->bounds()); |
+ |
+ end.Offset(100, 0); |
+ generator.GestureScrollSequence(location, end, |
+ base::TimeDelta::FromMilliseconds(5), |
+ 10); |
+ RunAllPendingInMessageLoop(); |
+ |
+ // Verify that the window has moved after the gesture. |
+ EXPECT_NE(old_bounds.ToString(), target->bounds().ToString()); |
+ EXPECT_EQ(snapped_bounds.ToString(), target->bounds().ToString()); |
} |
old_bounds = target->bounds(); |
// Snap left. |
- end = location = target->GetBoundsInRootWindow().CenterPoint(); |
- end.Offset(-100, 0); |
- generator.GestureScrollSequence(location, end, |
- base::TimeDelta::FromMilliseconds(5), |
- 10); |
- RunAllPendingInMessageLoop(); |
- |
- EXPECT_NE(old_bounds.ToString(), target->bounds().ToString()); |
{ |
+ // Get the expected snapped bounds before snapping. |
internal::SnapSizer sizer(target.get(), location, |
internal::SnapSizer::LEFT_EDGE, |
internal::SnapSizer::OTHER_INPUT); |
- EXPECT_EQ(sizer.target_bounds().ToString(), target->bounds().ToString()); |
+ gfx::Rect snapped_bounds = sizer.GetSnapBounds(target->bounds()); |
+ end = location = target->GetBoundsInRootWindow().CenterPoint(); |
+ end.Offset(-100, 0); |
+ generator.GestureScrollSequence(location, end, |
+ base::TimeDelta::FromMilliseconds(5), |
+ 10); |
+ RunAllPendingInMessageLoop(); |
+ |
+ EXPECT_NE(old_bounds.ToString(), target->bounds().ToString()); |
+ EXPECT_EQ(snapped_bounds.ToString(), target->bounds().ToString()); |
} |
old_bounds = target->bounds(); |