add raw file js api mock

Signed-off-by: VictoriaGuo <guojia2@huawei.com>
This commit is contained in:
VictoriaGuo
2021-12-25 15:04:19 +08:00
parent a43b4c47dd
commit b3b6a2d0d2
@@ -145,6 +145,20 @@ function ResourceManager(mgrId, module) {
console.warn("ResourceManager.getJsonConfig interface mocked in the Previewer. " +
"How this interface works on the Previewer may be different from that on a real device.")
}
this.getRawFile = getRawFile;
async function getRawFile(path, callback) {
var data = "mock raw file";
console.warn("ResourceManager.getRawFile interface mocked in the Previewer. " +
"How this interface works on the Previewer may be different from that on a real device.")
if (typeof callback === 'function') {
callback.call(this, null, data);
} else {
return new Promise((resolve) => {
resolve(data);
})
}
}
}
var resourceManager = {