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 "ash/session_state_delegate.h" | 7 #include "ash/session_state_delegate.h" |
8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.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" |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 block_reason < NUMBER_OF_BLOCK_REASONS; | 587 block_reason < NUMBER_OF_BLOCK_REASONS; |
588 ++block_reason) { | 588 ++block_reason) { |
589 BlockUserSession(static_cast<UserSessionBlockReason>(block_reason)); | 589 BlockUserSession(static_cast<UserSessionBlockReason>(block_reason)); |
590 event_generator.ClickLeftButton(); | 590 event_generator.ClickLeftButton(); |
591 expected_mouse_presses++; | 591 expected_mouse_presses++; |
592 EXPECT_EQ(expected_mouse_presses, main_delegate->mouse_presses()); | 592 EXPECT_EQ(expected_mouse_presses, main_delegate->mouse_presses()); |
593 UnblockUserSession(); | 593 UnblockUserSession(); |
594 } | 594 } |
595 } | 595 } |
596 | 596 |
| 597 // Test for http://crbug.com/299787. RootWindowController should delete |
| 598 // the old container since the keyboard controller creates a new window in |
| 599 // GetWindowContainer(). |
| 600 TEST_F(VirtualKeyboardRootWindowControllerTest, |
| 601 DeleteOldContainerOnVirtualKeyboardInit) { |
| 602 aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); |
| 603 aura::Window* keyboard_container = Shell::GetContainer(root_window, |
| 604 internal::kShellWindowId_VirtualKeyboardContainer); |
| 605 ASSERT_TRUE(keyboard_container); |
| 606 // Track the keyboard container window. |
| 607 aura::WindowTracker tracker; |
| 608 tracker.Add(keyboard_container); |
| 609 // Mock a login state change to reinitialize the keyboard. |
| 610 ash::Shell::GetInstance()->OnLoginStateChanged(user::LOGGED_IN_OWNER); |
| 611 // keyboard_container should no longer be present. |
| 612 EXPECT_FALSE(tracker.Contains(keyboard_container)); |
| 613 } |
| 614 |
597 } // namespace test | 615 } // namespace test |
598 } // namespace ash | 616 } // namespace ash |
OLD | NEW |