!651 add LockScreen api Mock

Merge pull request !651 from qimeng/master
This commit is contained in:
openharmony_ci 2022-08-30 11:50:10 +00:00 committed by Gitee
commit fa84d3cf22
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -53,6 +53,18 @@ export function mockScreenLock() {
})
}
},
lockScreen: function (...args) {
console.warn("screenLock.lockScreen 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) => {
resolve(paramMock.paramBooleanMock);
})
}
},
on: function (...args) {
console.warn("screenLock.on interface mocked in the Previewer. How this interface works on the" +
" Previewer may be different from that on a real device.")