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

Unified Diff: ash/root_window_controller_unittest.cc

Issue 159473002: Restore screen work area after login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit and change HasKeyboardWindow to virtual function Created 6 years, 10 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
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/shell/keyboard_controller_proxy_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller_unittest.cc
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index f331afb6912f52524f599ab8aeee6b3383cab0b3..be982d4c3cf1db1df7d9d98336411c391fb7cf53 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -649,7 +649,7 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
// GetWindowContainer().
TEST_F(VirtualKeyboardRootWindowControllerTest,
DeleteOldContainerOnVirtualKeyboardInit) {
- aura::Window* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
aura::Window* keyboard_container = Shell::GetContainer(root_window,
internal::kShellWindowId_VirtualKeyboardContainer);
ASSERT_TRUE(keyboard_container);
@@ -662,5 +662,33 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
EXPECT_FALSE(tracker.Contains(keyboard_container));
}
+// Test for crbug.com/342524. After user login, the work space should restore to
+// full screen.
+TEST_F(VirtualKeyboardRootWindowControllerTest, RestoreWorkspaceAfterLogin) {
+ aura::Window* root_window = Shell::GetPrimaryRootWindow();
+ aura::Window* keyboard_container = Shell::GetContainer(root_window,
+ internal::kShellWindowId_VirtualKeyboardContainer);
+ keyboard_container->Show();
+ keyboard::KeyboardController* controller =
+ Shell::GetInstance()->keyboard_controller();
+ aura::Window* keyboard_window = controller->proxy()->GetKeyboardWindow();
+ keyboard_container->AddChild(keyboard_window);
+ keyboard_window->set_owned_by_parent(false);
+ keyboard_window->Show();
+
+ gfx::Rect before = ash::Shell::GetScreen()->GetPrimaryDisplay().work_area();
+
+ // Notify keyboard bounds changing.
+ controller->NotifyKeyboardBoundsChanging(
+ controller->proxy()->GetKeyboardWindow()->bounds());
+
+ gfx::Rect after = ash::Shell::GetScreen()->GetPrimaryDisplay().work_area();
+ EXPECT_LT(after, before);
+
+ // Mock a login user profile change to reinitialize the keyboard.
+ ash::Shell::GetInstance()->OnLoginUserProfilePrepared();
+ EXPECT_EQ(ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(), before);
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/shell/keyboard_controller_proxy_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698