mirror of
https://github.com/openharmony/third_party_jsframework.git
synced 2026-07-19 14:33:33 -04:00
!150 window manager JS API mock
Merge pull request !150 from 我想送你上月球/master
This commit is contained in:
@@ -234,6 +234,18 @@ export const windowMock = {
|
||||
})
|
||||
}
|
||||
},
|
||||
setWindowType: function (...args) {
|
||||
console.warn("Window.setWindowType 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) => {
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
},
|
||||
loadContent: function (...args) {
|
||||
console.warn("Window.loadContent interface mocked in the Previewer. How this interface works on the" +
|
||||
" Previewer may be different from that on a real device.")
|
||||
@@ -423,5 +435,15 @@ export function mockWindow() {
|
||||
TYPE_CUTOUT: 1,
|
||||
TYPE_SYSTEM_GESTURE: 2
|
||||
},
|
||||
WindowType: {
|
||||
TYPE_APP: 0,
|
||||
TYPE_SYSTEM_ALERT: 1,
|
||||
TYPE_INPUT_METHOD: 2,
|
||||
TYPE_STATUS_BAR: 3,
|
||||
TYPE_PANEL: 4,
|
||||
TYPE_KEYGUARD: 5,
|
||||
TYPE_VOLUME_OVERLAY: 6,
|
||||
TYPE_NAVIGATION_BAR: 7
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user