Chromium Code Reviews| 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) { |
|
oshima
2014/01/29 20:02:22
nit: indent
flackr
2014/01/30 15:16:26
Done, and the other instances in this file.
|
| + 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( |