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

Unified Diff: ash/root_window_controller_unittest.cc

Issue 25105002: Deletes keyboard container before recreating the controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit test for bug. Created 7 years, 3 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') | no next file » | 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 0753600a1257a6d57a24758152354106a2265806..4155c1a968f3e92a4e19a20221df1a81e2b9a528 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -594,5 +594,23 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
}
}
+// Test for http://crbug.com/299787. RootWindowController should delete
+// the old container since the keyboard controller creates a new window in
+// GetWindowContainer().
+TEST_F(VirtualKeyboardRootWindowControllerTest,
+ DeleteOldContainerOnVirtualKeyboardInit) {
+ aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow();
+ aura::Window* keyboard_container = Shell::GetContainer(root_window,
+ internal::kShellWindowId_VirtualKeyboardContainer);
+ ASSERT_TRUE(keyboard_container);
+ // Track the keyboard container window.
+ aura::WindowTracker tracker;
+ tracker.Add(keyboard_container);
+ // Mock a login state change to reinitialize the keyboard.
+ ash::Shell::GetInstance()->OnLoginStateChanged(user::LOGGED_IN_OWNER);
+ // keyboard_container should no longer be present.
+ EXPECT_FALSE(tracker.Contains(keyboard_container));
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « ash/root_window_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698