| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/toplevel_window_event_handler.h" | 5 #include "ash/wm/toplevel_window_event_handler.h" |
| 6 | 6 |
| 7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
| 12 #include "ash/wm/lock_state_controller_impl2.h" | 12 #include "ash/wm/lock_state_controller.h" |
| 13 #include "ash/wm/resize_shadow.h" | 13 #include "ash/wm/resize_shadow.h" |
| 14 #include "ash/wm/resize_shadow_controller.h" | 14 #include "ash/wm/resize_shadow_controller.h" |
| 15 #include "ash/wm/window_state.h" | 15 #include "ash/wm/window_state.h" |
| 16 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
| 17 #include "ash/wm/workspace/snap_sizer.h" | 17 #include "ash/wm/workspace/snap_sizer.h" |
| 18 #include "ash/wm/workspace_controller.h" | 18 #include "ash/wm/workspace_controller.h" |
| 19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
| 20 #include "base/compiler_specific.h" | 20 #include "base/compiler_specific.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "ui/aura/client/aura_constants.h" | 22 #include "ui/aura/client/aura_constants.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 RunAllPendingInMessageLoop(); | 457 RunAllPendingInMessageLoop(); |
| 458 EXPECT_NE(old_bounds.ToString(), target->bounds().ToString()); | 458 EXPECT_NE(old_bounds.ToString(), target->bounds().ToString()); |
| 459 EXPECT_TRUE(window_state->IsMinimized()); | 459 EXPECT_TRUE(window_state->IsMinimized()); |
| 460 EXPECT_TRUE(window_state->always_restores_to_restore_bounds()); | 460 EXPECT_TRUE(window_state->always_restores_to_restore_bounds()); |
| 461 EXPECT_EQ(old_bounds.ToString(), | 461 EXPECT_EQ(old_bounds.ToString(), |
| 462 window_state->GetRestoreBoundsInScreen().ToString()); | 462 window_state->GetRestoreBoundsInScreen().ToString()); |
| 463 } | 463 } |
| 464 | 464 |
| 465 // Tests that a gesture cannot minimize a window in login/lock screen. | 465 // Tests that a gesture cannot minimize a window in login/lock screen. |
| 466 TEST_F(ToplevelWindowEventHandlerTest, GestureDragMinimizeLoginScreen) { | 466 TEST_F(ToplevelWindowEventHandlerTest, GestureDragMinimizeLoginScreen) { |
| 467 LockStateControllerImpl2* state_controller = | 467 LockStateController* state_controller = |
| 468 static_cast<LockStateControllerImpl2*> | 468 Shell::GetInstance()->lock_state_controller(); |
| 469 (Shell::GetInstance()->lock_state_controller()); | |
| 470 state_controller->OnLoginStateChanged(user::LOGGED_IN_NONE); | 469 state_controller->OnLoginStateChanged(user::LOGGED_IN_NONE); |
| 471 state_controller->OnLockStateChanged(false); | 470 state_controller->OnLockStateChanged(false); |
| 472 SetUserLoggedIn(false); | 471 SetUserLoggedIn(false); |
| 473 | 472 |
| 474 scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION)); | 473 scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION)); |
| 475 aura::Window* lock = internal::RootWindowController::ForWindow(target.get())-> | 474 aura::Window* lock = internal::RootWindowController::ForWindow(target.get())-> |
| 476 GetContainer(internal::kShellWindowId_LockSystemModalContainer); | 475 GetContainer(internal::kShellWindowId_LockSystemModalContainer); |
| 477 lock->AddChild(target.get()); | 476 lock->AddChild(target.get()); |
| 478 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), | 477 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), |
| 479 target.get()); | 478 target.get()); |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 | 810 |
| 812 // Move mouse out of the window. Shadows should disappear. | 811 // Move mouse out of the window. Shadows should disappear. |
| 813 generator.MoveMouseTo(150, 150); | 812 generator.MoveMouseTo(150, 150); |
| 814 EXPECT_FALSE(HasResizeShadow()); | 813 EXPECT_FALSE(HasResizeShadow()); |
| 815 | 814 |
| 816 RunAllPendingInMessageLoop(); | 815 RunAllPendingInMessageLoop(); |
| 817 } | 816 } |
| 818 | 817 |
| 819 } // namespace test | 818 } // namespace test |
| 820 } // namespace ash | 819 } // namespace ash |
| OLD | NEW |