From 10e8cebef9fa647a3d7aba0d4402d61e1b8357b5 Mon Sep 17 00:00:00 2001 From: lovechinamo Date: Tue, 19 Jul 2022 17:16:31 +0800 Subject: [PATCH] Signed-off-by: lovechinamo Changes to be committed: --- .../main/extend/systemplugin/napi/ohos_wallpaper.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js b/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js index 3a8e0a14..c6e1304b 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js +++ b/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js @@ -48,6 +48,18 @@ export function mockWallpaper() { }) } }, + getFile: function (...args) { + console.warn("wallpaper.getFile 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.paramNumberMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramNumberMock); + }) + } + }, getMinHeight: function (...args) { console.warn("wallpaper.getMinHeight interface mocked in the Previewer. How this interface works on the" + " Previewer may be different from that on a real device.")