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

Unified Diff: ash/wm/toplevel_window_event_filter_unittest.cc

Issue 9455063: Makes windows scale slightly when dragging the caption. Also wired (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes tests Created 8 years, 10 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 2f436a71f52304bdc733ad2ffb54d2f1f145a7a2..15bcc125eaac70b668b447e813815eb72e3d2c9d 100644
--- a/ash/wm/toplevel_window_event_filter_unittest.cc
+++ b/ash/wm/toplevel_window_event_filter_unittest.cc
@@ -14,6 +14,7 @@
#include "ui/aura/root_window.h"
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/test/event_generator.h"
+#include "ui/aura/test/test_activation_client.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/base/hit_test.h"
#include "ui/gfx/screen.h"
@@ -408,8 +409,6 @@ TEST_F(ToplevelWindowEventFilterTest, ResizeSnaps) {
DragFromCenterBy(target.get(), 11, 21);
EXPECT_EQ(112, target->bounds().width());
EXPECT_EQ(120, target->bounds().height());
- // TODO(sky): enable when test animations complete immediately.
- /*
target.reset(CreateWindow(HTTOPLEFT));
target->SetBounds(gfx::Rect(48, 96, 100, 100));
DragFromCenterBy(target.get(), -11, -21);
@@ -417,7 +416,6 @@ TEST_F(ToplevelWindowEventFilterTest, ResizeSnaps) {
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.
@@ -429,14 +427,29 @@ TEST_F(ToplevelWindowEventFilterTest, DragSnaps) {
generator.MoveMouseTo(generator.current_location().Add(gfx::Point(11, 21)));
EXPECT_EQ(11, target->bounds().x());
EXPECT_EQ(21, target->bounds().y());
- // TODO(sky): enable when test animations complete immediately.
- /*
// We only snap moves to the grid on release.
generator.ReleaseLeftButton();
EXPECT_EQ(8, target->bounds().x());
EXPECT_EQ(24, target->bounds().y());
- */
+}
+
+// Verifies pressing escape resets the bounds to the original bounds.
+TEST_F(ToplevelWindowEventFilterTest, EscapeReverts) {
+ aura::RootWindow* root = Shell::GetRootWindow();
+ aura::client::ActivationClient* original_client =
+ aura::client::GetActivationClient(root);
+ aura::test::TestActivationClient activation_client(root);
+ scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOMRIGHT));
+ target->Focus();
+ aura::test::EventGenerator generator(Shell::GetRootWindow(), target.get());
+ generator.PressLeftButton();
+ generator.MoveMouseTo(generator.current_location().Add(gfx::Point(10, 11)));
+ EXPECT_EQ("0,0 110x111", target->bounds().ToString());
+ generator.PressKey(ui::VKEY_ESCAPE, 0);
+ generator.ReleaseKey(ui::VKEY_ESCAPE, 0);
+ EXPECT_EQ("0,0 100x100", target->bounds().ToString());
+ aura::client::SetActivationClient(root, original_client);
}
} // namespace test
-} // namespace aura
+} // namespace ash
« 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