From 769b92d2675b3c22e6c5f4edb54897d4de7847d6 Mon Sep 17 00:00:00 2001 From: hwx1119949 <3052854011@qq.com> Date: Thu, 21 Jul 2022 11:34:15 +0800 Subject: [PATCH] mock bugfix Signed-off-by: hwx1119949 <3052854011@qq.com> Change-Id: I95e65fb9e97656e6054c84d9dd32c5c5c6f184d7 --- .../main/extend/systemplugin/napi/index.js | 2 +- .../napi/ohos_application_Want.js | 29 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/runtime/main/extend/systemplugin/napi/index.js b/runtime/main/extend/systemplugin/napi/index.js index 5d7c060e..0d094a80 100644 --- a/runtime/main/extend/systemplugin/napi/index.js +++ b/runtime/main/extend/systemplugin/napi/index.js @@ -191,7 +191,7 @@ export function mockRequireNapiFun() { return mockZlib(); case "screenshot": return mockScreenshot(); - case "WantAgent": + case "wantAgent": return mockWantAgent(); case "wallpaper": return mockWallpaper(); diff --git a/runtime/main/extend/systemplugin/napi/ohos_application_Want.js b/runtime/main/extend/systemplugin/napi/ohos_application_Want.js index 1fad9fd2..0d242ba3 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_application_Want.js +++ b/runtime/main/extend/systemplugin/napi/ohos_application_Want.js @@ -15,18 +15,17 @@ import { paramMock } from "../utils" export const WantClass = class Want { - constructor() { - console.warn('Want.constructor interface mocked in the Previewer. How this interface works on' + - ' the Previewer may be different from that on a real device.'); - this.deviceId = "[PC Preview] unknow deviceId"; - this.bundleName = "[PC Preview] unknow bundleName"; - this.abilityName = "[PC Preview] unknow abilityName"; - this.uri = "[PC Preview] unknow uri"; - this.type = "[PC Preview] unknow type"; - this.flag = "[PC Preview] unknow flag"; - this.action = "[PC Preview] unknow action"; - this.parameters = {}; - this.entities = [paramMock.paramStringMock]; - this.moduleName = "[PC Preview] unknow moduleName"; - } -} \ No newline at end of file + constructor() { + this.deviceId = "[PC Preview] unknow deviceId"; + this.bundleName = "[PC Preview] unknow bundleName"; + this.abilityName = "[PC Preview] unknow abilityName"; + this.uri = "[PC Preview] unknow uri"; + this.type = "[PC Preview] unknow type"; + this.flag = "[PC Preview] unknow flag"; + this.action = "[PC Preview] unknow action"; + this.parameters = {}; + this.entities = [paramMock.paramStringMock]; + this.moduleName = "[PC Preview] unknow moduleName"; + } +} +