Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ed11371d
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看板
提交
ed11371d
编写于
1月 28, 2023
作者:
C
chenxuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed
b55e56fd
from
https://gitee.com/chenxuihui/xts_acts/pulls/7298
应用恢复接口变更修改测试用例 Signed-off-by:
N
chenxuihui
<
chenxuhui2@huawei.com
>
上级
e5053824
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
51 addition
and
84 deletion
+51
-84
hiviewdfx/apprecoverytest/src/main/js/test/apprecovery_test.js
...wdfx/apprecoverytest/src/main/js/test/apprecovery_test.js
+51
-84
未找到文件。
hiviewdfx/apprecoverytest/src/main/js/test/apprecovery_test.js
浏览文件 @
ed11371d
...
@@ -48,7 +48,7 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -48,7 +48,7 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_0200
* @tc.number: DFX_DFR_AppRecovery_Interface_0200
* @tc.name:
cppcrash故障发生时不
重启应用
* @tc.name:
当发生JS_CRASH时
重启应用
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_0200
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_0200
"
,
0
,
function
()
{
...
@@ -64,7 +64,7 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -64,7 +64,7 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_0300
* @tc.number: DFX_DFR_AppRecovery_Interface_0300
* @tc.name:
jscrash故障发生时不
重启应用
* @tc.name:
APP_FREEZE故障发生时
重启应用
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_0300
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_0300
"
,
0
,
function
()
{
...
@@ -80,13 +80,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -80,13 +80,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_0400
* @tc.number: DFX_DFR_AppRecovery_Interface_0400
* @tc.name:
appfreeze故障发生时不
重启应用
* @tc.name:
JS_CRASH或APP_FREEZE故障发生时
重启应用
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_0400
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_0400
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0400 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0400 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
4
,
3
,
1
);
appRecovery
.
enableAppRecovery
(
3
,
3
,
1
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0400 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0400 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -96,13 +96,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -96,13 +96,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_0500
* @tc.number: DFX_DFR_AppRecovery_Interface_0500
* @tc.name:
cppcrash故障或appfreeze故障发生时
不重启应用
* @tc.name:
任何情况下
不重启应用
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_0500
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_0500
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0500 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0500 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
5
,
3
,
1
);
appRecovery
.
enableAppRecovery
(
4
,
3
,
1
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0500 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0500 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -112,13 +112,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -112,13 +112,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_0600
* @tc.number: DFX_DFR_AppRecovery_Interface_0600
* @tc.name:
jscrash故障或appfreeze故障发生时不重启应用
* @tc.name:
当error时保存数据
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_0600
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_0600
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0600 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0600 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
6
,
3
,
1
);
appRecovery
.
enableAppRecovery
(
0
,
1
,
1
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0600 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0600 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -128,13 +128,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -128,13 +128,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_0700
* @tc.number: DFX_DFR_AppRecovery_Interface_0700
* @tc.name:
jscrash故障、cppcrash故障或appfreeze故障发生时都不重启应用
* @tc.name:
当切换到后台时保存数据
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_0700
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_0700
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0700 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0700 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
7
,
3
,
1
);
appRecovery
.
enableAppRecovery
(
0
,
2
,
1
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0700 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0700 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -144,13 +144,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -144,13 +144,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_0800
* @tc.number: DFX_DFR_AppRecovery_Interface_0800
* @tc.name:
当error时
保存数据
* @tc.name:
以文件
保存数据
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_0800
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_0800
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0800 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0800 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
0
,
1
,
1
);
appRecovery
.
enableAppRecovery
(
0
,
3
,
1
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0800 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0800 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -160,13 +160,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -160,13 +160,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_0900
* @tc.number: DFX_DFR_AppRecovery_Interface_0900
* @tc.name:
当切换到后台时
保存数据
* @tc.name:
以共享内存
保存数据
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_0900
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_0900
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0900 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_0900 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
0
,
2
,
1
);
appRecovery
.
enableAppRecovery
(
0
,
3
,
2
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0900 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_0900 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -176,13 +176,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -176,13 +176,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1000
* @tc.number: DFX_DFR_AppRecovery_Interface_1000
* @tc.name:
以文件保存数据
* @tc.name:
调用restartApp接口
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1000
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1000
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1000 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1000 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
0
,
3
,
1
);
appRecovery
.
restartApp
(
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1000 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1000 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -192,13 +192,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -192,13 +192,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1100
* @tc.number: DFX_DFR_AppRecovery_Interface_1100
* @tc.name:
以共享内存保存数据
* @tc.name:
调用saveAppState接口
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1100
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1100
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1100 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1100 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
0
,
3
,
2
);
appRecovery
.
saveAppState
(
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1100 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1100 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -208,13 +208,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -208,13 +208,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1200
* @tc.number: DFX_DFR_AppRecovery_Interface_1200
* @tc.name:
调用restartApp接口
* @tc.name:
enableAppRecovery接口不传参使用默认值
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1200
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1200
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1200 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1200 start-------------------------
"
);
try
{
try
{
appRecovery
.
restartApp
();
appRecovery
.
enableAppRecovery
();
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1200 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1200 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -224,13 +224,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -224,13 +224,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1300
* @tc.number: DFX_DFR_AppRecovery_Interface_1300
* @tc.name:
调用saveAppState接口
* @tc.name:
enableAppRecovery接口传1个参数
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1300
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1300
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1300 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1300 start-------------------------
"
);
try
{
try
{
appRecovery
.
saveAppState
(
);
appRecovery
.
enableAppRecovery
(
0
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1300 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1300 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -240,13 +240,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -240,13 +240,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1400
* @tc.number: DFX_DFR_AppRecovery_Interface_1400
* @tc.name: enableAppRecovery接口
不传参使用默认值
* @tc.name: enableAppRecovery接口
传2个参数
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1400
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1400
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1400 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1400 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
();
appRecovery
.
enableAppRecovery
(
0
,
3
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1400 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1400 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -256,13 +256,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -256,13 +256,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1500
* @tc.number: DFX_DFR_AppRecovery_Interface_1500
* @tc.name: enableAppRecovery接口传
1
个参数
* @tc.name: enableAppRecovery接口传
3
个参数
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1500
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1500
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1500 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1500 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
0
);
appRecovery
.
enableAppRecovery
(
0
,
3
,
1
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1500 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1500 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -272,13 +272,13 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -272,13 +272,13 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1600
* @tc.number: DFX_DFR_AppRecovery_Interface_1600
* @tc.name: enableAppRecovery接口
传2个参数
* @tc.name: enableAppRecovery接口
关键字传参
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1600
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1600
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1600 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1600 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
0
,
3
);
appRecovery
.
enableAppRecovery
(
appRecovery
.
RestartFlag
.
ALWAYS_RESTART
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1600 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1600 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -288,13 +288,14 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -288,13 +288,14 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1700
* @tc.number: DFX_DFR_AppRecovery_Interface_1700
* @tc.name: enableAppRecovery接口
传3
个参数
* @tc.name: enableAppRecovery接口
关键字传多
个参数
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1700
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1700
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1700 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1700 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
0
,
3
,
1
);
appRecovery
.
enableAppRecovery
(
appRecovery
.
RestartFlag
.
ALWAYS_RESTART
,
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_ERROR
,
appRecovery
.
SaveModeFlag
.
SAVE_WITH_FILE
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1700 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1700 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -304,13 +305,16 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -304,13 +305,16 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1800
* @tc.number: DFX_DFR_AppRecovery_Interface_1800
* @tc.name: enableAppRecovery接口关键字传
参
* @tc.name: enableAppRecovery接口关键字传
多个组合参数
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1800
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1800
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1800 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1800 start-------------------------
"
);
try
{
try
{
appRecovery
.
enableAppRecovery
(
appRecovery
.
RestartFlag
.
ALWAYS_RESTART
);
appRecovery
.
enableAppRecovery
(
appRecovery
.
RestartFlag
.
ALWAYS_RESTART
|
appRecovery
.
RestartFlag
.
RESTART_WHEN_JS_CRASH
|
appRecovery
.
RestartFlag
.
RESTART_WHEN_APP_FREEZE
,
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_ERROR
|
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_BACKGROUND
,
appRecovery
.
SaveModeFlag
.
SAVE_WITH_FILE
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1800 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1800 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -320,47 +324,11 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -320,47 +324,11 @@ describe("ActsAppRecoveryTest", function () {
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_1900
* @tc.number: DFX_DFR_AppRecovery_Interface_1900
* @tc.name:
enableAppRecovery接口关键字传多个参数
* @tc.name:
onSaveState接口测试
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_1900
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_1900
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1900 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_1900 start-------------------------
"
);
try
{
appRecovery
.
enableAppRecovery
(
appRecovery
.
RestartFlag
.
ALWAYS_RESTART
,
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_ERROR
,
appRecovery
.
SaveModeFlag
.
SAVE_WITH_FILE
);
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1900 err =
"
+
error
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_1900 end
"
);
})
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_2000
* @tc.name: enableAppRecovery接口关键字传多个组合参数
* @tc.desc: appRecovery interface test.
*/
it
(
"
DFX_DFR_AppRecovery_Interface_2000
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_2000 start-------------------------
"
);
try
{
appRecovery
.
enableAppRecovery
(
appRecovery
.
RestartFlag
.
ALWAYS_RESTART
|
appRecovery
.
RestartFlag
.
CPP_CRASH_NO_RESTART
|
appRecovery
.
RestartFlag
.
JS_CRASH_NO_RESTART
,
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_ERROR
|
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_BACKGROUND
,
appRecovery
.
SaveModeFlag
.
SAVE_WITH_FILE
);
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2000 err =
"
+
error
);
expect
(
false
).
assertTrue
();
}
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2000 end
"
);
})
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_2100
* @tc.name: onSaveState接口测试
* @tc.desc: appRecovery interface test.
*/
it
(
"
DFX_DFR_AppRecovery_Interface_2100
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_2100 start-------------------------
"
);
try
{
try
{
let
ability_test
=
new
AbilityTest
();
let
ability_test
=
new
AbilityTest
();
let
StateType
=
AbilityConstant
.
StateType
.
APP_RECOVERY
;
let
StateType
=
AbilityConstant
.
StateType
.
APP_RECOVERY
;
...
@@ -374,43 +342,42 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -374,43 +342,42 @@ describe("ActsAppRecoveryTest", function () {
}
}
expect
(
ret
).
assertEqual
(
AbilityConstant
.
OnSaveResult
.
ALL_AGREE
);
expect
(
ret
).
assertEqual
(
AbilityConstant
.
OnSaveResult
.
ALL_AGREE
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_
21
00 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_
19
00 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_
21
00 end
"
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_
19
00 end
"
);
})
})
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_2
2
00
* @tc.number: DFX_DFR_AppRecovery_Interface_2
0
00
* @tc.name: 检验appRecovery属性返回值是否符合预期
* @tc.name: 检验appRecovery属性返回值是否符合预期
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_2
2
00
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_2
0
00
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_2
2
00 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_2
0
00 start-------------------------
"
);
try
{
try
{
expect
(
appRecovery
.
RestartFlag
.
ALWAYS_RESTART
).
assertEqual
(
0
);
expect
(
appRecovery
.
RestartFlag
.
ALWAYS_RESTART
).
assertEqual
(
0
);
expect
(
appRecovery
.
RestartFlag
.
CPP_CRASH_NO_RESTART
).
assertEqual
(
0x0001
);
expect
(
appRecovery
.
RestartFlag
.
RESTART_WHEN_JS_CRASH
).
assertEqual
(
0x0001
);
expect
(
appRecovery
.
RestartFlag
.
JS_CRASH_NO_RESTART
).
assertEqual
(
0x0002
);
expect
(
appRecovery
.
RestartFlag
.
RESTART_WHEN_APP_FREEZE
).
assertEqual
(
0x0002
);
expect
(
appRecovery
.
RestartFlag
.
APP_FREEZE_NO_RESTART
).
assertEqual
(
0x0004
);
expect
(
appRecovery
.
RestartFlag
.
NO_RESTART
).
assertEqual
(
0xFFFF
);
expect
(
appRecovery
.
RestartFlag
.
NO_RESTART
).
assertEqual
(
0xFFFF
);
expect
(
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_ERROR
).
assertEqual
(
0x0001
);
expect
(
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_ERROR
).
assertEqual
(
0x0001
);
expect
(
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_BACKGROUND
).
assertEqual
(
0x0002
);
expect
(
appRecovery
.
SaveOccasionFlag
.
SAVE_WHEN_BACKGROUND
).
assertEqual
(
0x0002
);
expect
(
appRecovery
.
SaveModeFlag
.
SAVE_WITH_FILE
).
assertEqual
(
0x0001
);
expect
(
appRecovery
.
SaveModeFlag
.
SAVE_WITH_FILE
).
assertEqual
(
0x0001
);
expect
(
appRecovery
.
SaveModeFlag
.
SAVE_WITH_SHARED_MEMORY
).
assertEqual
(
0x0002
);
expect
(
appRecovery
.
SaveModeFlag
.
SAVE_WITH_SHARED_MEMORY
).
assertEqual
(
0x0002
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2
2
00 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2
0
00 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2
2
00 end
"
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2
0
00 end
"
);
})
})
/**
/**
* @tc.number: DFX_DFR_AppRecovery_Interface_2
3
00
* @tc.number: DFX_DFR_AppRecovery_Interface_2
1
00
* @tc.name: 检验AbilityConstant属性返回值是否符合预期
* @tc.name: 检验AbilityConstant属性返回值是否符合预期
* @tc.desc: appRecovery interface test.
* @tc.desc: appRecovery interface test.
*/
*/
it
(
"
DFX_DFR_AppRecovery_Interface_2
3
00
"
,
0
,
function
()
{
it
(
"
DFX_DFR_AppRecovery_Interface_2
1
00
"
,
0
,
function
()
{
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_2
3
00 start-------------------------
"
);
console
.
info
(
"
-------------------------DFX_DFR_AppRecovery_Interface_2
1
00 start-------------------------
"
);
try
{
try
{
expect
(
AbilityConstant
.
LaunchReason
.
APP_RECOVERY
).
assertEqual
(
4
);
expect
(
AbilityConstant
.
LaunchReason
.
APP_RECOVERY
).
assertEqual
(
4
);
expect
(
AbilityConstant
.
OnSaveResult
.
ALL_AGREE
).
assertEqual
(
0
);
expect
(
AbilityConstant
.
OnSaveResult
.
ALL_AGREE
).
assertEqual
(
0
);
...
@@ -419,10 +386,10 @@ describe("ActsAppRecoveryTest", function () {
...
@@ -419,10 +386,10 @@ describe("ActsAppRecoveryTest", function () {
expect
(
AbilityConstant
.
OnSaveResult
.
RECOVERY_AGREE
).
assertEqual
(
3
);
expect
(
AbilityConstant
.
OnSaveResult
.
RECOVERY_AGREE
).
assertEqual
(
3
);
expect
(
AbilityConstant
.
OnSaveResult
.
RECOVERY_REJECT
).
assertEqual
(
4
);
expect
(
AbilityConstant
.
OnSaveResult
.
RECOVERY_REJECT
).
assertEqual
(
4
);
}
catch
(
error
){
}
catch
(
error
){
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2
3
00 err =
"
+
error
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2
1
00 err =
"
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2
3
00 end
"
);
console
.
info
(
"
DFX_DFR_AppRecovery_Interface_2
1
00 end
"
);
})
})
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录