• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #include <gtest/gtest.h>
16 #include <sys/time.h>
17 #include <unistd.h>
18 
19 #include <condition_variable>
20 #include <string>
21 #include <vector>
22 
23 #include "global.h"
24 #include "ime_info_inquirer.h"
25 #include "input_method_controller.h"
26 #include "input_method_property.h"
27 #include "tdd_util.h"
28 
29 using namespace testing::ext;
30 namespace OHOS {
31 namespace MiscServices {
32 class InputMethodSwitchTest : public testing::Test {
33 public:
34     static void SetUpTestCase(void);
35     static void TearDownTestCase(void);
36     void SetUp();
37     void TearDown();
38     static void CheckCurrentProp(const std::string &extName);
39     static void CheckCurrentSubProp(const std::string &extName);
40     static void CheckCurrentSubProps();
41     static bool WaitImeChangeCallback(bool isChanged);
42     static sptr<InputMethodController> imc_;
43     static bool imeChangeFlag;
44     static std::mutex imeChangeCallbackLock_;
45     static std::condition_variable imeChangeCv_;
46     static std::string newImeBundleName;
47     static std::vector<std::string> newImeSubName;
48     static std::string bundleName;
49     static std::vector<std::string> extName;
50     static std::vector<std::string> language;
51     static std::vector<std::string> locale;
52     static bool enableOn;
53     static std::string beforeValue;
54     static std::string allEnableIme;
55 };
56 bool InputMethodSwitchTest::imeChangeFlag = false;
57 std::mutex InputMethodSwitchTest::imeChangeCallbackLock_;
58 std::condition_variable InputMethodSwitchTest::imeChangeCv_;
59 sptr<InputMethodController> InputMethodSwitchTest::imc_;
60 std::string InputMethodSwitchTest::newImeBundleName = "com.example.newTestIme";
61 std::vector<std::string> InputMethodSwitchTest::newImeSubName{ "lowerInput", "upperInput", "chineseInput" };
62 std::string InputMethodSwitchTest::bundleName = "com.example.testIme";
63 std::vector<std::string> InputMethodSwitchTest::extName{ "InputMethodExtAbility", "InputMethodExtAbility2" };
64 std::vector<std::string> InputMethodSwitchTest::language{ "chinese", "english" };
65 std::vector<std::string> InputMethodSwitchTest::locale{ "zh-CN", "en-US" };
66 bool InputMethodSwitchTest::enableOn = false;
67 std::string InputMethodSwitchTest::beforeValue;
68 std::string InputMethodSwitchTest::allEnableIme = "{\"enableImeList\" : {\"100\" : [ \"com.example.newTestIme\", "
69                                                   "\"com.example.testIme\"]}}";
70 constexpr uint32_t IME_EXT_NUM = 2;
71 constexpr uint32_t NEW_IME_SUBTYPE_NUM = 3;
72 constexpr uint32_t TOTAL_IME_MIN_NUM = 2;
73 constexpr uint32_t ENABLE_IME_NUM = 1;
74 constexpr uint32_t WAIT_IME_READY_TIME = 1;
75 constexpr uint32_t WAIT_SWITCH_READY_TIME = 2;
76 constexpr const char *ENABLE_IME_KEYWORD = "settings.inputmethod.enable_ime";
77 class InputMethodSettingListenerImpl : public InputMethodSettingListener {
78 public:
79     InputMethodSettingListenerImpl() = default;
80     ~InputMethodSettingListenerImpl() = default;
OnImeChange(const Property & property,const SubProperty & subProperty)81     void OnImeChange(const Property &property, const SubProperty &subProperty)
82     {
83         InputMethodSwitchTest::imeChangeFlag = true;
84         InputMethodSwitchTest::imeChangeCv_.notify_one();
85         IMSA_HILOGI("InputMethodSettingListenerImpl OnImeChange");
86     }
OnPanelStatusChange(const InputWindowStatus & status,const std::vector<InputWindowInfo> & windowInfo)87     void OnPanelStatusChange(const InputWindowStatus &status, const std::vector<InputWindowInfo> &windowInfo)
88     {
89     }
90 };
91 
SetUpTestCase(void)92 void InputMethodSwitchTest::SetUpTestCase(void)
93 {
94     IMSA_HILOGI("InputMethodSwitchTest::SetUpTestCase");
95     ImeInfoInquirer::GetInstance().InitConfig();
96     enableOn = ImeInfoInquirer::GetInstance().IsEnableInputMethod();
97     TddUtil::GrantNativePermission();
98     if (enableOn == true) {
99         IMSA_HILOGI("Enable ime switch test.");
100         int32_t ret = TddUtil::GetEnableData(beforeValue);
101         if (ret == ErrorCode::NO_ERROR) {
102             TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, allEnableIme);
103         }
104     }
105     TddUtil::StorageSelfTokenID();
106     TddUtil::SetTestTokenID(
107         TddUtil::AllocTestTokenID(true, "ohos.inputMethod.test", { "ohos.permission.CONNECT_IME_ABILITY" }));
108     imc_ = InputMethodController::GetInstance();
109     imc_->SetSettingListener(std::make_shared<InputMethodSettingListenerImpl>());
110     imc_->UpdateListenEventFlag("imeChange", true);
111 }
112 
TearDownTestCase(void)113 void InputMethodSwitchTest::TearDownTestCase(void)
114 {
115     IMSA_HILOGI("InputMethodSwitchTest::TearDownTestCase");
116     if (enableOn) {
117         TddUtil::GrantNativePermission();
118         TddUtil::PushEnableImeValue(ENABLE_IME_KEYWORD, beforeValue);
119     }
120     InputMethodController::GetInstance()->Close();
121     TddUtil::RestoreSelfTokenID();
122 }
123 
SetUp(void)124 void InputMethodSwitchTest::SetUp(void)
125 {
126     IMSA_HILOGI("InputMethodSwitchTest::SetUp");
127 }
128 
TearDown(void)129 void InputMethodSwitchTest::TearDown(void)
130 {
131     IMSA_HILOGI("InputMethodSwitchTest::TearDown");
132 }
133 
CheckCurrentProp(const std::string & extName)134 void InputMethodSwitchTest::CheckCurrentProp(const std::string &extName)
135 {
136     std::shared_ptr<Property> property = imc_->GetCurrentInputMethod();
137     ASSERT_TRUE(property != nullptr);
138     EXPECT_EQ(property->name, bundleName);
139     EXPECT_EQ(property->id, extName);
140 }
141 
CheckCurrentSubProp(const std::string & extName)142 void InputMethodSwitchTest::CheckCurrentSubProp(const std::string &extName)
143 {
144     auto subProperty = imc_->GetCurrentInputMethodSubtype();
145     ASSERT_TRUE(subProperty != nullptr);
146     EXPECT_EQ(subProperty->id, extName);
147     EXPECT_EQ(subProperty->name, bundleName);
148 }
149 
CheckCurrentSubProps()150 void InputMethodSwitchTest::CheckCurrentSubProps()
151 {
152     std::vector<SubProperty> subProps;
153     auto ret = imc_->ListCurrentInputMethodSubtype(subProps);
154     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
155     ASSERT_EQ(subProps.size(), IME_EXT_NUM);
156     for (uint32_t i = 0; i < IME_EXT_NUM; i++) {
157         EXPECT_EQ(subProps[i].id, extName[i]);
158         EXPECT_EQ(subProps[i].name, bundleName);
159         EXPECT_EQ(subProps[i].language, language[i]);
160         EXPECT_EQ(subProps[i].locale, locale[i]);
161     }
162 }
163 
WaitImeChangeCallback(bool isChanged)164 bool InputMethodSwitchTest::WaitImeChangeCallback(bool isChanged)
165 {
166     std::unique_lock<std::mutex> lock(imeChangeCallbackLock_);
167     imeChangeCv_.wait_for(lock, std::chrono::seconds(WAIT_SWITCH_READY_TIME),
168         [isChanged]() { return isChanged == imeChangeFlag; });
169     return isChanged == imeChangeFlag;
170 }
171 
172 /**
173 * @tc.name: testImeSwitch
174 * @tc.desc: switch to testIme
175 * @tc.type: FUNC
176 * @tc.require: issuesI62BHB
177 * @tc.author: chenyu
178 */
179 HWTEST_F(InputMethodSwitchTest, testImeSwitch, TestSize.Level0)
180 {
181     IMSA_HILOGI("oldIme testImeSwitch Test START");
182     imeChangeFlag = false;
183     // switch to ext testIme
184     auto ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, bundleName);
185     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
186     EXPECT_TRUE(imeChangeFlag);
187     CheckCurrentProp(extName[0]);
188     CheckCurrentSubProp(extName[0]);
189     CheckCurrentSubProps();
190     sleep(WAIT_IME_READY_TIME);
191 }
192 
193 /**
194 * @tc.name: testSubTypeSwitch_001
195 * @tc.desc: switch subtype with extName1
196 * @tc.type: FUNC
197 * @tc.require: issuesI62BHB
198 * @tc.author: chenyu
199 */
200 HWTEST_F(InputMethodSwitchTest, testSubTypeSwitch_001, TestSize.Level0)
201 {
202     IMSA_HILOGI("oldIme testSubTypeSwitch_001 Test START");
203     imeChangeFlag = false;
204     int32_t ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, bundleName, extName[0]);
205     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
206     EXPECT_FALSE(imeChangeFlag);
207     CheckCurrentProp(extName[0]);
208     CheckCurrentSubProp(extName[0]);
209     CheckCurrentSubProps();
210 }
211 
212 /**
213 * @tc.name: testSubTypeSwitch_002
214 * @tc.desc: switch subtype with extName2
215 * @tc.type: FUNC
216 * @tc.require: issuesI62BHB
217 * @tc.author: chenyu
218 */
219 HWTEST_F(InputMethodSwitchTest, testSubTypeSwitch_002, TestSize.Level0)
220 {
221     IMSA_HILOGI("oldIme testSubTypeSwitch_002 Test START");
222     imeChangeFlag = false;
223     int32_t ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, bundleName, extName[1]);
224     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
225     EXPECT_TRUE(imeChangeFlag);
226     CheckCurrentProp(extName[0]);
227     CheckCurrentSubProp(extName[1]);
228     CheckCurrentSubProps();
229 }
230 
231 /**
232 * @tc.name: testSubTypeSwitch_003
233 * @tc.desc: switch subtype with extName1
234 * @tc.type: FUNC
235 * @tc.require: issuesI62BHB
236 * @tc.author: chenyu
237 */
238 HWTEST_F(InputMethodSwitchTest, testSubTypeSwitch_003, TestSize.Level0)
239 {
240     IMSA_HILOGI("oldIme testSubTypeSwitch_003 Test START");
241     imeChangeFlag = false;
242     int32_t ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, bundleName, extName[0]);
243     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
244     EXPECT_TRUE(imeChangeFlag);
245     CheckCurrentProp(extName[0]);
246     CheckCurrentSubProp(extName[0]);
247     CheckCurrentSubProps();
248 }
249 
250 /**
251 * @tc.name: testSubTypeSwitchWithErrorSubName
252 * @tc.desc: switch subtype with error subName.
253 * @tc.type: FUNC
254 * @tc.require: issuesI62BHB
255 * @tc.author: chenyu
256 */
257 HWTEST_F(InputMethodSwitchTest, testSubTypeSwitchWithErrorSubName, TestSize.Level0)
258 {
259     IMSA_HILOGI("oldIme testSubTypeSwitchWithErrorSubName Test START");
260     std::string subName = InputMethodSwitchTest::imc_->GetCurrentInputMethodSubtype()->id;
261     int32_t ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, bundleName, "error subName");
262     EXPECT_EQ(ret, ErrorCode::ERROR_BAD_PARAMETERS);
263     CheckCurrentProp(subName);
264     CheckCurrentSubProp(subName);
265     CheckCurrentSubProps();
266 }
267 
268 /**
269 * @tc.name: testSwitchToCurrentImeWithEmptySubName
270 * @tc.desc: switch to currentIme witch empty subName.
271 * @tc.type: FUNC
272 * @tc.require: issuesI62BHB
273 * @tc.author: chenyu
274 */
275 HWTEST_F(InputMethodSwitchTest, testSwitchToCurrentImeWithEmptySubName, TestSize.Level0)
276 {
277     IMSA_HILOGI("oldIme testSwitchToCurrentImeWithEmptySubName Test START");
278     imeChangeFlag = false;
279     std::string subName = InputMethodSwitchTest::imc_->GetCurrentInputMethodSubtype()->id;
280     int32_t ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, bundleName);
281     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
282     EXPECT_FALSE(imeChangeFlag);
283     CheckCurrentProp(subName);
284     CheckCurrentSubProp(subName);
285     CheckCurrentSubProps();
286 }
287 
288 /**
289 * @tc.name: testSwitchImeWithErrorBundleName
290 * @tc.desc: switch ime witch error bundleName
291 * @tc.type: FUNC
292 * @tc.require: issuesI62BHB
293 * @tc.author: chenyu
294 */
295 HWTEST_F(InputMethodSwitchTest, testSwitchImeWithErrorBundleName, TestSize.Level0)
296 {
297     IMSA_HILOGI("oldIme testSwitchImeWithErrorBundleName Test START");
298     std::string subName = InputMethodSwitchTest::imc_->GetCurrentInputMethodSubtype()->id;
299     int32_t ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, "error bundleName", extName[0]);
300     if (InputMethodSwitchTest::enableOn) {
301         EXPECT_EQ(ret, ErrorCode::ERROR_ENABLE_IME);
302     } else {
303         EXPECT_EQ(ret, ErrorCode::ERROR_BAD_PARAMETERS);
304     }
305     CheckCurrentProp(subName);
306     CheckCurrentSubProp(subName);
307     CheckCurrentSubProps();
308 }
309 
310 /**
311 * @tc.name: testSwitchImeWithErrorBundleNameWitchEmptySubName
312 * @tc.desc: switch ime witch error bundleName and empty subName
313 * @tc.type: FUNC
314 * @tc.require: issuesI62BHB
315 * @tc.author: chenyu
316 */
317 HWTEST_F(InputMethodSwitchTest, testSwitchImeWithErrorBundleNameWitchEmptySubName, TestSize.Level0)
318 {
319     IMSA_HILOGI("oldIme testSwitchImeWithErrorBundleNameWitchEmptySubName Test START");
320     std::string subName = InputMethodSwitchTest::imc_->GetCurrentInputMethodSubtype()->id;
321     int32_t ret = imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, "error bundleName", " ");
322     if (InputMethodSwitchTest::enableOn) {
323         EXPECT_EQ(ret, ErrorCode::ERROR_ENABLE_IME);
324     } else {
325         EXPECT_EQ(ret, ErrorCode::ERROR_BAD_PARAMETERS);
326     }
327     CheckCurrentProp(subName);
328     CheckCurrentSubProp(subName);
329     CheckCurrentSubProps();
330 }
331 
332 /**
333 * @tc.name: testIMCListInputMethod
334 * @tc.desc: IMC ListInputMethod
335 * @tc.type: FUNC
336 * @tc.require: issuesI62BHB
337 * @tc.author: chenyu
338 */
339 HWTEST_F(InputMethodSwitchTest, testIMCListInputMethod, TestSize.Level0)
340 {
341     IMSA_HILOGI("IMC testIMCListInputMethod Test Start");
342     std::vector<Property> properties = {};
343     auto ret = imc_->ListInputMethod(properties);
344     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
345     EXPECT_TRUE(properties.size() >= TOTAL_IME_MIN_NUM);
346     bool hasIme = false;
347     bool hasNewIme = false;
348     for (const auto &property : properties) {
349         if (property.name == bundleName) {
350             hasIme = true;
351         }
352         if (property.name == newImeBundleName) {
353             hasNewIme = true;
354         }
355     }
356     EXPECT_TRUE(hasIme && hasNewIme);
357 }
358 
359 /**
360 * @tc.name: testIMCListInputMethodDisable
361 * @tc.desc: IMC ListInputMethod
362 * @tc.type: FUNC
363 * @tc.require: issuesI62BHB
364 * @tc.author: chenyu
365 */
366 HWTEST_F(InputMethodSwitchTest, testIMCListInputMethodDisable, TestSize.Level0)
367 {
368     IMSA_HILOGI("IMC testIMCListInputMethodDisable Test Start");
369     std::vector<Property> disableProperties = {};
370     auto ret = imc_->ListInputMethod(false, disableProperties);
371     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
372     EXPECT_GE(disableProperties.size(), 0);
373 }
374 
375 /**
376 * @tc.name: testIMCListInputMethodEnable
377 * @tc.desc: IMC ListInputMethod
378 * @tc.type: FUNC
379 * @tc.require: issuesI62BHB
380 * @tc.author: chenyu
381 */
382 HWTEST_F(InputMethodSwitchTest, testIMCListInputMethodEnable, TestSize.Level0)
383 {
384     IMSA_HILOGI("IMC testIMCListInputMethodEnable Test Start");
385     std::string subName = InputMethodSwitchTest::imc_->GetCurrentInputMethodSubtype()->id;
386     std::vector<Property> enableProperties = {};
387     auto ret = imc_->ListInputMethod(true, enableProperties);
388     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
389     EXPECT_GE(enableProperties.size(), ENABLE_IME_NUM);
390 }
391 
392 /**
393 * @tc.name: tesIMCtListInputMethodSubtype_001
394 * @tc.desc: ListInputMethodSubtype
395 * @tc.type: FUNC
396 * @tc.require: issuesI62BHB
397 * @tc.author: chenyu
398 */
399 HWTEST_F(InputMethodSwitchTest, tesIMCtListInputMethodSubtype_001, TestSize.Level0)
400 {
401     IMSA_HILOGI("IMC tesIMCtListInputMethodSubtype_001 Test Start");
402     Property property = { .name = newImeBundleName };
403     std::vector<SubProperty> subProps;
404     auto ret = imc_->ListInputMethodSubtype(property, subProps);
405     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
406     ASSERT_EQ(subProps.size(), NEW_IME_SUBTYPE_NUM);
407     for (uint32_t i = 0; i < NEW_IME_SUBTYPE_NUM; i++) {
408         EXPECT_EQ(subProps[i].id, newImeSubName[i]);
409         EXPECT_EQ(subProps[i].name, newImeBundleName);
410     }
411 }
412 
413 /**
414 * @tc.name: tesIMCtListInputMethodSubtype_002
415 * @tc.desc: ListInputMethodSubtype
416 * @tc.type: FUNC
417 * @tc.require: issuesI62BHB
418 * @tc.author: chenyu
419 */
420 HWTEST_F(InputMethodSwitchTest, tesIMCtListInputMethodSubtype_002, TestSize.Level0)
421 {
422     IMSA_HILOGI("IMC tesIMCtListInputMethodSubtype_002 Test Start");
423     Property property = { .name = bundleName };
424     std::vector<SubProperty> subProps;
425     auto ret = imc_->ListInputMethodSubtype(property, subProps);
426     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
427     ASSERT_EQ(subProps.size(), IME_EXT_NUM);
428     for (uint32_t i = 0; i < IME_EXT_NUM; i++) {
429         EXPECT_EQ(subProps[i].id, extName[i]);
430         EXPECT_EQ(subProps[i].name, bundleName);
431     }
432 }
433 
434 /**
435  * @tc.name: testIMCListInputMethodSubtypeWithErrorBundleName
436  * @tc.desc: IMC ListInputMethodSubtype
437  * @tc.type: FUNC
438  * @tc.require: issuesI62BHB
439 * @tc.author: chenyu
440  */
441 HWTEST_F(InputMethodSwitchTest, testIMCListInputMethodSubtypeWithErrorBundleName, TestSize.Level0)
442 {
443     IMSA_HILOGI("IMC testIMCListInputMethodSubtypeWitchErrorBundleName Test START");
444     std::shared_ptr<Property> property = std::make_shared<Property>();
445     std::vector<SubProperty> properties = {};
446     auto ret = imc_->ListInputMethodSubtype(*property, properties);
447     EXPECT_EQ(ret, ErrorCode::ERROR_BAD_PARAMETERS);
448     EXPECT_TRUE(properties.empty());
449 }
450 
451 /**
452 * @tc.name: testShowOptionalInputMethod
453 * @tc.desc: IMC ShowOptionalInputMethod
454 * @tc.type: FUNC
455 */
456 HWTEST_F(InputMethodSwitchTest, testShowOptionalInputMethod, TestSize.Level2)
457 {
458     IMSA_HILOGI("IMC ShowOptionalInputMethod Test START");
459     int32_t ret = imc_->ShowOptionalInputMethod();
460     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
461 }
462 
463 /**
464 * @tc.name: testDisplayOptionalInputMethod
465 * @tc.desc: IMC DisplayOptionalInputMethod
466 * @tc.type: FUNC
467 */
468 HWTEST_F(InputMethodSwitchTest, testDisplayOptionalInputMethod, TestSize.Level2)
469 {
470     IMSA_HILOGI("IMC DisplayOptionalInputMethod Test START");
471     sleep(2);
472     int32_t ret = imc_->DisplayOptionalInputMethod();
473     EXPECT_EQ(ret, ErrorCode::NO_ERROR);
474 }
475 
476 /**
477 * @tc.name: testCombinationKeySwitchIme_001
478 * @tc.desc: switch ime by combination key.
479 * @tc.type: FUNC
480 * @tc.require: issuesI8RPP3
481 * @tc.author: mashaoyin
482 */
483 HWTEST_F(InputMethodSwitchTest, testCombinationKeySwitchIme_001, TestSize.Level0)
484 {
485     IMSA_HILOGI("testCombinationKeySwitchIme_001 Test START");
486     std::shared_ptr<Property> property = imc_->GetCurrentInputMethod();
487     imeChangeFlag = false;
488     std::string result;
489     static std::string cmd = "uinput -K -d 2076 -d 2050";
490     auto ret = TddUtil::ExecuteCmd(cmd, result);
491     EXPECT_TRUE(ret);
492     EXPECT_TRUE(InputMethodSwitchTest::WaitImeChangeCallback(true));
493     imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, property->name, "");
494 }
495 
496 /**
497 * @tc.name: testCombinationKeySwitchIme_002
498 * @tc.desc: switch ime by combination key.
499 * @tc.type: FUNC
500 * @tc.require: issuesI8RPP3
501 * @tc.author: mashaoyin
502 */
503 HWTEST_F(InputMethodSwitchTest, testCombinationKeySwitchIme_002, TestSize.Level0)
504 {
505     IMSA_HILOGI("testCombinationKeySwitchIme_002 Test START");
506     std::shared_ptr<Property> property = imc_->GetCurrentInputMethod();
507     imeChangeFlag = false;
508     std::string result;
509     static std::string cmd = "uinput -K -d 2077 -d 2050";
510     auto ret = TddUtil::ExecuteCmd(cmd, result);
511     EXPECT_TRUE(ret);
512     EXPECT_TRUE(InputMethodSwitchTest::WaitImeChangeCallback(true));
513     imc_->SwitchInputMethod(SwitchTrigger::CURRENT_IME, property->name, "");
514 }
515 } // namespace MiscServices
516 } // namespace OHOS
517