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/session_state_delegate.h" | 7 #include "ash/session/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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 keyboard_window->SetBounds(keyboard::KeyboardBoundsFromWindowBounds( | 707 keyboard_window->SetBounds(keyboard::KeyboardBoundsFromWindowBounds( |
708 keyboard_container->bounds(), 100)); | 708 keyboard_container->bounds(), 100)); |
709 keyboard_window->Show(); | 709 keyboard_window->Show(); |
710 | 710 |
711 gfx::Rect before = ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(); | 711 gfx::Rect before = ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(); |
712 | 712 |
713 // Notify keyboard bounds changing. | 713 // Notify keyboard bounds changing. |
714 controller->NotifyKeyboardBoundsChanging( | 714 controller->NotifyKeyboardBoundsChanging( |
715 controller->proxy()->GetKeyboardWindow()->bounds()); | 715 controller->proxy()->GetKeyboardWindow()->bounds()); |
716 | 716 |
717 gfx::Rect after = ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(); | 717 if (!keyboard::IsKeyboardOverscrollEnabled()) { |
718 EXPECT_LT(after, before); | 718 gfx::Rect after = ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(); |
| 719 EXPECT_LT(after, before); |
| 720 } |
719 | 721 |
720 // Mock a login user profile change to reinitialize the keyboard. | 722 // Mock a login user profile change to reinitialize the keyboard. |
721 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); | 723 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); |
722 EXPECT_EQ(ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(), before); | 724 EXPECT_EQ(ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(), before); |
723 } | 725 } |
724 | 726 |
725 // Ensure that system modal dialogs do not block events targeted at the virtual | 727 // Ensure that system modal dialogs do not block events targeted at the virtual |
726 // keyboard. | 728 // keyboard. |
727 TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) { | 729 TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) { |
728 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 730 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
(...skipping 30 matching lines...) Expand all Loading... |
759 modal_widget->Close(); | 761 modal_widget->Close(); |
760 | 762 |
761 // Verify that mouse events are now unblocked to the root window. | 763 // Verify that mouse events are now unblocked to the root window. |
762 root_window_event_generator.ClickLeftButton(); | 764 root_window_event_generator.ClickLeftButton(); |
763 EXPECT_EQ(2, handler.num_mouse_events() / 2); | 765 EXPECT_EQ(2, handler.num_mouse_events() / 2); |
764 root_window->RemovePreTargetHandler(&handler); | 766 root_window->RemovePreTargetHandler(&handler); |
765 } | 767 } |
766 | 768 |
767 } // namespace test | 769 } // namespace test |
768 } // namespace ash | 770 } // namespace ash |
OLD | NEW |