DMS错误码整改

Signed-off-by: du-zhihai <duzhihai@huawei.com>
Change-Id: I31e8bd1edc8f35826a4a9894b42edb8a6722a7cc
This commit is contained in:
du-zhihai 2022-09-26 12:48:59 +08:00
parent d68616e9e9
commit 30bc22ba83

View File

@ -16,12 +16,16 @@
import { paramMock } from "../utils"
export function mockContinationManager() {
const ContinuationMode = {
COLLABORATION_SINGLE: 0,
COLLABORATION_MULTIPLE: 1
}
const ContinuationExtraParams = {
deviceType: [paramMock.paramStringMock],
targetBundle: '[PC preview] unknown targetBundle',
description: '[PC preview] unknown description',
filter: '[PC preview] unknown filter',
continuationMode: continuationManager.ContinuationMode,
continuationMode: ContinuationMode,
authInfo: '[PC preview] unknown authInfo'
}
@ -32,6 +36,7 @@ export function mockContinationManager() {
}
const continuationManager = {
ContinuationMode,
DeviceConnectState: {
IDLE: 0,
CONNECTING: 1,
@ -39,11 +44,6 @@ export function mockContinationManager() {
DISCONNECTING: 3
},
ContinuationMode: {
COLLABORATION_SINGLE: 0,
COLLABORATION_MULTIPLE: 1
},
on: function (...args) {
console.warn("continuationManager.on interface mocked in the Previewer. How this interface works on the Previewer may" +
" be different from that on a real device.")
@ -113,6 +113,58 @@ export function mockContinationManager() {
});
}
},
registerContinuation: function (...args) {
console.warn("continuationManager.registerContinuation 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) => {
resolve(paramMock.paramNumberMock);
});
}
},
unregisterContinuation: function (...args) {
console.warn("continuationManager.unregisterContinuation 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();
});
}
},
updateContinuationState: function (...args) {
console.warn("continuationManager.updateContinuationState 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();
});
}
},
startContinuationDeviceManager: function (...args) {
console.warn("continuationManager.startContinuationDeviceManager 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 continuationManager
}