OLD | NEW |
(Empty) | |
| 1 #include "ash/display/virtual_keyboard_window_controller.h" |
| 2 |
| 3 #include "ash/ash_switches.h" |
| 4 #include "ash/display/display_controller.h" |
| 5 #include "ash/root_window_controller.h" |
| 6 #include "ash/shell.h" |
| 7 #include "ash/shell_window_ids.h" |
| 8 #include "ash/test/ash_test_base.h" |
| 9 #include "base/command_line.h" |
| 10 #include "ui/keyboard/keyboard_switches.h" |
| 11 |
| 12 namespace ash { |
| 13 namespace test { |
| 14 |
| 15 class VirtualKeyboardWindowControllerTest : public AshTestBase { |
| 16 public: |
| 17 VirtualKeyboardWindowControllerTest() |
| 18 : virtual_keyboard_window_controller_(NULL) {} |
| 19 virtual ~VirtualKeyboardWindowControllerTest() {} |
| 20 |
| 21 virtual void SetUp() OVERRIDE { |
| 22 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 23 switches::kAshHostWindowBounds, "1+1-300x300,1+301-300x300"); |
| 24 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 25 keyboard::switches::kKeyboardUsabilityTest); |
| 26 test::AshTestBase::SetUp(); |
| 27 } |
| 28 |
| 29 void set_virtual_keyboard_window_controller( |
| 30 internal::VirtualKeyboardWindowController* controller) { |
| 31 virtual_keyboard_window_controller_ = controller; |
| 32 } |
| 33 |
| 34 internal::RootWindowController* root_window_controller() { |
| 35 return virtual_keyboard_window_controller_-> |
| 36 root_window_controller_for_test(); |
| 37 } |
| 38 |
| 39 private: |
| 40 internal::VirtualKeyboardWindowController* |
| 41 virtual_keyboard_window_controller_; |
| 42 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardWindowControllerTest); |
| 43 }; |
| 44 |
| 45 |
| 46 TEST_F(VirtualKeyboardWindowControllerTest, VirtualKeyboardWindowTest) { |
| 47 if (!SupportsMultipleDisplays()) |
| 48 return; |
| 49 RunAllPendingInMessageLoop(); |
| 50 set_virtual_keyboard_window_controller( |
| 51 Shell::GetInstance()->display_controller()-> |
| 52 virtual_keyboard_window_controller()); |
| 53 EXPECT_TRUE(root_window_controller()); |
| 54 // Keyboard container is added to virtual keyboard window. |
| 55 EXPECT_TRUE(root_window_controller()->GetContainer( |
| 56 internal::kShellWindowId_VirtualKeyboardContainer)); |
| 57 } |
| 58 |
| 59 } // namespace test |
| 60 } // namespace ash |
OLD | NEW |