提交 7495ab25 编写于 作者: 1 15829070344

【输入法】XTS-displayOptionalInputMethod时序优化

Signed-off-by: N15829070344 <hehaitao5@huawei.com>
Change-Id: I2a482c72c8afbeb60efed8348557beda451eddba
上级 1b859b2f
...@@ -38,10 +38,11 @@ export default function inputMethodEngineJSUnit() { ...@@ -38,10 +38,11 @@ export default function inputMethodEngineJSUnit() {
let result = await router.push(options); let result = await router.push(options);
await Utils.sleep(1000); await Utils.sleep(1000);
} }
done();
} catch (err) { } catch (err) {
console.error("push input page error: " + err); console.error("push input page error: " + err);
}
done(); done();
}
}); });
afterEach(async function () { afterEach(async function () {
......
...@@ -24,9 +24,9 @@ export default function inputMethodJSUnit() { ...@@ -24,9 +24,9 @@ export default function inputMethodJSUnit() {
inputMethodSetting.listInputMethod((arr) => { inputMethodSetting.listInputMethod((arr) => {
console.info("====>appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr)); console.info("====>appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr));
expect(1==1).assertTrue(); expect(1==1).assertTrue();
});
done(); done();
}); });
});
it('inputmethoh_test_002', 0, async function (done) { it('inputmethoh_test_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
...@@ -41,42 +41,60 @@ export default function inputMethodJSUnit() { ...@@ -41,42 +41,60 @@ export default function inputMethodJSUnit() {
console.info("====>inputmethoh_test_002 listInputMethod is null"); console.info("====>inputmethoh_test_002 listInputMethod is null");
expect().assertFail() expect().assertFail()
} }
done();
}).catch(err => { }).catch(err => {
console.info("====>inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err)); console.info("====>inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err));
});
done(); done();
}); });
});
it('inputmethoh_test_003', 0, async function (done) { it('inputmethoh_test_003', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("====>inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.displayOptionalInputMethod(() => { setTimeout(()=>{
try{
inputMethodSetting.displayOptionalInputMethod((err) => {
if(err){
console.info("====>inputmethoh_test_003 displayOptionalInputMethod err:" + JSON.stringify(err));
expect().assertFail();
done();
}
expect(true).assertTrue();
console.info("====>inputmethoh_test_003 displayOptionalInputMethod---"); console.info("====>inputmethoh_test_003 displayOptionalInputMethod---");
done();
}); });
}catch(err){
console.info("====>inputmethoh_test_004 displayOptionalInputMethod throw_err: " + JSON.stringify(err));
expect().assertFail()
done(); done();
}
},100)
}); });
it('inputmethoh_test_004', 0, async function (done) { it('inputmethoh_test_004', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("====>inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
setTimeout(()=>{
inputMethodSetting.displayOptionalInputMethod().then(() => { inputMethodSetting.displayOptionalInputMethod().then(() => {
console.info("====>inputmethoh_test_004 displayOptionalInputMethod is called"); console.info("====>inputmethoh_test_004 displayOptionalInputMethod is called");
expect(true).assertTrue() expect(true).assertTrue()
done();
}).catch(err => { }).catch(err => {
console.info("====>inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err)); console.info("====>inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err));
expect().assertFail() expect().assertFail()
});
done(); done();
}); });
},100)
});
it('inputmethoh_test_005', 0, async function (done) { it('inputmethoh_test_005', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController(); let inputMethodCtrl = inputMethod.getInputMethodController();
console.info("====>inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl)); console.info("====>inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput((res) => { inputMethodCtrl.stopInput((res) => {
console.info("====>inputmethoh_test_005 stopInput result----" + res); console.info("====>inputmethoh_test_005 stopInput result----" + res);
});
done(); done();
}); });
});
it('inputmethoh_test_006', 0, async function (done) { it('inputmethoh_test_006', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController(); let inputMethodCtrl = inputMethod.getInputMethodController();
...@@ -123,12 +141,14 @@ export default function inputMethodJSUnit() { ...@@ -123,12 +141,14 @@ export default function inputMethodJSUnit() {
inputMethod.switchInputMethod(inputMethodProperty).then(data => { inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("====>inputmethod_test_switchInputMethod_001 data:" + data) console.info("====>inputmethod_test_switchInputMethod_001 data:" + data)
expect(data == true).assertTrue(); expect(data == true).assertTrue();
console.info("====>************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
}).catch( err=> { }).catch( err=> {
console.info("====>inputmethod_test_switchInputMethod_001 err:" + err) console.info("====>inputmethod_test_switchInputMethod_001 err:" + err)
expect().assertFail(); expect().assertFail();
})
console.info("====>************* inputmethod_test_switchInputMethod_001 Test end*************");
done(); done();
})
}); });
/* /*
...@@ -150,14 +170,16 @@ export default function inputMethodJSUnit() { ...@@ -150,14 +170,16 @@ export default function inputMethodJSUnit() {
if(err){ if(err){
console.info("====>inputmethod_test_switchInputMethod_002 error:" + err); console.info("====>inputmethod_test_switchInputMethod_002 error:" + err);
expect().assertFail(); expect().assertFail();
done();
} }
console.info("====>inputmethod_test_switchInputMethod_002 data:" + data) console.info("====>inputmethod_test_switchInputMethod_002 data:" + data)
expect(data == true).assertTrue();
});
console.info("====>************* inputmethod_test_switchInputMethod_002 Test end*************"); console.info("====>************* inputmethod_test_switchInputMethod_002 Test end*************");
expect(data == true).assertTrue();
done(); done();
}); });
});
/* /*
* @tc.number inputmethod_test_showSoftKeyboard_001 * @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will show softboard with calback. * @tc.name Test Indicates the input method which will show softboard with calback.
...@@ -268,12 +290,14 @@ export default function inputMethodJSUnit() { ...@@ -268,12 +290,14 @@ export default function inputMethodJSUnit() {
if (err) { if (err) {
console.error("inputmethod_test_getInputMethods_001 failed because: " + JSON.stringify(err)); console.error("inputmethod_test_getInputMethods_001 failed because: " + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
done();
}; };
console.info("====>inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr)); console.info("====>inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue(); expect(arr != null).assertTrue();
}); console.info("====>************* inputmethod_test_getInputMethods_001 Test end*************");
done(); done();
}); });
});
/* /*
* @tc.number inputmethod_test_getInputMethods_002 * @tc.number inputmethod_test_getInputMethods_002
...@@ -292,10 +316,8 @@ export default function inputMethodJSUnit() { ...@@ -292,10 +316,8 @@ export default function inputMethodJSUnit() {
}; };
console.info("====>inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr)); console.info("====>inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue(); expect(arr != null).assertTrue();
});
done(); done();
}); });
});
}); });
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册