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/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
11 #include "ash/wm/property_util.h" | 11 #include "ash/wm/property_util.h" |
12 #include "ash/wm/session_state_controller_impl.h" | 12 #include "ash/wm/session_lock_state_controller_impl2.h" |
13 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
14 #include "ash/wm/workspace/snap_sizer.h" | 14 #include "ash/wm/workspace/snap_sizer.h" |
15 #include "ash/wm/workspace_controller.h" | 15 #include "ash/wm/workspace_controller.h" |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "ui/aura/client/aura_constants.h" | 19 #include "ui/aura/client/aura_constants.h" |
20 #include "ui/aura/root_window.h" | 20 #include "ui/aura/root_window.h" |
21 #include "ui/aura/test/aura_test_base.h" | 21 #include "ui/aura/test/aura_test_base.h" |
22 #include "ui/aura/test/event_generator.h" | 22 #include "ui/aura/test/event_generator.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 RunAllPendingInMessageLoop(); | 465 RunAllPendingInMessageLoop(); |
466 EXPECT_NE(old_bounds.ToString(), target->bounds().ToString()); | 466 EXPECT_NE(old_bounds.ToString(), target->bounds().ToString()); |
467 EXPECT_TRUE(wm::IsWindowMinimized(target.get())); | 467 EXPECT_TRUE(wm::IsWindowMinimized(target.get())); |
468 EXPECT_TRUE(GetWindowAlwaysRestoresToRestoreBounds(target.get())); | 468 EXPECT_TRUE(GetWindowAlwaysRestoresToRestoreBounds(target.get())); |
469 EXPECT_EQ(old_bounds.ToString(), | 469 EXPECT_EQ(old_bounds.ToString(), |
470 GetRestoreBoundsInScreen(target.get())->ToString()); | 470 GetRestoreBoundsInScreen(target.get())->ToString()); |
471 } | 471 } |
472 | 472 |
473 // Tests that a gesture cannot minimize a window in login/lock screen. | 473 // Tests that a gesture cannot minimize a window in login/lock screen. |
474 TEST_F(ToplevelWindowEventHandlerTest, GestureDragMinimizeLoginScreen) { | 474 TEST_F(ToplevelWindowEventHandlerTest, GestureDragMinimizeLoginScreen) { |
475 SessionStateControllerImpl* state_controller = | 475 SessionLockStateControllerImpl2* state_controller = |
476 static_cast<SessionStateControllerImpl*> | 476 static_cast<SessionLockStateControllerImpl2*> |
Nikita (slow)
2013/05/30 13:16:10
I fixed static_cast which seems to be incorrect as
| |
477 (Shell::GetInstance()->session_state_controller()); | 477 (Shell::GetInstance()->session_lock_state_controller()); |
478 state_controller->OnLoginStateChanged(user::LOGGED_IN_NONE); | 478 state_controller->OnLoginStateChanged(user::LOGGED_IN_NONE); |
479 state_controller->OnLockStateChanged(false); | 479 state_controller->OnLockStateChanged(false); |
480 SetUserLoggedIn(false); | 480 SetUserLoggedIn(false); |
481 | 481 |
482 scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION)); | 482 scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION)); |
483 aura::Window* lock = internal::RootWindowController::ForWindow(target.get())-> | 483 aura::Window* lock = internal::RootWindowController::ForWindow(target.get())-> |
484 GetContainer(internal::kShellWindowId_LockSystemModalContainer); | 484 GetContainer(internal::kShellWindowId_LockSystemModalContainer); |
485 lock->AddChild(target.get()); | 485 lock->AddChild(target.get()); |
486 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), | 486 aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), |
487 target.get()); | 487 target.get()); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
691 | 691 |
692 generator.PressLeftButton(); | 692 generator.PressLeftButton(); |
693 generator.MoveMouseBy(10, 11); | 693 generator.MoveMouseBy(10, 11); |
694 RunAllPendingInMessageLoop(); | 694 RunAllPendingInMessageLoop(); |
695 EXPECT_EQ("10,11 100x100", target->bounds().ToString()); | 695 EXPECT_EQ("10,11 100x100", target->bounds().ToString()); |
696 } | 696 } |
697 } | 697 } |
698 | 698 |
699 } // namespace test | 699 } // namespace test |
700 } // namespace ash | 700 } // namespace ash |
OLD | NEW |