From a7ed645743f342c047aca59dcc15fb70e17a10f3 Mon Sep 17 00:00:00 2001 From: xiaojianfeng Date: Fri, 6 May 2022 20:24:24 +0800 Subject: [PATCH] add ToggleShownStateForAllAppWindow interface mock Signed-off-by: xiaojianfeng Change-Id: Ifd4ee7b3f68d3014e539c272019cdc59f187a58a --- runtime/main/extend/systemplugin/window.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runtime/main/extend/systemplugin/window.js b/runtime/main/extend/systemplugin/window.js index fb8ebedc..7a9446f1 100644 --- a/runtime/main/extend/systemplugin/window.js +++ b/runtime/main/extend/systemplugin/window.js @@ -466,6 +466,18 @@ export function mockWindow() { }) } }, + ToggleShownStateForAllAppWindows: function (...args) { + console.warn("window.ToggleShownStateForAllAppWindows 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, reject) => { + resolve() + }) + } + }, AvoidAreaType: { TYPE_SYSTEM: 0, TYPE_CUTOUT: 1,