From 02507f9c05f48081baa4e213691efb05c917e5c3 Mon Sep 17 00:00:00 2001 From: qianlf Date: Fri, 5 Aug 2022 15:08:57 +0800 Subject: [PATCH] add window effect api mock Signed-off-by: qianlf Change-Id: I70756f4e91e86602718c41170da5a91ebb412e2d --- .../extend/systemplugin/napi/ohos_window.js | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/runtime/main/extend/systemplugin/napi/ohos_window.js b/runtime/main/extend/systemplugin/napi/ohos_window.js index 159532a3..2b417ec0 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_window.js +++ b/runtime/main/extend/systemplugin/napi/ohos_window.js @@ -630,6 +630,26 @@ export const Window = { }) } }, + setBlur: function() { + console.warn("Window.setBlur interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + setBackdropBlur: function() { + console.warn("Window.setBackdropBlur interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + setBackdropBlurStyle: function() { + console.warn("Window.setBackdropBlurStyle interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + setShadow: function() { + console.warn("Window.setShadow interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + setCornerRadius: function() { + console.warn("Window.setCornerRadius interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, } export const windowMock = Window @@ -637,6 +657,12 @@ export const windowMock = Window export function mockWindow() { const window = { + BlurStyle: { + OFF: 0, + THIN: 1, + REGULAR: 2, + THICK: 3 + }, getTopWindow: function(...args) { console.warn("Window.getTopWindow interface mocked in the Previewer. How this interface works on the Previewer" + "may be different from that on a real device.")