From 1b7e85967dbd55635bd538decc748bf35019ce09 Mon Sep 17 00:00:00 2001 From: shiyu-shiyu Date: Wed, 10 Sep 2025 16:05:08 +0800 Subject: [PATCH] Tdd Signed-off-by: shiyu-shiyu --- test/unittest/cpp_test/src/ime_mirror_test.cpp | 2 ++ test/unittest/napi_test/src/InputMethodTest.js | 1 + 2 files changed, 3 insertions(+) diff --git a/test/unittest/cpp_test/src/ime_mirror_test.cpp b/test/unittest/cpp_test/src/ime_mirror_test.cpp index cf728bbea..6bf7488c3 100644 --- a/test/unittest/cpp_test/src/ime_mirror_test.cpp +++ b/test/unittest/cpp_test/src/ime_mirror_test.cpp @@ -35,6 +35,7 @@ using namespace testing::mt; namespace OHOS { namespace MiscServices { constexpr int32_t INVALID_UID = -1; +constexpr uint32_t ATTACH_WAIT_TIME = 20; class ImeMirrorTest : public testing::Test { public: static sptr imc_; @@ -402,6 +403,7 @@ HWTEST_F(ImeMirrorTest, multiThreadAttachRegisterTest_001, TestSize.Level1) SET_THREAD_NUM(1); auto attachTask = []() { auto ret = ImeMirrorTest::Attach(); + std::this_thread::sleep_for(std::chrono::milliseconds(ATTACH_WAIT_TIME)); EXPECT_EQ(ret, ErrorCode::NO_ERROR); ret = ImeMirrorTest::imc_->OnSelectionChange(u"1234567890", 1, 1); EXPECT_EQ(ret, ErrorCode::NO_ERROR); diff --git a/test/unittest/napi_test/src/InputMethodTest.js b/test/unittest/napi_test/src/InputMethodTest.js index 4b02cb452..b85317fc6 100644 --- a/test/unittest/napi_test/src/InputMethodTest.js +++ b/test/unittest/napi_test/src/InputMethodTest.js @@ -1444,6 +1444,7 @@ describe('InputMethodTest', function () { let currentIme = inputMethod.getCurrentInputMethod(); inputMethod.getSetting().enableInputMethod(currentIme.name, "extName", inputMethod.EnabledState.BASIC_MODE).then(() => { console.info('Succeeded in enable inputmethod.'); + wait(WAIT_DEAL_OK); expect().assertFail(); done(); }).catch((err) => { -- Gitee