Index: ash/root_window_controller_unittest.cc |
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc |
index d547a8a335099074ab4f11962e4f4da675a6a6d3..fbb15d61585150a4c218f2b4d42a54edd5b407e3 100644 |
--- a/ash/root_window_controller_unittest.cc |
+++ b/ash/root_window_controller_unittest.cc |
@@ -25,6 +25,7 @@ |
#include "ui/aura/test/test_windows.h" |
#include "ui/aura/window.h" |
#include "ui/aura/window_tracker.h" |
+#include "ui/keyboard/keyboard_controller_proxy.h" |
#include "ui/keyboard/keyboard_switches.h" |
#include "ui/views/controls/menu/menu_controller.h" |
#include "ui/views/widget/widget.h" |
@@ -667,6 +668,16 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, |
main_delegate->CreateTestWindowWithParent(keyboard_container)); |
keyboard_container->layout_manager()->OnWindowResized(); |
keyboard_window->Show(); |
+ |
+ // This test will create 2 sub windows for keyboard container. |
+ // One is from keyboard controller proxy, and another is from this test |
+ // itself. For testing purpose, the test window is needed for mouse hit test. |
+ // But inside keyboard controller, it needs proxy window to calculate the |
+ // bounds of the hit test mask. Therefore, below code is a hack to make sure |
+ // the 2 windows have the same bounds. |
+ Shell::GetInstance()->keyboard_controller()->proxy()->GetKeyboardWindow() |
+ ->SetBounds(keyboard_window->bounds()); |
sadrul
2013/12/04 17:35:20
It's not clear to me why you need a new window for
Shu Chen
2013/12/05 05:01:39
Done.
|
+ |
aura::test::EventGenerator event_generator(root_window, |
keyboard_window.get()); |
event_generator.ClickLeftButton(); |