Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>

Changes to be committed:
This commit is contained in:
ma-shaoyin 2022-09-07 17:08:40 +08:00
parent 414c87b1e0
commit 4cf8cc0584

View File

@ -205,6 +205,28 @@ namespace MiscServices {
setting.SetCurrentKeyboardType(curType);
EXPECT_EQ(setting.GetCurrentKeyboardType(), curType);
}
/**
* @tc.name: testIMCdispatchKeyEvent
* @tc.desc: IMC testdispatchKeyEvent.
* @tc.type: FUNC
* @tc.require:
*/
HWTEST_F(InputMethodControllerTest, testIMCdispatchKeyEvent, TestSize.Level0)
{
IMSA_HILOGI("IMC dispatchKeyEvent Test START");
sptr<InputMethodController> imc = InputMethodController::GetInstance();
EXPECT_TRUE(imc != nullptr);
std::shared_ptr<MMI::KeyEvent> keyEvent = MMI::KeyEvent::Create();
EXPECT_TRUE(keyEvent != nullptr);
keyEvent->SetKeyAction(2);
keyEvent->SetKeyCode(2013);
bool ret = imc->dispatchKeyEvent(keyEvent);
EXPECT_TRUE(ret == true);
}
/**
* @tc.name: testInputMethodWholeProcess
@ -432,28 +454,6 @@ namespace MiscServices {
EXPECT_TRUE(ret == 0);
}
/**
* @tc.name: testIMCdispatchKeyEvent
* @tc.desc: IMC testdispatchKeyEvent.
* @tc.type: FUNC
* @tc.require:
*/
HWTEST_F(InputMethodControllerTest, testIMCdispatchKeyEvent, TestSize.Level0)
{
IMSA_HILOGI("IMC dispatchKeyEvent Test START");
sptr<InputMethodController> imc = InputMethodController::GetInstance();
EXPECT_TRUE(imc != nullptr);
std::shared_ptr<MMI::KeyEvent> keyEvent = MMI::KeyEvent::Create();
EXPECT_TRUE(keyEvent != nullptr);
keyEvent->SetKeyAction(2);
keyEvent->SetKeyCode(2013);
bool ret = imc->dispatchKeyEvent(keyEvent);
EXPECT_TRUE(ret == true);
}
/**
* @tc.name: testIMCOnCursorUpdate
* @tc.desc: IMC testOnCursorUpdate