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

Unified Diff: ash/wm/toplevel_window_event_filter_unittest.cc

Issue 10008084: Add ctrl+drag feature for allowing resizing window with exact positioning. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 8 years, 8 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_resizer.h » ('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 caa8a7c21b96dc8a55495d25385756275d82f564..70b20cbfe393ea5f3dbf7362c6187f839f4ab3ff 100644
--- a/ash/wm/toplevel_window_event_filter_unittest.cc
+++ b/ash/wm/toplevel_window_event_filter_unittest.cc
@@ -7,6 +7,7 @@
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/window_util.h"
+#include "ash/wm/workspace_controller.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -76,6 +77,7 @@ class ToplevelWindowEventFilterTest : public AshTestBase {
parent_->SetBounds(Shell::GetRootWindow()->bounds());
filter_ = new ToplevelWindowEventFilter(parent_);
parent_->SetEventFilter(filter_);
+ SetGridSize(0);
}
virtual void TearDown() OVERRIDE {
@@ -106,6 +108,11 @@ 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:
@@ -404,7 +411,7 @@ TEST_F(ToplevelWindowEventFilterTest, DontGotWiderThanScreen) {
// Verifies that when a grid size is set resizes snap to the grid.
TEST_F(ToplevelWindowEventFilterTest, ResizeSnaps) {
- filter_->set_grid_size(8);
+ SetGridSize(8);
scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOMRIGHT));
DragFromCenterBy(target.get(), 11, 21);
EXPECT_EQ(112, target->bounds().width());
@@ -420,7 +427,7 @@ TEST_F(ToplevelWindowEventFilterTest, ResizeSnaps) {
// Verifies that when a grid size is set dragging snaps to the grid.
TEST_F(ToplevelWindowEventFilterTest, DragSnaps) {
- filter_->set_grid_size(8);
+ SetGridSize(8);
scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION));
aura::test::EventGenerator generator(Shell::GetRootWindow(), target.get());
generator.PressLeftButton();
« no previous file with comments | « ash/wm/toplevel_window_event_filter.cc ('k') | ash/wm/window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698