mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2024-11-30 18:31:01 +00:00
Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>
Changes to be committed:
This commit is contained in:
parent
414c87b1e0
commit
4cf8cc0584
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user