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

Unified Diff: ash/wm/workspace/workspace_event_handler_unittest.cc

Issue 144193002: Only drag or maximize / restore when event has not yet been handled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Panels too, no test for these yet. Created 6 years, 11 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/wm/workspace/workspace_event_handler_unittest.cc
diff --git a/ash/wm/workspace/workspace_event_handler_unittest.cc b/ash/wm/workspace/workspace_event_handler_unittest.cc
index fd8da55d005ce78bb68a5f8c580604a370989de5..ebf48a0c431997318e1812e5353c82437aecfdb9 100644
--- a/ash/wm/workspace/workspace_event_handler_unittest.cc
+++ b/ash/wm/workspace/workspace_event_handler_unittest.cc
@@ -19,6 +19,7 @@
#include "ui/aura/window.h"
#include "ui/base/hit_test.h"
#include "ui/gfx/screen.h"
+#include "ui/views/corewm/window_util.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
@@ -248,6 +249,35 @@ TEST_F(WorkspaceEventHandlerTest,
EXPECT_EQ(restored_bounds.width(), window->bounds().width());
}
+TEST_F(WorkspaceEventHandlerTest,
+ DoubleClickOrTapWithModalChildDoesntMaximize) {
+ aura::test::TestWindowDelegate wd1;
+ aura::test::TestWindowDelegate wd2;
+ scoped_ptr<aura::Window> window(
+ CreateTestWindow(&wd1, gfx::Rect(10, 20, 30, 40)));
+ scoped_ptr<aura::Window> child(
+ CreateTestWindow(&wd2, gfx::Rect(0, 0, 1, 1)));
+ window->SetProperty(aura::client::kCanMaximizeKey, true);
+ wd1.set_window_component(HTCAPTION);
+
+ child->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW);
+ views::corewm::AddTransientChild(window.get(), child.get());
+
+ wm::WindowState* window_state = wm::GetWindowState(window.get());
+ EXPECT_FALSE(window_state->IsMaximized());
+ aura::Window* root = Shell::GetPrimaryRootWindow();
+ aura::test::EventGenerator generator(root, window.get());
+ generator.DoubleClickLeftButton();
+ EXPECT_EQ("10,20 30x40", window->bounds().ToString());
+ EXPECT_FALSE(window_state->IsMaximized());
+
+ generator.GestureTapAt(gfx::Point(25, 25));
+ generator.GestureTapAt(gfx::Point(25, 25));
+ RunAllPendingInMessageLoop();
+ EXPECT_EQ("10,20 30x40", window->bounds().ToString());
+ EXPECT_FALSE(window_state->IsMaximized());
+}
+
TEST_F(WorkspaceEventHandlerTest, DoubleClickCaptionTogglesMaximize) {
aura::test::TestWindowDelegate wd;
scoped_ptr<aura::Window> window(
« ash/wm/toplevel_window_event_handler.cc ('K') | « ash/wm/workspace/workspace_event_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698