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

Unified Diff: ash/wm/toplevel_window_event_filter_unittest.cc

Issue 10910164: Removes the grid from ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ShelfBrowserTest Created 8 years, 3 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
« no previous file with comments | « ash/wm/toplevel_window_event_filter.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/toplevel_window_event_filter_unittest.cc
diff --git a/ash/wm/toplevel_window_event_filter_unittest.cc b/ash/wm/toplevel_window_event_filter_unittest.cc
index 0974b63f6e2259ce217a947ce52c9686e34e34be..7086aa436a117a0f2abdcf6fca36ae02eb09bae2 100644
--- a/ash/wm/toplevel_window_event_filter_unittest.cc
+++ b/ash/wm/toplevel_window_event_filter_unittest.cc
@@ -78,7 +78,6 @@ class ToplevelWindowEventFilterTest : public AshTestBase {
parent_->SetBounds(Shell::GetPrimaryRootWindow()->bounds());
filter_ = new ToplevelWindowEventFilter(parent_);
parent_->SetEventFilter(filter_);
- SetGridSize(0);
}
virtual void TearDown() OVERRIDE {
@@ -109,11 +108,6 @@ class ToplevelWindowEventFilterTest : public AshTestBase {
generator.PressMoveAndReleaseTouchBy(dx, dy);
}
- void SetGridSize(int grid_size) {
- Shell::TestApi shell_test(Shell::GetInstance());
- shell_test.workspace_controller()->SetGridSize(grid_size);
- }
-
ToplevelWindowEventFilter* filter_;
private:
@@ -399,46 +393,8 @@ TEST_F(ToplevelWindowEventFilterTest, DontGotWiderThanScreen) {
EXPECT_EQ(work_area.width(), target->bounds().width());
}
-// Verifies that when a grid size is set resizes snap to the grid.
-TEST_F(ToplevelWindowEventFilterTest, ResizeSnaps) {
- SetGridSize(8);
- scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOMRIGHT));
- DragFromCenterBy(target.get(), 11, 21);
- EXPECT_EQ(112, target->bounds().width());
- EXPECT_EQ(120, target->bounds().height());
- target.reset(CreateWindow(HTTOPLEFT));
- target->SetBounds(gfx::Rect(48, 96, 100, 100));
- DragFromCenterBy(target.get(), -11, -21);
- EXPECT_EQ(40, target->bounds().x());
- EXPECT_EQ(80, target->bounds().y());
- EXPECT_EQ(112, target->bounds().width());
- EXPECT_EQ(120, target->bounds().height());
-}
-
-// Verifies that when a grid size is set dragging snaps to the grid.
-TEST_F(ToplevelWindowEventFilterTest, DragSnaps) {
- SetGridSize(8);
- scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION));
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- target.get());
- generator.PressLeftButton();
- generator.MoveMouseTo(generator.current_location().Add(gfx::Point(11, 21)));
-
- // Execute any scheduled draws so that pending mouse events are processed.
- RunAllPendingInMessageLoop();
-
- EXPECT_EQ(11, target->bounds().x());
- EXPECT_EQ(21, target->bounds().y());
- // We only snap moves to the grid on release.
- generator.ReleaseLeftButton();
- EXPECT_EQ(8, target->bounds().x());
- EXPECT_EQ(24, target->bounds().y());
-}
-
// Verifies that touch-gestures drag the window correctly.
TEST_F(ToplevelWindowEventFilterTest, GestureDrag) {
- const int kGridSize = 8;
- SetGridSize(kGridSize);
scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION));
aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
target.get());
@@ -457,7 +413,7 @@ TEST_F(ToplevelWindowEventFilterTest, GestureDrag) {
EXPECT_NE(old_bounds.ToString(), target->bounds().ToString());
{
internal::SnapSizer sizer(target.get(), location,
- internal::SnapSizer::RIGHT_EDGE, kGridSize);
+ internal::SnapSizer::RIGHT_EDGE);
EXPECT_EQ(sizer.target_bounds().ToString(), target->bounds().ToString());
}
@@ -474,7 +430,7 @@ TEST_F(ToplevelWindowEventFilterTest, GestureDrag) {
EXPECT_NE(old_bounds.ToString(), target->bounds().ToString());
{
internal::SnapSizer sizer(target.get(), location,
- internal::SnapSizer::LEFT_EDGE, kGridSize);
+ internal::SnapSizer::LEFT_EDGE);
EXPECT_EQ(sizer.target_bounds().ToString(), target->bounds().ToString());
}
« no previous file with comments | « ash/wm/toplevel_window_event_filter.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698