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

Unified Diff: ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc

Issue 2599743003: Disable emoji, handwriting and voice for password input client. (Closed)
Patch Set: sync Created 3 years, 11 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 | « ash/common/system/chromeos/ime_menu/ime_menu_tray.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc b/ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc
index 1ca9a87907855795a51626d04a49a8d2320b6b68..bc8d7da4e51d8c415246215e985e19cacd169cd3 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray_unittest.cc
@@ -16,6 +16,10 @@
#include "ash/test/status_area_widget_test_helper.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/accessibility/ax_node_data.h"
+#include "ui/base/ime/chromeos/input_method_manager.h"
+#include "ui/base/ime/chromeos/mock_input_method_manager.h"
+#include "ui/base/ime/ime_bridge.h"
+#include "ui/base/ime/text_input_flags.h"
#include "ui/events/event.h"
#include "ui/views/controls/label.h"
@@ -76,6 +80,13 @@ class ImeMenuTrayTest : public test::AshTestBase {
return true;
}
+ // Focuses in the given type of input context.
+ void FocusInInputContext(ui::TextInputType input_type) {
+ ui::IMEEngineHandlerInterface::InputContext input_context(
+ input_type, ui::TEXT_INPUT_MODE_DEFAULT, ui::TEXT_INPUT_FLAG_NONE);
+ ui::IMEBridge::Get()->SetCurrentInputContext(input_context);
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(ImeMenuTrayTest);
};
@@ -281,4 +292,22 @@ TEST_F(ImeMenuTrayTest, ForceToShowEmojiKeyset) {
EXPECT_FALSE(accessibility_delegate->IsVirtualKeyboardEnabled());
}
+TEST_F(ImeMenuTrayTest, ShowEmojiHandwritingVoiceButtons) {
+ FocusInInputContext(ui::TEXT_INPUT_TYPE_TEXT);
+ EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons());
+
+ chromeos::input_method::InputMethodManager* input_method_manager =
+ chromeos::input_method::InputMethodManager::Get();
+ EXPECT_FALSE(input_method_manager);
+ chromeos::input_method::InputMethodManager::Initialize(
+ new chromeos::input_method::MockInputMethodManager);
+ input_method_manager = chromeos::input_method::InputMethodManager::Get();
+ EXPECT_TRUE(input_method_manager &&
+ input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled());
+ EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons());
+
+ FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD);
+ EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons());
+}
+
} // namespace ash
« no previous file with comments | « ash/common/system/chromeos/ime_menu/ime_menu_tray.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698