From de58e4617388b421d585bab883bbdd570e20779f Mon Sep 17 00:00:00 2001 From: binny1024 Date: Wed, 27 Jul 2022 11:25:26 +0800 Subject: [PATCH] add mock about ohos_display.js and ohos_window.js Signed-off-by: zhouyaoying Change-Id: I8ca60ef96cc33ffc3b7f93691478f333821cee76 --- runtime/main/extend/systemplugin/napi/ohos_display.js | 5 +++++ runtime/main/extend/systemplugin/napi/ohos_window.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/runtime/main/extend/systemplugin/napi/ohos_display.js b/runtime/main/extend/systemplugin/napi/ohos_display.js index cd7c5f84..a4673244 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_display.js +++ b/runtime/main/extend/systemplugin/napi/ohos_display.js @@ -78,6 +78,11 @@ export function mockDisplay() { }) } }, + hasPrivateWindow: function (...args) { + console.warn("Display.hasPrivateWindow interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + return paramMock.paramBooleanMock + }, on: function (...args) { console.warn("Display.on interface mocked in the Previewer. How this interface works on the Previewer may be" + " different from that on a real device.") diff --git a/runtime/main/extend/systemplugin/napi/ohos_window.js b/runtime/main/extend/systemplugin/napi/ohos_window.js index 58327ee4..260658c3 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_window.js +++ b/runtime/main/extend/systemplugin/napi/ohos_window.js @@ -346,6 +346,10 @@ export const Window = { }) } }, + setSnapshotSkip: function(...args) { + console.warn("Window.setSnapshotSkip interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, setSystemBarEnable: function(...args) { console.warn("Window.setSystemBarEnable interface mocked in the Previewer. How this interface works on the" + " Previewer may be different from that on a real device.")