Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b4150bde
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b4150bde
编写于
3月 17, 2022
作者:
Z
zhangxingxia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update storageStatistics
Signed-off-by:
N
zhangxingxia
<
zhangxingxia1@huawei.com
>
上级
9948d2db
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
28 deletion
+13
-28
storage/storagestatisticsjstest/src/main/js/default/test/StorageStatistics.test.js
...jstest/src/main/js/default/test/StorageStatistics.test.js
+13
-28
未找到文件。
storage/storagestatisticsjstest/src/main/js/default/test/StorageStatistics.test.js
浏览文件 @
b4150bde
...
...
@@ -275,7 +275,7 @@ describe("storageStatistics", function () {
it
(
"
storage_statistics_test_get_bundle_stat_async_000
"
,
0
,
async
function
(
done
)
{
try
{
let
packageName
=
await
getPackageName
();
let
bundleStat
=
await
storageStatistics
.
getBundleStats
(
"
id
"
,
packageName
);
let
bundleStat
=
await
storageStatistics
.
getBundleStats
(
packageName
);
expect
(
bundleStat
!=
null
).
assertTrue
();
expect
(
isIntNum
(
bundleStat
.
appSize
)
&&
!
isNegativeNum
(
bundleStat
.
appSize
)).
assertTrue
();
expect
(
isIntNum
(
bundleStat
.
cacheSize
)
&&
!
isNegativeNum
(
bundleStat
.
cacheSize
)).
assertTrue
();
...
...
@@ -300,7 +300,7 @@ describe("storageStatistics", function () {
it
(
"
storage_statistics_test_get_bundle_stat_async_001
"
,
0
,
async
function
(
done
)
{
try
{
let
packageName
=
await
getPackageName
();
storageStatistics
.
getBundleStats
(
"
id
"
,
packageName
,
(
error
,
bundleStat
)
=>
{
storageStatistics
.
getBundleStats
(
packageName
,
(
error
,
bundleStat
)
=>
{
expect
(
bundleStat
!=
null
).
assertTrue
();
expect
(
isIntNum
(
bundleStat
.
appSize
)
&&
!
isNegativeNum
(
bundleStat
.
appSize
)).
assertTrue
();
expect
(
isIntNum
(
bundleStat
.
cacheSize
)
&&
!
isNegativeNum
(
bundleStat
.
cacheSize
)).
assertTrue
();
...
...
@@ -325,23 +325,19 @@ describe("storageStatistics", function () {
*/
it
(
"
storage_statistics_test_get_bundle_stat_async_002
"
,
0
,
async
function
(
done
)
{
try
{
let
bundleStat
=
await
storageStatistics
.
getBundleStats
(
"
id
"
,
"
packageName
"
);
expect
(
bundleStat
!=
null
).
assertTrue
();
expect
(
bundleStat
.
appSize
==
0
).
assertTrue
();
expect
(
bundleStat
.
cacheSize
==
0
).
assertTrue
();
expect
(
bundleStat
.
dataSize
==
0
).
assertTrue
();
console
.
log
(
`async_002 bundleStat ===---===
${
JSON
.
stringify
(
bundleStat
)}
`
);
await
storageStatistics
.
getBundleStats
(
"
packageName
"
);
done
();
}
catch
(
e
)
{
console
.
log
(
"
storage_statistics_test_get_bundle_stat_async_002 has failed for
"
+
e
);
expect
(
!!
e
).
assertTrue
();
expect
(
e
.
message
==
"
Invalid name
"
).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_DF_STORAGE_STATISTICS_GET_BUNDLE_STAT_0030
* @tc.name storage_statistics_test_get_bundle_stat_async_003
* @tc.desc Test getBundleStats() interfaces,
No parameters
, returns the correct result.
* @tc.desc Test getBundleStats() interfaces,
When the parameter type is wrong
, returns the correct result.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -349,24 +345,18 @@ describe("storageStatistics", function () {
*/
it
(
"
storage_statistics_test_get_bundle_stat_async_003
"
,
0
,
async
function
(
done
)
{
try
{
let
packageName
=
await
getPackageName
();
let
bundleStat
=
await
storageStatistics
.
getBundleStats
(
""
,
packageName
);
expect
(
bundleStat
!=
null
).
assertTrue
();
expect
(
isIntNum
(
bundleStat
.
appSize
)
&&
!
isNegativeNum
(
bundleStat
.
appSize
)).
assertTrue
();
expect
(
isIntNum
(
bundleStat
.
cacheSize
)
&&
!
isNegativeNum
(
bundleStat
.
cacheSize
)).
assertTrue
();
expect
(
isIntNum
(
bundleStat
.
dataSize
)
&&
!
isNegativeNum
(
bundleStat
.
dataSize
)).
assertTrue
();
console
.
log
(
`async_003 bundleStat ===---===
${
JSON
.
stringify
(
bundleStat
)}
`
);
done
();
await
storageStatistics
.
getBundleStats
(
1
);
}
catch
(
e
)
{
console
.
log
(
"
storage_statistics_test_get_bundle_stat_async_003 has failed for
"
+
e
);
expect
(
!!
e
).
assertTrue
();
expect
(
e
.
message
==
"
Invalid name
"
).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_DF_STORAGE_STATISTICS_GET_BUNDLE_STAT_0040
* @tc.name storage_statistics_test_get_bundle_stat_async_004
* @tc.desc Test getBundleStats() interfaces,
the parameter packagename does not exist
, returning error results.
* @tc.desc Test getBundleStats() interfaces,
When there are no parameters
, returning error results.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -374,16 +364,11 @@ describe("storageStatistics", function () {
*/
it
(
"
storage_statistics_test_get_bundle_stat_async_004
"
,
0
,
async
function
(
done
)
{
try
{
let
bundleStat
=
await
storageStatistics
.
getBundleStats
(
"
id
"
,
""
);
expect
(
bundleStat
!=
null
).
assertTrue
();
expect
(
bundleStat
.
appSize
==
0
).
assertTrue
();
expect
(
bundleStat
.
cacheSize
==
0
).
assertTrue
();
expect
(
bundleStat
.
dataSize
==
0
).
assertTrue
();
console
.
log
(
`async_004 bundleStat ===---===
${
JSON
.
stringify
(
bundleStat
)}
`
);
done
();
await
storageStatistics
.
getBundleStats
();
}
catch
(
e
)
{
console
.
log
(
"
storage_statistics_test_get_bundle_stat_async_004 has failed for
"
+
e
);
expect
(
!!
e
).
assertTrue
();
expect
(
e
.
message
==
"
Number of arguments unmatched
"
).
assertTrue
();
done
();
}
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录