mirror of
https://gitee.com/openharmony/third_party_jsframework
synced 2024-11-23 06:40:59 +00:00
!651 add LockScreen api Mock
Merge pull request !651 from qimeng/master
This commit is contained in:
commit
fa84d3cf22
@ -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.")
|
||||
|
Loading…
Reference in New Issue
Block a user