提交 7420fa24 编写于 作者: Z zhangxingxia

add statistics xts

Signed-off-by: Nzhangxingxia <zhangxingxia1@huawei.com>
上级 0b62f5c4
......@@ -99,7 +99,7 @@ export default function storageStatisticsTest() {
});
} catch (error) {
console.log("storage_statistics_test_get_current_bundle_stats_async_003 has failed for " + error);
expect(isInclude(error, "The callback shall be a function")).assertTrue();
expect(isInclude(error, "Number of arguments unmatched")).assertTrue();
done();
}
});
......@@ -107,7 +107,7 @@ export default function storageStatisticsTest() {
/**
* @tc.number SUB_DF_STORAGE_STATISTICS_GET_CURRENT_BUNDLE_STATS_0040
* @tc.name storage_statistics_test_get_current_bundle_stats_async_004
* @tc.desc Test getCurrentBundleStats() interfaces, When there are no parameters.
* @tc.desc Test getCurrentBundleStats() interfaces,Concurrent requests.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
......@@ -115,11 +115,24 @@ export default function storageStatisticsTest() {
*/
it("storage_statistics_test_get_current_bundle_stats_async_004", 0, async function (done) {
try {
await storageStatistics.getCurrentBundleStats();
const delay = function delay() {
return new Promise((resolve, reject) => {
storageStatistics.getCurrentBundleStats((err, result)=>{
resolve(result);
})
});
};
let tasks = [delay(), delay(), delay(), delay()];
Promise.all(tasks).then(results => {
let flag = !results.some(function(value){
return JSON.stringify(value) !== JSON.stringify(results[0]);
})
expect(results.length == tasks.length).assertTrue();
expect(flag).assertTrue();
done();
});
} catch (error) {
console.log("storage_statistics_test_get_current_bundle_stats_async_004 has failed for " + error);
expect(isInclude(error, "The callback shall be a function")).assertTrue();
done();
}
})
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册