Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4308e6ae
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看板
未验证
提交
4308e6ae
编写于
6月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3710 【resourceschedule_standard】【master】新增接口参数用例补充
Merge pull request !3710 from qigongming/master_0623
上级
81ae1f33
2a9fc2e2
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
193 addition
and
7 deletion
+193
-7
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/ContinuousTaskJsunit.test.js
...ger/src/main/js/default/test/ContinuousTaskJsunit.test.js
+7
-7
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/DeviceUsageStatisticsJsunit.test.js
.../main/js/default/test/DeviceUsageStatisticsJsunit.test.js
+186
-0
未找到文件。
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/ContinuousTaskJsunit.test.js
浏览文件 @
4308e6ae
...
...
@@ -199,7 +199,7 @@ describe("ContinuousTaskJsTest", function () {
})
/*
* @tc.name: ContinuousTaskJsTest0
09
* @tc.name: ContinuousTaskJsTest0
10
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
...
...
@@ -212,7 +212,7 @@ describe("ContinuousTaskJsTest", function () {
})
/*
* @tc.name: ContinuousTaskJsTest01
0
* @tc.name: ContinuousTaskJsTest01
1
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
...
...
@@ -225,7 +225,7 @@ describe("ContinuousTaskJsTest", function () {
})
/*
* @tc.name: ContinuousTaskJsTest01
1
* @tc.name: ContinuousTaskJsTest01
2
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
...
...
@@ -238,7 +238,7 @@ describe("ContinuousTaskJsTest", function () {
})
/*
* @tc.name: ContinuousTaskJsTest01
2
* @tc.name: ContinuousTaskJsTest01
3
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
...
...
@@ -251,7 +251,7 @@ describe("ContinuousTaskJsTest", function () {
})
/*
* @tc.name: ContinuousTaskJsTest01
3
* @tc.name: ContinuousTaskJsTest01
4
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
...
...
@@ -264,7 +264,7 @@ describe("ContinuousTaskJsTest", function () {
})
/*
* @tc.name: ContinuousTaskJsTest01
4
* @tc.name: ContinuousTaskJsTest01
5
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
...
...
@@ -277,7 +277,7 @@ describe("ContinuousTaskJsTest", function () {
})
/*
* @tc.name: ContinuousTaskJsTest01
7
* @tc.name: ContinuousTaskJsTest01
6
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
...
...
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/DeviceUsageStatisticsJsunit.test.js
浏览文件 @
4308e6ae
...
...
@@ -2721,4 +2721,190 @@ describe("DeviceUsageStatisticsJsTest", function () {
expect
(
value1
).
assertEqual
(
60
)
done
();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0114
* @tc.desc: test bundleState onBundleGroupChanged callback appUsageOldGroup promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0114
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0114---------------------------
'
);
let
onBundleGroupChanged
=
(
err
,
res
)
=>
{
if
(
res
===
undefined
)
{
let
res
=
{
appUsageOldGroup
:
20
};
console
.
info
(
'
test DeviceUsageStatisticsJsTest0114 result appUsageOldGroup is :
'
+
res
.
appUsageOldGroup
);
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0114 callback success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0114 result oldGroup is :
'
+
res
.
oldGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0114 result newGroup is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0114 result changeReason is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0114 result userId is :
'
+
res
.
userId
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0114 result bundleName is :
'
+
res
.
bundleName
);
};
};
bundleState
.
registerGroupCallBack
(
onBundleGroupChanged
).
then
(
()
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0114 promise succeeded.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0114 promise failed.
'
);
expect
(
false
).
assertEqual
(
true
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0115
* @tc.desc: test bundleState onBundleGroupChanged callback appUsageNewGroup promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0115
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0115---------------------------
'
);
let
onBundleGroupChanged
=
(
err
,
res
)
=>
{
if
(
res
===
undefined
)
{
let
res
=
{
appUsageNewGroup
:
30
};
console
.
info
(
'
test DeviceUsageStatisticsJsTest0115 result appUsageNewGroup is :
'
+
res
.
appUsageNewGroup
);
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0115 callback success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0115 result oldGroup is :
'
+
res
.
oldGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0115 result newGroup is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0115 result changeReason is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0115 result userId is :
'
+
res
.
userId
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0115 result bundleName is :
'
+
res
.
bundleName
);
}
};
bundleState
.
unRegisterGroupCallBack
().
then
(
()
=>
{
bundleState
.
registerGroupCallBack
(
onBundleGroupChanged
).
then
(
()
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0115 promise succeeded.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0115 promise failed.
'
);
expect
(
false
).
assertEqual
(
true
);
});
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0116
* @tc.desc: test bundleState onBundleGroupChanged callback useId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0116
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0115---------------------------
'
);
let
onBundleGroupChanged
=
(
err
,
res
)
=>
{
if
(
res
===
undefined
)
{
let
res
=
{
useId
:
100
};
console
.
info
(
'
test DeviceUsageStatisticsJsTest0116 result useId is :
'
+
res
.
useId
);
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 callback success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result oldGroup is :
'
+
res
.
oldGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result newGroup is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result changeReason is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result userId is :
'
+
res
.
userId
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result bundleName is :
'
+
res
.
bundleName
);
}
};
bundleState
.
unRegisterGroupCallBack
().
then
(
()
=>
{
bundleState
.
registerGroupCallBack
(
onBundleGroupChanged
).
then
(
()
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 promise succeeded.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 promise failed.
'
);
expect
(
false
).
assertEqual
(
true
);
});
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0117
* @tc.desc: test bundleState onBundleGroupChanged callback changeReason promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0117
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0115---------------------------
'
);
let
onBundleGroupChanged
=
(
err
,
res
)
=>
{
if
(
res
===
undefined
)
{
let
res
=
{
changeReason
:
1024
};
console
.
info
(
'
test DeviceUsageStatisticsJsTest0117 result changeReason is :
'
+
res
.
changeReason
);
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 callback success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result oldGroup is :
'
+
res
.
oldGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result newGroup is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result changeReason is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result userId is :
'
+
res
.
userId
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0116 result bundleName is :
'
+
res
.
bundleName
);
}
};
bundleState
.
unRegisterGroupCallBack
().
then
(
()
=>
{
bundleState
.
registerGroupCallBack
(
onBundleGroupChanged
).
then
(
()
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0117 promise succeeded.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0117 promise failed.
'
);
expect
(
false
).
assertEqual
(
true
);
});
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0118
* @tc.desc: test bundleState queryBundleActiveEventStates evenId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0118
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0118---------------------------
'
);
bundleState
.
queryBundleActiveEventStates
(
0
,
20000000000000
).
then
(
res
=>
{
if
(
res
===
undefined
)
{
let
res
=
{
evenId
:
{
SYSTEM_UNLOCK
:
1
}
};
console
.
info
(
'
test DeviceUsageStatisticsJsTest0118 result evenId is :
'
+
res
.
evenId
.
SYSTEM_UNLOCK
)
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0118 promise success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0118 promise result
'
+
JSON
.
stringify
(
res
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0118 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertFalse
();
});
setTimeout
(()
=>
{
done
();
},
500
);
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录