Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: ash/root_window_controller_unittest.cc

Issue 334573004: Fixes unittests with --enable-text-input-focus-manager flag enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed more unittests. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller_unittest.cc
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index 9f0112aaf16d34181f44ab1d650a588fda539a04..9e959c5d806b657af1c1c7ed200cf434e5d950e9 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -28,6 +28,8 @@
#include "ui/base/ime/dummy_text_input_client.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/ime/text_input_client.h"
+#include "ui/base/ime/text_input_focus_manager.h"
+#include "ui/base/ui_base_switches_util.h"
#include "ui/events/test/test_event_handler.h"
#include "ui/keyboard/keyboard_controller_proxy.h"
#include "ui/keyboard/keyboard_switches.h"
@@ -805,7 +807,12 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, EnsureCaretInWorkArea) {
MockTextInputClient text_input_client;
ui::InputMethod* input_method = proxy->GetInputMethod();
ASSERT_TRUE(input_method);
- input_method->SetFocusedTextInputClient(&text_input_client);
+ if (switches::IsTextInputFocusManagerEnabled()) {
+ ui::TextInputFocusManager::GetInstance()->FocusTextInputClient(
+ &text_input_client);
+ } else {
+ input_method->SetFocusedTextInputClient(&text_input_client);
+ }
aura::Window* root_window = Shell::GetPrimaryRootWindow();
aura::Window* keyboard_container =
@@ -825,6 +832,13 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, EnsureCaretInWorkArea) {
text_input_client.visible_rect().width());
ASSERT_EQ(keyboard_container->bounds().height() - keyboard_height,
text_input_client.visible_rect().height());
+
+ if (switches::IsTextInputFocusManagerEnabled()) {
+ ui::TextInputFocusManager::GetInstance()->BlurTextInputClient(
+ &text_input_client);
+ } else {
+ input_method->SetFocusedTextInputClient(NULL);
+ }
}
} // namespace test
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698