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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc

Issue 1411603005: Add Workman keyboard layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add trailing comma according to review feedback Created 5 years, 1 month 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 | « chrome/app/chromeos_strings.grdp ('k') | chrome/browser/chromeos/input_method/input_method_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
index 2b021b5491811015250863837f1776c59509dcef..4f162c3e188d73cb138e018dba6e376bc56cf40e 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
@@ -246,6 +246,20 @@ class InputMethodManagerImplTest : public BrowserWithTestWindowTest {
ext_xkb_engine_colemak.layouts.push_back("us(colemak)");
ext_xkb.engines.push_back(ext_xkb_engine_colemak);
+ ComponentExtensionEngine ext_xkb_engine_workman;
+ ext_xkb_engine_workman.engine_id = "xkb:us:workman:eng";
+ ext_xkb_engine_workman.display_name = "xkb:us:workman:eng";
+ ext_xkb_engine_workman.language_codes.push_back("en-US");
+ ext_xkb_engine_workman.layouts.push_back("us(workman)");
+ ext_xkb.engines.push_back(ext_xkb_engine_workman);
+
+ ComponentExtensionEngine ext_xkb_engine_workman_intl;
+ ext_xkb_engine_workman_intl.engine_id = "xkb:us:workman-intl:eng";
+ ext_xkb_engine_workman_intl.display_name = "xkb:us:workman-intl:eng";
+ ext_xkb_engine_workman_intl.language_codes.push_back("en-US");
+ ext_xkb_engine_workman_intl.layouts.push_back("us(workman-intl)");
+ ext_xkb.engines.push_back(ext_xkb_engine_workman_intl);
+
ComponentExtensionEngine ext_xkb_engine_fr;
ext_xkb_engine_fr.engine_id = "xkb:fr::fra";
ext_xkb_engine_fr.display_name = "xkb:fr::fra";
@@ -377,7 +391,7 @@ TEST_F(InputMethodManagerImplTest, TestObserver) {
menu_manager_->AddObserver(&observer);
EXPECT_EQ(0, observer.input_method_changed_count_);
manager_->GetActiveIMEState()->EnableLoginLayouts("en-US", keyboard_layouts);
- EXPECT_EQ(6U, manager_->GetActiveIMEState()->GetActiveInputMethods()->size());
+ EXPECT_EQ(8U, manager_->GetActiveIMEState()->GetActiveInputMethods()->size());
EXPECT_EQ(1, observer.input_method_changed_count_);
// Menu change is triggered only if current input method was actually changed.
EXPECT_EQ(0, observer.input_method_menu_item_changed_count_);
@@ -425,13 +439,13 @@ TEST_F(InputMethodManagerImplTest, TestGetSupportedInputMethods) {
}
TEST_F(InputMethodManagerImplTest, TestEnableLayouts) {
- // Currently 6 keyboard layouts are supported for en-US, and 1 for ja. See
+ // Currently 8 keyboard layouts are supported for en-US, and 1 for ja. See
// ibus_input_method.txt.
std::vector<std::string> keyboard_layouts;
InitComponentExtension();
manager_->GetActiveIMEState()->EnableLoginLayouts("en-US", keyboard_layouts);
- EXPECT_EQ(6U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
+ EXPECT_EQ(8U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
// For http://crbug.com/19655#c11 - (5)
// The hardware keyboard layout "xkb:us::eng" is always active, hence 2U.
@@ -461,8 +475,8 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutsNonUsHardwareKeyboard) {
"en-US",
manager_->GetInputMethodUtil()->GetHardwareLoginInputMethodIds());
EXPECT_EQ(
- 7U,
- manager_->GetActiveIMEState()->GetNumActiveInputMethods()); // 6 + French
+ 9U,
+ manager_->GetActiveIMEState()->GetNumActiveInputMethods()); // 8 + French
// The physical layout is Japanese.
manager_->GetInputMethodUtil()->SetHardwareKeyboardLayoutForTesting(
"xkb:jp::jpn");
@@ -490,8 +504,8 @@ TEST_F(InputMethodManagerImplTest, TestEnableMultipleHardwareKeyboardLayout) {
manager_->GetActiveIMEState()->EnableLoginLayouts(
"en-US",
manager_->GetInputMethodUtil()->GetHardwareLoginInputMethodIds());
- // 6 + French + Hungarian
- EXPECT_EQ(8U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
+ // 8 + French + Hungarian
+ EXPECT_EQ(10U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
}
TEST_F(InputMethodManagerImplTest,
@@ -902,7 +916,7 @@ TEST_F(InputMethodManagerImplTest, TestNextInputMethod) {
keyboard_layouts.push_back(ImeIdFromEngineId("xkb:us::eng"));
// For http://crbug.com/19655#c11 - (1)
manager_->GetActiveIMEState()->EnableLoginLayouts("en-US", keyboard_layouts);
- EXPECT_EQ(6U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
+ EXPECT_EQ(8U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
EXPECT_EQ(ImeIdFromEngineId("xkb:us::eng"),
manager_->GetActiveIMEState()->GetCurrentInputMethod().id());
EXPECT_EQ("us", keyboard_->last_layout_);
@@ -933,6 +947,16 @@ TEST_F(InputMethodManagerImplTest, TestNextInputMethod) {
EXPECT_EQ("us(colemak)", keyboard_->last_layout_);
manager_->GetActiveIMEState()->SwitchToNextInputMethod();
EXPECT_TRUE(observer.last_show_message_);
+ EXPECT_EQ(ImeIdFromEngineId("xkb:us:workman:eng"),
+ manager_->GetActiveIMEState()->GetCurrentInputMethod().id());
+ EXPECT_EQ("us(workman)", keyboard_->last_layout_);
+ manager_->GetActiveIMEState()->SwitchToNextInputMethod();
+ EXPECT_TRUE(observer.last_show_message_);
+ EXPECT_EQ(ImeIdFromEngineId("xkb:us:workman-intl:eng"),
+ manager_->GetActiveIMEState()->GetCurrentInputMethod().id());
+ EXPECT_EQ("us(workman-intl)", keyboard_->last_layout_);
+ manager_->GetActiveIMEState()->SwitchToNextInputMethod();
+ EXPECT_TRUE(observer.last_show_message_);
EXPECT_EQ(ImeIdFromEngineId("xkb:us::eng"),
manager_->GetActiveIMEState()->GetCurrentInputMethod().id());
EXPECT_EQ("us", keyboard_->last_layout_);
@@ -948,7 +972,7 @@ TEST_F(InputMethodManagerImplTest, TestPreviousInputMethod) {
std::vector<std::string> keyboard_layouts;
keyboard_layouts.push_back(ImeIdFromEngineId("xkb:us::eng"));
manager_->GetActiveIMEState()->EnableLoginLayouts("en-US", keyboard_layouts);
- EXPECT_EQ(6U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
+ EXPECT_EQ(8U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
EXPECT_TRUE(manager_->GetActiveIMEState()->CanCycleInputMethod());
EXPECT_EQ(ImeIdFromEngineId("xkb:us::eng"),
manager_->GetActiveIMEState()->GetCurrentInputMethod().id());
@@ -1020,7 +1044,7 @@ TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithUsLayouts) {
std::vector<std::string> keyboard_layouts;
keyboard_layouts.push_back(ImeIdFromEngineId("xkb:us::eng"));
manager_->GetActiveIMEState()->EnableLoginLayouts("en-US", keyboard_layouts);
- EXPECT_EQ(6U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
+ EXPECT_EQ(8U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
// Henkan, Muhenkan, ZenkakuHankaku should be ignored when no Japanese IMEs
// and keyboards are enabled.
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | chrome/browser/chromeos/input_method/input_method_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698