未验证 提交 ca41e2a9 编写于 作者: O openharmony_ci 提交者: Gitee

!6890 【杂散】【输入法】【上传下载】整改错误码类型

Merge pull request !6890 from 张育帅/master
...@@ -349,7 +349,7 @@ export default function inputMethodStageJSUnit() { ...@@ -349,7 +349,7 @@ export default function inputMethodStageJSUnit() {
try { try {
if (err) { if (err) {
console.error('inputMethod_test_switchCurrentInputMethodAndSubtype_001 err: ' + JSON.stringify(err)); console.error('inputMethod_test_switchCurrentInputMethodAndSubtype_001 err: ' + JSON.stringify(err));
expect( err.code == 12800008 ).assertTrue(); expect( err.code === 12800008 ).assertTrue();
done(); done();
} }
console.info("====>inputMethod_test_switchCurrentInputMethodAndSubtype_001 data: " + JSON.stringify(data)); console.info("====>inputMethod_test_switchCurrentInputMethodAndSubtype_001 data: " + JSON.stringify(data));
...@@ -565,12 +565,12 @@ export default function inputMethodStageJSUnit() { ...@@ -565,12 +565,12 @@ export default function inputMethodStageJSUnit() {
try{ try{
let inputMethodCtrl = inputMethod.getController(); let inputMethodCtrl = inputMethod.getController();
console.info("====>inputMethod_test_stopInputSession_002 result:" + typeof inputMethodCtrl); console.info("====>inputMethod_test_stopInputSession_002 result:" + typeof inputMethodCtrl);
inputMethodCtrl.stopInputSession().then((data) => { await inputMethodCtrl.stopInputSession().then((data) => {
console.info("====>inputMethod_test_stopInputSession_002 data:" + data);
expect().assertFail(); expect().assertFail();
done(); done();
}).catch((err) => { }).catch((err) => {
console.debug("inputMethod_test_stopInputSession_002 faild: " + JSON.stringify(err)); expect(err.code).assertEqual(12800003)
expect(err.code).assertEqual('12800003')
done(); done();
}) })
}catch(error){ }catch(error){
...@@ -595,7 +595,9 @@ export default function inputMethodStageJSUnit() { ...@@ -595,7 +595,9 @@ export default function inputMethodStageJSUnit() {
try { try {
if(err){ if(err){
console.info("====>inputMethod_test_stopInputSession_001 faild: " + JSON.stringify(err)); console.info("====>inputMethod_test_stopInputSession_001 faild: " + JSON.stringify(err));
expect(err.code).assertEqual('12800003'); console.info("====>inputMethod_test_stopInputSession_001 faild: " + err.code);
console.info("====>inputMethod_test_stopInputSession_001 faild: " + typeof(err.code));
expect(err.code).assertEqual(12800003);
done(); done();
}else{ }else{
expect().assertFail(); expect().assertFail();
......
...@@ -196,7 +196,7 @@ export default function inputMethodJSUnit() { ...@@ -196,7 +196,7 @@ export default function inputMethodJSUnit() {
let inputMethodCtrl = inputMethod.getInputMethodController() let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard((err) => { inputMethodCtrl.showSoftKeyboard((err) => {
try { try {
expect(err.code).assertEqual('12800003') expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************"); console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************");
done(); done();
} catch (err) { } catch (err) {
...@@ -219,7 +219,9 @@ export default function inputMethodJSUnit() { ...@@ -219,7 +219,9 @@ export default function inputMethodJSUnit() {
done(); done();
}).catch((err) => { }).catch((err) => {
console.info('====>showSoftKeyboard promise failed : ' + JSON.stringify(err)) console.info('====>showSoftKeyboard promise failed : ' + JSON.stringify(err))
expect(err.code).assertEqual('12800003') console.info('====>showSoftKeyboard typeof(err.code): ' + typeof(err.code))
console.info('====>showSoftKeyboard typeof(err.code): ' + err.code)
expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_showSoftKeyboard_002 Test end*************"); console.info("====>************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done(); done();
}) })
...@@ -236,7 +238,7 @@ export default function inputMethodJSUnit() { ...@@ -236,7 +238,7 @@ export default function inputMethodJSUnit() {
inputMethodCtrl.hideSoftKeyboard((err) => { inputMethodCtrl.hideSoftKeyboard((err) => {
try { try {
console.info('====>hideSoftKeyboard callbacek failed : ' + JSON.stringify(err)) console.info('====>hideSoftKeyboard callbacek failed : ' + JSON.stringify(err))
expect(err.code).assertEqual('12800003') expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************"); console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
done(); done();
} catch (err) { } catch (err) {
...@@ -259,7 +261,7 @@ export default function inputMethodJSUnit() { ...@@ -259,7 +261,7 @@ export default function inputMethodJSUnit() {
done(); done();
}).catch((err) => { }).catch((err) => {
console.info('====>hideSoftKeyboard promise failed : ' + JSON.stringify(err)) console.info('====>hideSoftKeyboard promise failed : ' + JSON.stringify(err))
expect(err.code).assertEqual('12800003'); expect(err.code).assertEqual(12800003);
console.info("====>************* inputmethod_test_hideSoftKeyboard_002 Test end*************"); console.info("====>************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done(); done();
}) })
......
...@@ -265,7 +265,7 @@ export default function requestDownloadJSUnit() { ...@@ -265,7 +265,7 @@ export default function requestDownloadJSUnit() {
}) })
}catch(err){ }catch(err){
console.error("====>SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0006 second throw_error: " + err); console.error("====>SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0006 second throw_error: " + err);
expect(err.code).assertEqual('13400002') expect(err.code).assertEqual(13400002)
await downloadTask.remove() await downloadTask.remove()
done(); done();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册