Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2468)

Unified Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 23471004: Only support left/right maximizing at 50% width when the --ash-enable-alternate-caption-button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch is now friendlier to pending docking changes Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
}

Powered by Google App Engine
This is Rietveld 408576698