| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ash/display/virtual_keyboard_window_controller.h" | |
| 6 | |
| 7 #include "ash/ash_switches.h" | |
| 8 #include "ash/display/display_controller.h" | |
| 9 #include "ash/root_window_controller.h" | |
| 10 #include "ash/shell.h" | |
| 11 #include "ash/shell_window_ids.h" | |
| 12 #include "ash/test/ash_test_base.h" | |
| 13 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | |
| 14 #include "base/command_line.h" | |
| 15 #include "ui/keyboard/keyboard_switches.h" | |
| 16 #include "ui/keyboard/keyboard_util.h" | |
| 17 | |
| 18 namespace ash { | |
| 19 namespace test { | |
| 20 | |
| 21 class VirtualKeyboardWindowControllerTest : public AshTestBase { | |
| 22 public: | |
| 23 VirtualKeyboardWindowControllerTest() | |
| 24 : virtual_keyboard_window_controller_(NULL) {} | |
| 25 virtual ~VirtualKeyboardWindowControllerTest() {} | |
| 26 | |
| 27 void set_virtual_keyboard_window_controller( | |
| 28 VirtualKeyboardWindowController* controller) { | |
| 29 virtual_keyboard_window_controller_ = controller; | |
| 30 } | |
| 31 | |
| 32 RootWindowController* root_window_controller() { | |
| 33 return virtual_keyboard_window_controller_-> | |
| 34 root_window_controller_for_test(); | |
| 35 } | |
| 36 | |
| 37 private: | |
| 38 VirtualKeyboardWindowController* virtual_keyboard_window_controller_; | |
| 39 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWindowControllerTest); | |
| 40 }; | |
| 41 | |
| 42 // Tests that the onscreen keyboard becomes enabled when maximize mode is | |
| 43 // enabled. | |
| 44 TEST_F(VirtualKeyboardWindowControllerTest, EnabledDuringMaximizeMode) { | |
| 45 set_virtual_keyboard_window_controller( | |
| 46 Shell::GetInstance()->display_controller()-> | |
| 47 virtual_keyboard_window_controller()); | |
| 48 | |
| 49 ASSERT_FALSE(keyboard::IsKeyboardEnabled()); | |
| 50 Shell::GetInstance()->maximize_mode_controller()-> | |
| 51 EnableMaximizeModeWindowManager(true); | |
| 52 EXPECT_TRUE(keyboard::IsKeyboardEnabled()); | |
| 53 Shell::GetInstance()->maximize_mode_controller()-> | |
| 54 EnableMaximizeModeWindowManager(false); | |
| 55 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); | |
| 56 } | |
| 57 | |
| 58 } // namespace test | |
| 59 } // namespace ash | |
| OLD | NEW |