!638 Mock输入法框架新增显示隐藏键盘接口

Merge pull request !638 from mashaoyin/master
This commit is contained in:
openharmony_ci 2022-08-16 04:12:38 +00:00 committed by Gitee
commit e8bac1d334
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -66,6 +66,30 @@ export function mockInputMethod() {
resolve(paramMock.paramBooleanMock);
})
}
},
showSoftKeyboard: function (...args) {
console.warn("InputMethodController.showSoftKeyboard interface mocked in the Previewer. How this interface works on" +
" the Previewer may be different from that on a real device.")
const len = args.length
if (typeof args[len - 1] === 'function') {
args[len - 1].call(this, paramMock.businessErrorMock);
} else {
return new Promise((resolve, reject) => {
resolve();
})
}
},
hideSoftKeyboard: function (...args) {
console.warn("InputMethodController.hideSoftKeyboard interface mocked in the Previewer. How this interface works on" +
" the Previewer may be different from that on a real device.")
const len = args.length
if (typeof args[len - 1] === 'function') {
args[len - 1].call(this, paramMock.businessErrorMock);
} else {
return new Promise((resolve, reject) => {
resolve();
})
}
}
}
const InputMethodSettingMock = {