mirror of
https://github.com/openharmony/third_party_jsframework.git
synced 2026-07-18 20:44:48 -04:00
@@ -248,6 +248,7 @@ export const ExtensionContextClass = class ExtensionContext extends contextClass
|
||||
super();
|
||||
console.warn('Context.ExtensionContext.constructor interface mocked in the Previewer. How this interface works on' +
|
||||
' the Previewer may be different from that on a real device.');
|
||||
this.currentHapModuleInfo = HapModuleInfoMock;
|
||||
}
|
||||
};
|
||||
export const AbilityResultMock = {
|
||||
|
||||
@@ -31,6 +31,16 @@ const WantClass = class Want {
|
||||
this.entities = [paramMock.paramStringMock];
|
||||
}
|
||||
}
|
||||
const calleeMock = {
|
||||
on: function (...args) {
|
||||
console.warn("Ability.calleeClass.on interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
},
|
||||
off: function (...args) {
|
||||
console.warn("Ability.calleeClass.off interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
},
|
||||
}
|
||||
export function mockAbility() {
|
||||
const AbilityClass = class Ability {
|
||||
constructor() {
|
||||
@@ -39,6 +49,7 @@ export function mockAbility() {
|
||||
this.context = new AbilityContextClass();
|
||||
this.launchWant = new WantClass();
|
||||
this.lastRequestWant = new WantClass();
|
||||
this.callee = calleeMock;
|
||||
this.onCreate = function (...args) {
|
||||
console.warn("application.Ability.onCreate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
@@ -63,6 +74,19 @@ export function mockAbility() {
|
||||
console.warn("application.Ability.onBackground interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
this.onContinue = function () {
|
||||
console.warn("application.Ability.onContinue interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
};
|
||||
this.onNewWant = function () {
|
||||
console.warn("application.Ability.onNewWant interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
this.onConfigurationUpdated = function () {
|
||||
console.warn("application.Ability.onConfigurationUpdated interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
}
|
||||
}
|
||||
return new AbilityClass();
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { paramMock } from "../utils"
|
||||
|
||||
export function mockAbilityManager() {
|
||||
const AbilityRunningInfoMock = {
|
||||
ability: ElementNameMock,
|
||||
pid: '[PC preview] unknow pid',
|
||||
uid: '[PC preview] unknow uid',
|
||||
processName: '[PC preview] unknow processName',
|
||||
startTime: '[PC preview] unknow startTime',
|
||||
AbilityStateMock: '[PC preview] unknow abilityStateMock'
|
||||
}
|
||||
const ElementNameMock = {
|
||||
deviceId: '[PC preview] unknow deviceId',
|
||||
bundleName: '[PC preview] unknow bundleName',
|
||||
abilityName: '[PC preview] unknow abilityName',
|
||||
uri: '[PC preview] unknow uri',
|
||||
shortName: '[PC preview] unknow shortName'
|
||||
}
|
||||
const ExtensionRunningInfoMock = {
|
||||
extension: ElementNameMock,
|
||||
pid: '[PC preview] unknow pid',
|
||||
uid: '[PC preview] unknow uid',
|
||||
processName: '[PC preview] unknow processName',
|
||||
startTime: '[PC preview] unknow startTime',
|
||||
clientPackage: [paramMock.paramStringMock],
|
||||
ExtensionAbilityTypeMock: '[PC preview] unknow ExtensionAbilityTypeMock',
|
||||
}
|
||||
const abilityManager = {
|
||||
updateConfiguration: function (...args) {
|
||||
console.warn('abilityManager.updateConfiguration 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
getAbilityRunningInfos: function (...args) {
|
||||
console.warn('abilityManager.getAbilityRunningInfos 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, [AbilityRunningInfoMock]);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve([AbilityRunningInfoMock]);
|
||||
});
|
||||
}
|
||||
},
|
||||
getExtensionRunningInfos: function (...args) {
|
||||
console.warn('abilityManager.getExtensionRunningInfos 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, [ExtensionRunningInfoMock]);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve([ExtensionRunningInfoMock]);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return abilityManager
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
import { abilityStageContextClass } from "./application/abilityContext"
|
||||
import { paramMock } from "../utils"
|
||||
|
||||
export function mockAbilityStage() {
|
||||
const AbilityStageClass = class AbilityStage {
|
||||
@@ -24,6 +25,11 @@ export function mockAbilityStage() {
|
||||
this.onCreate = function () {
|
||||
console.warn("application.AbilityStage.onCreate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
this.onAcceptWant = function () {
|
||||
console.warn("application.AbilityStage.onAcceptWant interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { paramMock } from "../utils"
|
||||
|
||||
export function mockAppManager() {
|
||||
const AppStateDataMock = {
|
||||
bundleName: '[PC preview] unknow bundleName',
|
||||
uid: '[PC preview] unknow uid',
|
||||
state: '[PC preview] unknow state'
|
||||
}
|
||||
const ProcessRunningInfoMock = {
|
||||
pid: '[PC preview] unknow pid',
|
||||
uid: '[PC preview] unknow uid',
|
||||
processName: '[PC preview] unknow processName',
|
||||
bundleNames: [paramMock.paramStringMock]
|
||||
}
|
||||
const appManager = {
|
||||
registerApplicationStateObserver: function (...args) {
|
||||
console.warn('appManager.registerApplicationStateObserver interface mocked in the Previewer. How this interface works on the' +
|
||||
' Previewer may be different from that on a real device.');
|
||||
return paramMock.paramNumberMock;
|
||||
},
|
||||
unregisterApplicationStateObserver: function (...args) {
|
||||
console.warn('appManager.unregisterApplicationStateObserver 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
getForegroundApplications: function (...args) {
|
||||
console.warn('appManager.getForegroundApplications 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, [AppStateDataMock]);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve([AppStateDataMock]);
|
||||
});
|
||||
}
|
||||
},
|
||||
killProcessWithAccount: function (...args) {
|
||||
console.warn('appManager.killProcessWithAccount 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
isRunningInStabilityTest: function (...args) {
|
||||
console.warn('appManager.isRunningInStabilityTest 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.paramBooleanMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(paramMock.paramBooleanMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
getProcessRunningInfos: function (...args) {
|
||||
console.warn('appManager.getProcessRunningInfos 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, [ProcessRunningInfoMock]);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve([ProcessRunningInfoMock]);
|
||||
});
|
||||
}
|
||||
},
|
||||
killProcessesByBundleName: function (...args) {
|
||||
console.warn('appManager.killProcessesByBundleName 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
clearUpApplicationData: function (...args) {
|
||||
console.warn('appManager.clearUpApplicationData 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return appManager
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { paramMock } from "../utils"
|
||||
import { ExtensionContextClass } from "./application/abilityContext"
|
||||
import { ResultSetMock } from "./dataShare"
|
||||
|
||||
export function mockDataShareExtensionAbility() {
|
||||
const DataShareExtensionAbilityClass = class DataShareExtensionAbility {
|
||||
constructor() {
|
||||
console.warn('application.DataShareExtensionAbility interface mocked in the Previewer. How this interface works on' +
|
||||
' the Previewer may be different from that on a real device.');
|
||||
this.context = new ExtensionContextClass();
|
||||
this.onCreate = function () {
|
||||
console.warn("application.DataShareExtensionAbility.onCreate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
this.getFileTypes = function () {
|
||||
console.warn("application.DataShareExtensionAbility.getFileTypes interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return [paramMock.paramStringMock];
|
||||
};
|
||||
this.insert = function () {
|
||||
console.warn("application.DataShareExtensionAbility.insert interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
};
|
||||
this.update = function () {
|
||||
console.warn("application.DataShareExtensionAbility.update interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
};
|
||||
this.delete = function () {
|
||||
console.warn("application.DataShareExtensionAbility.delete interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
};
|
||||
this.query = function () {
|
||||
console.warn("application.DataShareExtensionAbility.query interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return ResultSetMock;
|
||||
};
|
||||
this.getType = function () {
|
||||
console.warn("application.DataShareExtensionAbility.getType interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
};
|
||||
this.batchInsert = function () {
|
||||
console.warn("application.DataShareExtensionAbility.batchInsert interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
};
|
||||
this.normalizeUri = function () {
|
||||
console.warn("application.DataShareExtensionAbility.normalizeUri interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
};
|
||||
this.denormalizeUri = function () {
|
||||
console.warn("application.DataShareExtensionAbility.denormalizeUri interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
};
|
||||
}
|
||||
}
|
||||
return new DataShareExtensionAbilityClass();
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { paramMock } from "../utils"
|
||||
import { PixelMapMock } from "../multimedia"
|
||||
|
||||
export function mockMissionManager() {
|
||||
const MissionInfoMock = {
|
||||
missionId: '[PC preview] unknown missionId',
|
||||
runningState: '[PC preview] unknown runningState',
|
||||
lockedState: '[PC preview] unknown lockedState',
|
||||
timestamp: '[PC preview] unknown timestamp',
|
||||
want: '[PC preview] unknown want',
|
||||
label: '[PC preview] unknown label',
|
||||
iconPath: '[PC preview] unknown iconPath',
|
||||
continuable: '[PC preview] unknown continuable'
|
||||
}
|
||||
const ElementNameMock = {
|
||||
deviceId: '[PC preview] unknown deviceId',
|
||||
bundleName: '[PC preview] unknown bundleName',
|
||||
abilityName: '[PC preview] unknown abilityName',
|
||||
uri: '[PC preview] unknown uri',
|
||||
shortName: '[PC preview] unknown shortName'
|
||||
}
|
||||
const MissionSnapshotMock = {
|
||||
abality: ElementNameMock,
|
||||
snapshot: PixelMapMock,
|
||||
}
|
||||
const missionManager = {
|
||||
registerMissionListener: function (...args) {
|
||||
console.warn("missionManager.registerMissionListener interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
},
|
||||
unregisterMissionListener: function (...args) {
|
||||
console.warn('missionManager.unregisterMissionListener 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
getMissionInfo: function (...args) {
|
||||
console.warn('missionManager.getMissionInfo 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, MissionInfoMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(MissionInfoMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
getMissionInfos: function (...args) {
|
||||
console.warn('missionManager.getMissionInfos 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, [MissionInfoMock]);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve([MissionInfoMock]);
|
||||
});
|
||||
}
|
||||
},
|
||||
getMissionSnapShot: function (...args) {
|
||||
console.warn('missionManager.getMissionSnapShot 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, MissionSnapshotMock);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve(MissionSnapshotMock);
|
||||
});
|
||||
}
|
||||
},
|
||||
lockMission: function (...args) {
|
||||
console.warn('missionManager.lockMission 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
unlockMission: function (...args) {
|
||||
console.warn('missionManager.unlockMission 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
clearMission: function (...args) {
|
||||
console.warn('missionManager.clearMission 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
clearAllMissions: function (...args) {
|
||||
console.warn('missionManager.clearAllMissions 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
},
|
||||
moveMissionToFront: function (...args) {
|
||||
console.warn('missionManager.moveMissionToFront 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) => {
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return missionManager
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { paramMock } from "../utils"
|
||||
import { RemoteObjectClass } from "./applicationServiceExtension"
|
||||
|
||||
export function mockServiceExtAbility() {
|
||||
const ApplicationInfoMock = {
|
||||
name: '[PC preview] unknow name',
|
||||
description: '[PC preview] unknow description',
|
||||
descriptionId: '[PC preview] unknow descriptionId',
|
||||
systemApp: '[PC preview] unknow systemApp',
|
||||
enabled: '[PC preview] unknow enabled',
|
||||
label: '[PC preview] unknow label',
|
||||
labelId: '[PC preview] unknow labelId',
|
||||
icon: '[PC preview] unknow icon',
|
||||
iconId: '[PC preview] unknow iconId',
|
||||
process: '[PC preview] unknow process',
|
||||
supportedModes: '[PC preview] unknow supportedModes',
|
||||
moduleSourceDirs: [paramMock.paramStringMock],
|
||||
permissions: [paramMock.paramStringMock],
|
||||
entryDir: '[PC preview] unknow entryDir',
|
||||
codePath: '[PC preview] unknow codePath',
|
||||
removable: '[PC preview] unknow removable',
|
||||
accessTokenId: '[PC preview] unknow accessTokenId',
|
||||
uid: '[PC preview] unknow uid',
|
||||
entityType: '[PC preview] unknow entityType'
|
||||
}
|
||||
const HapModuleInfoMock = {
|
||||
name: '[PC preview] unknow name',
|
||||
description: '[PC preview] unknow description',
|
||||
descriptionId: '[PC preview] unknow descriptionId',
|
||||
icon: '[PC preview] unknow icon',
|
||||
label: '[PC preview] unknow label',
|
||||
labelId: '[PC preview] unknow labelId',
|
||||
iconId: '[PC preview] unknow iconId',
|
||||
backgroundImg: '[PC preview] unknow backgroundImg',
|
||||
supportedModes: '[PC preview] unknow supportedModes',
|
||||
reqCapabilities: [paramMock.paramStringMock],
|
||||
deviceTypes: [paramMock.paramStringMock],
|
||||
moduleName: '[PC preview] unknow moduleName',
|
||||
mainAbilityName: '[PC preview] unknow mainAbilityName',
|
||||
installationFree: '[PC preview] unknow installationFree',
|
||||
mainElementName: '[PC preview] unknow mainElementName',
|
||||
}
|
||||
const BaseContextClass = class BaseContext {
|
||||
constructor() {
|
||||
console.warn('BaseContext.constructor interface mocked in the Previewer. How this interface works on' +
|
||||
' the Previewer may be different from that on a real device.');
|
||||
this.stageMode = "[PC Preview] unknow stageMode";
|
||||
}
|
||||
}
|
||||
const ContextClass = class Context extends BaseContextClass {
|
||||
constructor() {
|
||||
super();
|
||||
console.warn('Context.constructor interface mocked in the Previewer. How this interface works on' +
|
||||
' the Previewer may be different from that on a real device.');
|
||||
this.applicationInfo = ApplicationInfoMock;
|
||||
this.cacheDir = "[PC Preview] unknow cacheDir";
|
||||
this.tempDir = "[PC Preview] unknow tempDir";
|
||||
this.filesDir = "[PC Preview] unknow filesDir";
|
||||
this.databaseDir = "[PC Preview] unknow databaseDir";
|
||||
this.storageDir = "[PC Preview] unknow storageDir";
|
||||
this.bundleCodeDir = "[PC Preview] unknow bundleCodeDir";
|
||||
this.distributedFilesDir = "[PC Preview] unknow distributedFilesDir";
|
||||
this.eventHub = "[PC Preview] unknow eventHub";
|
||||
this.createBundleContext = function (...args) {
|
||||
console.warn("Context.createBundleContext interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return new ContextClass();
|
||||
};
|
||||
this.getApplicationContext = function () {
|
||||
console.warn("Context.getApplicationContext interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return new ContextClass();
|
||||
};
|
||||
this.switchArea = function (...args) {
|
||||
console.warn("Context.switchArea interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
}
|
||||
}
|
||||
const ExtAbilityContextClass = class ExtAbilityContext extends ContextClass {
|
||||
constructor() {
|
||||
super();
|
||||
console.warn('ExtAbilityContext.constructor interface mocked in the Previewer. How this interface works on' +
|
||||
' the Previewer may be different from that on a real device.');
|
||||
this.currentHapModuleInfo = HapModuleInfoMock;
|
||||
}
|
||||
}
|
||||
const ServiceExtAbilityContextClass = class ServiceExtAbilityContext extends ExtAbilityContextClass{
|
||||
constructor() {
|
||||
super();
|
||||
console.warn('ServiceExtAbilityContext.constructor interface mocked in the Previewer. How this interface works on' +
|
||||
' the Previewer may be different from that on a real device.');
|
||||
this.startAbility = function (...args) {
|
||||
console.warn("ServiceExtAbilityContext.startAbility 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 (len > 0 && typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
};
|
||||
this.startAbilityWithAccount = function (...args) {
|
||||
console.warn("ServiceExtAbilityContext.startAbilityWithAccount 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 (len > 0 && typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
};
|
||||
this.terminateSelf = function (...args) {
|
||||
console.warn("ServiceExtAbilityContext.terminateSelf 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 (len > 0 && typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
};
|
||||
this.connectAbility = function (...args) {
|
||||
console.warn("ServiceExtAbilityContext.connectAbility interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
};
|
||||
this.connectAbilityWithAccount = function (...args) {
|
||||
console.warn("ServiceExtAbilityContext.connectAbilityWithAccount interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
};
|
||||
this.disconnectAbility = function (...args) {
|
||||
console.warn("ServiceExtAbilityContext.disconnectAbility 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 (len > 0 && typeof args[len - 1] === 'function') {
|
||||
args[len - 1].call(this, paramMock.businessErrorMock);
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
const ServiceExtAbilityClass = class ServiceExtAbility {
|
||||
constructor() {
|
||||
console.warn('application.ServiceExtAbility.constructor interface mocked in the Previewer. How this interface works on' +
|
||||
' the Previewer may be different from that on a real device.');
|
||||
this.context = new ServiceExtAbilityContextClass();
|
||||
this.onCreate = function (...args) {
|
||||
console.warn("ServiceExtAbility.onCreate interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
this.onDestroy = function () {
|
||||
console.warn("ServiceExtAbility.onDestroy interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
this.onRequest = function (...args) {
|
||||
console.warn("ServiceExtAbility.onRequest interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
this.onConnect = function (...args) {
|
||||
console.warn("ServiceExtAbility.onConnect interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return new RemoteObjectClass();
|
||||
};
|
||||
this.onDisconnect = function (...args) {
|
||||
console.warn("ServiceExtAbility.onDisconnect interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
this.onReconnect = function (...args) {
|
||||
console.warn("ServiceExtAbility.onReconnect interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
}
|
||||
}
|
||||
return new ServiceExtAbilityClass();
|
||||
}
|
||||
@@ -16,6 +16,80 @@
|
||||
import { paramMock } from "../utils"
|
||||
import { ExtensionContextClass } from "./application/abilityContext"
|
||||
|
||||
export const RemoteObjectClass = class RemoteObject {
|
||||
constructor() {
|
||||
console.warn('RemoteObject.constructor interface mocked in the Previewer. How this interface works on' +
|
||||
' the Previewer may be different from that on a real device.');
|
||||
this.queryLocalInterface = function () {
|
||||
console.warn("RemoteObject.queryLocalInterface interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return IRemoteBrokerMock;
|
||||
};
|
||||
this.sendRequest = function (...args) {
|
||||
console.warn("RemoteObject.sendRequest interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
})
|
||||
};
|
||||
this.addDeathRecipient = function () {
|
||||
console.warn("RemoteObject.addDeathRecipient interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
};
|
||||
this.removeDeathRecipient = function () {
|
||||
console.warn("RemoteObject.removeDeathRecipient interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
};
|
||||
this.getInterfaceDescriptor = function () {
|
||||
console.warn("RemoteObject.getInterfaceDescriptor interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
};
|
||||
this.isObjectDead = function () {
|
||||
console.warn("RemoteObject.isObjectDead interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
};
|
||||
this.queryLocalInterface = function (...args) {
|
||||
console.warn("RemoteObject.queryLocalInterface interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return IRemoteObjectMock
|
||||
};
|
||||
this.getInterfaceDescriptor = function () {
|
||||
console.warn("RemoteObject.getInterfaceDescriptor interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
};
|
||||
this.onRemoteRequest = function (...args) {
|
||||
console.warn("RemoteObject.onRemoteRequest interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock
|
||||
};
|
||||
this.sendRequest = function (...args) {
|
||||
console.warn("RemoteObject.sendRequest interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
})
|
||||
};
|
||||
this.getCallingPid = function () {
|
||||
console.warn("RemoteObject.getCallingPid interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
};
|
||||
this.getCallingUid = function () {
|
||||
console.warn("RemoteObject.getCallingUid interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
};
|
||||
this.attachLocalInterface = function (...args) {
|
||||
console.warn("RemoteObject.attachLocalInterface interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
}
|
||||
}
|
||||
export function mockServiceExtension() {
|
||||
const IRemoteBrokerMock = {
|
||||
asObject: function () {
|
||||
@@ -58,80 +132,6 @@ export function mockServiceExtension() {
|
||||
return paramMock.paramBooleanMock;
|
||||
}
|
||||
}
|
||||
const RemoteObjectClass = class RemoteObject {
|
||||
constructor() {
|
||||
console.warn('RemoteObject.constructor interface mocked in the Previewer. How this interface works on' +
|
||||
' the Previewer may be different from that on a real device.');
|
||||
this.queryLocalInterface = function () {
|
||||
console.warn("RemoteObject.queryLocalInterface interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return IRemoteBrokerMock;
|
||||
};
|
||||
this.sendRequest = function (...args) {
|
||||
console.warn("RemoteObject.sendRequest interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
})
|
||||
};
|
||||
this.addDeathRecipient = function () {
|
||||
console.warn("RemoteObject.addDeathRecipient interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
};
|
||||
this.removeDeathRecipient = function () {
|
||||
console.warn("RemoteObject.removeDeathRecipient interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
};
|
||||
this.getInterfaceDescriptor = function () {
|
||||
console.warn("RemoteObject.getInterfaceDescriptor interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
};
|
||||
this.isObjectDead = function () {
|
||||
console.warn("RemoteObject.isObjectDead interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
};
|
||||
this.queryLocalInterface = function (...args) {
|
||||
console.warn("RemoteObject.queryLocalInterface interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return IRemoteObjectMock
|
||||
};
|
||||
this.getInterfaceDescriptor = function () {
|
||||
console.warn("RemoteObject.getInterfaceDescriptor interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock
|
||||
};
|
||||
this.onRemoteRequest = function (...args) {
|
||||
console.warn("RemoteObject.onRemoteRequest interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock
|
||||
};
|
||||
this.sendRequest = function (...args) {
|
||||
console.warn("RemoteObject.sendRequest interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve();
|
||||
})
|
||||
};
|
||||
this.getCallingPid = function () {
|
||||
console.warn("RemoteObject.getCallingPid interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
};
|
||||
this.getCallingUid = function () {
|
||||
console.warn("RemoteObject.getCallingUid interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock
|
||||
};
|
||||
this.attachLocalInterface = function (...args) {
|
||||
console.warn("RemoteObject.attachLocalInterface interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
};
|
||||
}
|
||||
}
|
||||
const serviceExtensionContextClass = class serviceExtensionContext extends ExtensionContextClass {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
@@ -15,6 +15,86 @@
|
||||
|
||||
import { paramMock } from "../utils"
|
||||
|
||||
export const ResultSetMock = {
|
||||
columnNames: "[PC Preview] unknow columnNames",
|
||||
columnCount: "[PC Preview] unknow columnCount",
|
||||
rowCount: "[PC Preview] unknow rowCount",
|
||||
rowIndex: "[PC Preview] unknow rowIndex",
|
||||
isAtFirstRow: "[PC Preview] unknow isAtFirstRow",
|
||||
isAtLastRow: "[PC Preview] unknow isAtLastRow",
|
||||
isEnded: "[PC Preview] unknow isEnded",
|
||||
isStarted: "[PC Preview] unknow isStarted",
|
||||
isClose: "[PC Preview] unknow isClose",
|
||||
getColumnIndex: function (...args) {
|
||||
console.warn("ResultSet.getColumnIndex interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
},
|
||||
getColumnName: function (...args) {
|
||||
console.warn("ResultSet.getColumnName interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
},
|
||||
goTo: function (...args) {
|
||||
console.warn("ResultSet.goTo interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToRow: function (...args) {
|
||||
console.warn("ResultSet.goToRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToLastRow: function (...args) {
|
||||
console.warn("ResultSet.goToLastRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToFirstRow: function (...args) {
|
||||
console.warn("ResultSet.goToFirstRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToNextRow: function (...args) {
|
||||
console.warn("ResultSet.goToNextRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToPreviousRow: function (...args) {
|
||||
console.warn("ResultSet.goToPreviousRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
getBlob: function (...args) {
|
||||
console.warn("ResultSet.getBlob interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramArrayMock;
|
||||
},
|
||||
getString: function (...args) {
|
||||
console.warn("ResultSet.getString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
},
|
||||
getLong: function (...args) {
|
||||
console.warn("ResultSet.getLong interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
},
|
||||
getDouble: function (...args) {
|
||||
console.warn("ResultSet.getDouble interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
},
|
||||
isColumnNull: function (...args) {
|
||||
console.warn("ResultSet.isColumnNull interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
close: function () {
|
||||
console.warn("ResultSet.isColumnNull interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
}
|
||||
}
|
||||
export function mockDataShare() {
|
||||
const getFileTypesArrayMock = [
|
||||
paramMock.paramStringMock
|
||||
@@ -22,86 +102,6 @@ export function mockDataShare() {
|
||||
const PacMapTypeMock = {
|
||||
PacMap: new Map([["[PC Preview] unknow PacMapKey", "[PC Preview] unknow PacMapValue"]])
|
||||
}
|
||||
const ResultSetMock = {
|
||||
columnNames: "[PC Preview] unknow columnNames",
|
||||
columnCount: "[PC Preview] unknow columnCount",
|
||||
rowCount: "[PC Preview] unknow rowCount",
|
||||
rowIndex: "[PC Preview] unknow rowIndex",
|
||||
isAtFirstRow: "[PC Preview] unknow isAtFirstRow",
|
||||
isAtLastRow: "[PC Preview] unknow isAtLastRow",
|
||||
isEnded: "[PC Preview] unknow isEnded",
|
||||
isStarted: "[PC Preview] unknow isStarted",
|
||||
isClose: "[PC Preview] unknow isClose",
|
||||
getColumnIndex: function (...args) {
|
||||
console.warn("ResultSet.getColumnIndex interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
},
|
||||
getColumnName: function (...args) {
|
||||
console.warn("ResultSet.getColumnName interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
},
|
||||
goTo: function (...args) {
|
||||
console.warn("ResultSet.goTo interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToRow: function (...args) {
|
||||
console.warn("ResultSet.goToRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToLastRow: function (...args) {
|
||||
console.warn("ResultSet.goToLastRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToFirstRow: function (...args) {
|
||||
console.warn("ResultSet.goToFirstRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToNextRow: function (...args) {
|
||||
console.warn("ResultSet.goToNextRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
goToPreviousRow: function (...args) {
|
||||
console.warn("ResultSet.goToPreviousRow interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
getBlob: function (...args) {
|
||||
console.warn("ResultSet.getBlob interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramArrayMock;
|
||||
},
|
||||
getString: function (...args) {
|
||||
console.warn("ResultSet.getString interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramStringMock;
|
||||
},
|
||||
getLong: function (...args) {
|
||||
console.warn("ResultSet.getLong interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
},
|
||||
getDouble: function (...args) {
|
||||
console.warn("ResultSet.getDouble interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramNumberMock;
|
||||
},
|
||||
isColumnNull: function (...args) {
|
||||
console.warn("ResultSet.isColumnNull interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
return paramMock.paramBooleanMock;
|
||||
},
|
||||
close: function () {
|
||||
console.warn("ResultSet.isColumnNull interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
" may be different from that on a real device.")
|
||||
}
|
||||
}
|
||||
const DataShareHelperMock = {
|
||||
on: function (...args) {
|
||||
console.warn("DataShareHelper.on interface mocked in the Previewer. How this interface works on the Previewer" +
|
||||
|
||||
@@ -19,6 +19,11 @@ import { mockFormExtension } from './applicationFormExtension'
|
||||
import { mockServiceExtension } from './applicationServiceExtension'
|
||||
import { mockAbilityStage } from './applicationAbilityStage'
|
||||
import { mockFormBindingData } from './applicationFormBindingData'
|
||||
import { mockAbilityManager } from './applicationAbilityManager'
|
||||
import { mockAppManager } from './applicationAppManager'
|
||||
import { mockDataShareExtensionAbility } from './applicationDataShareExtensionAbility'
|
||||
import { mockMissionManager } from "./applicationMissionManager"
|
||||
import { mockServiceExtAbility } from "./applicationServiceExtAbility"
|
||||
import { mockCommonEvent } from './commonEvent'
|
||||
import { mockNotification } from './notification'
|
||||
import { mockFileio } from './fileio'
|
||||
@@ -85,6 +90,16 @@ export function mockRequireNapiFun() {
|
||||
return mockAbilityStage();
|
||||
case "application.formBindingData":
|
||||
return mockFormBindingData();
|
||||
case "application.abilityManager":
|
||||
return mockAbilityManager();
|
||||
case "application.appManager":
|
||||
return mockAppManager();
|
||||
case "application.DataShareExtensionAbility":
|
||||
return mockDataShareExtensionAbility();
|
||||
case "application.missionManager":
|
||||
return mockMissionManager();
|
||||
case "application.ServiceExtAbility":
|
||||
return mockServiceExtAbility();
|
||||
case "commonEvent":
|
||||
return mockCommonEvent();
|
||||
case "notification":
|
||||
|
||||
Reference in New Issue
Block a user