Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>

Changes to be committed:
This commit is contained in:
ma-shaoyin 2022-08-15 15:47:59 +08:00
parent 68e9747e57
commit ba32d02755

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, paramMock.paramBooleanMock);
} else {
return new Promise((resolve, reject) => {
resolve(paramMock.paramBooleanMock);
})
}
},
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, paramMock.paramBooleanMock);
} else {
return new Promise((resolve, reject) => {
resolve(paramMock.paramBooleanMock);
})
}
}
}
const InputMethodSettingMock = {