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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
969 TEST_F(VirtualKeyboardRootWindowControllerTest, | 969 TEST_F(VirtualKeyboardRootWindowControllerTest, |
970 DeleteOldContainerOnVirtualKeyboardInit) { | 970 DeleteOldContainerOnVirtualKeyboardInit) { |
971 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 971 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
972 aura::Window* keyboard_container = | 972 aura::Window* keyboard_container = |
973 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer); | 973 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer); |
974 ASSERT_TRUE(keyboard_container); | 974 ASSERT_TRUE(keyboard_container); |
975 // Track the keyboard container window. | 975 // Track the keyboard container window. |
976 aura::WindowTracker tracker; | 976 aura::WindowTracker tracker; |
977 tracker.Add(keyboard_container); | 977 tracker.Add(keyboard_container); |
978 // Mock a login user profile change to reinitialize the keyboard. | 978 // Mock a login user profile change to reinitialize the keyboard. |
979 Shell::GetInstance()->OnLoginUserProfilePrepared(); | 979 WmShell::Get()->OnUserSessionStateActive(); |
msw
2016/12/16 16:26:20
This is okay, but it'd be even better if we could
James Cook
2016/12/20 04:02:43
Done.
| |
980 // keyboard_container should no longer be present. | 980 // keyboard_container should no longer be present. |
981 EXPECT_FALSE(tracker.Contains(keyboard_container)); | 981 EXPECT_FALSE(tracker.Contains(keyboard_container)); |
982 } | 982 } |
983 | 983 |
984 // Test for crbug.com/342524. After user login, the work space should restore to | 984 // Test for crbug.com/342524. After user login, the work space should restore to |
985 // full screen. | 985 // full screen. |
986 TEST_F(VirtualKeyboardRootWindowControllerTest, RestoreWorkspaceAfterLogin) { | 986 TEST_F(VirtualKeyboardRootWindowControllerTest, RestoreWorkspaceAfterLogin) { |
987 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 987 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
988 aura::Window* keyboard_container = | 988 aura::Window* keyboard_container = |
989 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer); | 989 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer); |
(...skipping 13 matching lines...) Expand all Loading... | |
1003 // Notify keyboard bounds changing. | 1003 // Notify keyboard bounds changing. |
1004 controller->NotifyKeyboardBoundsChanging(keyboard_container->bounds()); | 1004 controller->NotifyKeyboardBoundsChanging(keyboard_container->bounds()); |
1005 | 1005 |
1006 if (!keyboard::IsKeyboardOverscrollEnabled()) { | 1006 if (!keyboard::IsKeyboardOverscrollEnabled()) { |
1007 gfx::Rect after = | 1007 gfx::Rect after = |
1008 display::Screen::GetScreen()->GetPrimaryDisplay().work_area(); | 1008 display::Screen::GetScreen()->GetPrimaryDisplay().work_area(); |
1009 EXPECT_LT(after, before); | 1009 EXPECT_LT(after, before); |
1010 } | 1010 } |
1011 | 1011 |
1012 // Mock a login user profile change to reinitialize the keyboard. | 1012 // Mock a login user profile change to reinitialize the keyboard. |
1013 Shell::GetInstance()->OnLoginUserProfilePrepared(); | 1013 WmShell::Get()->OnUserSessionStateActive(); |
1014 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().work_area(), | 1014 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().work_area(), |
1015 before); | 1015 before); |
1016 } | 1016 } |
1017 | 1017 |
1018 // Ensure that system modal dialogs do not block events targeted at the virtual | 1018 // Ensure that system modal dialogs do not block events targeted at the virtual |
1019 // keyboard. | 1019 // keyboard. |
1020 TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) { | 1020 TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) { |
1021 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 1021 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
1022 aura::Window* keyboard_container = | 1022 aura::Window* keyboard_container = |
1023 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer); | 1023 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1253 keyboard_controller->ui()->GetKeyboardWindow()->SetBounds( | 1253 keyboard_controller->ui()->GetKeyboardWindow()->SetBounds( |
1254 gfx::Rect(0, 400, 800, 200)); | 1254 gfx::Rect(0, 400, 800, 200)); |
1255 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString()); | 1255 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString()); |
1256 | 1256 |
1257 UpdateDisplay("600x800"); | 1257 UpdateDisplay("600x800"); |
1258 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString()); | 1258 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString()); |
1259 } | 1259 } |
1260 | 1260 |
1261 } // namespace test | 1261 } // namespace test |
1262 } // namespace ash | 1262 } // namespace ash |
OLD | NEW |