Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e8ba02b8
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看板
未验证
提交
e8ba02b8
编写于
4月 19, 2023
作者:
O
openharmony_ci
提交者:
Gitee
4月 19, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8308 应用故障恢复d.ts修改相关ST修改
Merge pull request !8308 from xinking129/master
上级
dfdb98ac
452ea817
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
23 addition
and
99 deletion
+23
-99
ability/ability_runtime/apprecovery/ActsAppRecoveryTestCaller/entry/src/main/ets/test/Ability.test.ets
...coveryTestCaller/entry/src/main/ets/test/Ability.test.ets
+23
-99
未找到文件。
ability/ability_runtime/apprecovery/ActsAppRecoveryTestCaller/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
e8ba02b8
...
...
@@ -17,6 +17,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import commonEvent from '@ohos.commonEvent'
import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import missionManager from '@ohos.application.missionManager';
import wantConstant from '@ohos.app.ability.wantConstant'
const CASE_TIME_OUT=5000;
var ACTS_AppRecovery = {
...
...
@@ -25,10 +26,6 @@ var ACTS_AppRecovery = {
export default function abilityTest() {
describe('ActsAbilityTest', function () {
beforeAll(function () {})
beforeEach(function () {})
afterEach(function () {})
afterAll(function () {})
/*
* @tc.number: Acts_AppRecovery_0100
...
...
@@ -58,11 +55,7 @@ export default function abilityTest() {
function subscribeCallBack(err, data) {
console.debug("Acts_AppRecovery_0100====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
setTimeout(() => {
commonEvent.subscribe(subscriber, subscribeCallBackSecond);
globalThis.abilityContext.startAbility(
...
...
@@ -84,11 +77,7 @@ export default function abilityTest() {
console.debug("Acts_AppRecovery_0100====> second subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_Second") {
flag=true;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
commonEvent.unsubscribe(subscriber, unSubscribeCallback);
}
}
...
...
@@ -139,11 +128,7 @@ export default function abilityTest() {
console.debug("Acts_AppRecovery_0200====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
countFirst++;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
if (countFirst < 2) {
return;
}
...
...
@@ -169,11 +154,7 @@ export default function abilityTest() {
if(data.event == "ACTS_AppRecovery_Second") {
countSecond++;
flag=true;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
if (countSecond == 2) {
commonEvent.unsubscribe(subscriber, unSubscribeCallback);
}
...
...
@@ -223,11 +204,7 @@ export default function abilityTest() {
function subscribeCallBack(err, data) {
console.debug("Acts_AppRecovery_0300====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
missionManager.getMissionInfos('', 1024, (err, missionInfos)=>{
console.debug('Acts_AppRecovery_0300====> missionInfos: ' + JSON.stringify(missionInfos));
console.debug('Acts_AppRecovery_0300====> missionInfos.length: ' + JSON.stringify(missionInfos.length));
...
...
@@ -258,11 +235,7 @@ export default function abilityTest() {
console.debug("Acts_AppRecovery_0300====> second subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_Second") {
flag=true;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
commonEvent.unsubscribe(subscriber, unSubscribeCallback);
}
}
...
...
@@ -311,11 +284,7 @@ export default function abilityTest() {
console.debug("Acts_AppRecovery_0400====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
countFirst++;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
if (countFirst < 2) {
return;
}
...
...
@@ -351,11 +320,7 @@ export default function abilityTest() {
if(data.event == "ACTS_AppRecovery_Second") {
countSecond++;
flag=true;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
if (countSecond < 2) {
return;
}
...
...
@@ -404,11 +369,7 @@ export default function abilityTest() {
function subscribeCallBack(err, data) {
console.debug("Acts_AppRecovery_0700====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
setTimeout(()=>{
commonEvent.subscribe(subscriber, subscribeCallBackSecond);
globalThis.abilityContext.startAbility(
...
...
@@ -428,11 +389,7 @@ export default function abilityTest() {
console.debug("Acts_AppRecovery_0700====> second subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_Second") {
flag=true;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
commonEvent.unsubscribe(subscriber, unSubscribeCallback);
}
}
...
...
@@ -483,11 +440,7 @@ export default function abilityTest() {
console.debug("Acts_AppRecovery_0800====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
countFirst++;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
if (countFirst < 2) {
return;
}
...
...
@@ -513,11 +466,7 @@ export default function abilityTest() {
if(data.event == "ACTS_AppRecovery_Second") {
countSecond++;
flag=true;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
if (countSecond < 2) {
return;
}
...
...
@@ -568,11 +517,7 @@ export default function abilityTest() {
function subscribeCallBack(err, data) {
console.debug("Acts_AppRecovery_0900====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
let abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator();
let pkillCmd = "pkill -f com.example.apprecoveryrely";
console.debug("Acts_AppRecovery_0900====> shell command call " + pkillCmd);
...
...
@@ -600,11 +545,7 @@ export default function abilityTest() {
console.debug("Acts_AppRecovery_0900====> second subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_Second") {
flag=true;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
commonEvent.unsubscribe(subscriber, unSubscribeCallback);
}
}
...
...
@@ -655,11 +596,7 @@ export default function abilityTest() {
console.debug("Acts_AppRecovery_1000====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
countFirst++;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
if (countFirst < 2) {
return;
}
...
...
@@ -689,11 +626,7 @@ export default function abilityTest() {
if(data.event == "ACTS_AppRecovery_Second") {
countSecond++;
flag=true;
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
if (countSecond < 2) {
return;
}
...
...
@@ -744,11 +677,7 @@ export default function abilityTest() {
function subscribeCallBack(err, data) {
console.debug("Acts_AppRecovery_1100====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
let abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator();
let pkillCmd = "pkill -f com.example.apprecoveryrely";
abilityDelegator.executeShellCommand(pkillCmd, 1, (err, data) => {
...
...
@@ -775,7 +704,8 @@ export default function abilityTest() {
if(data.event == "ACTS_AppRecovery_Second") {
flag=true;
let message = data.parameters.message;
expect(message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertTrue();
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART] != undefined).assertTrue();
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertTrue();
commonEvent.unsubscribe(subscriber, unSubscribeCallback);
}
}
...
...
@@ -826,13 +756,7 @@ export default function abilityTest() {
console.debug("Acts_AppRecovery_1200====> subscribeCallBack data:" + JSON.stringify(data));
if(data.event == "ACTS_AppRecovery_First") {
countFirst++;
let message = data.parameters.message;
let strJson = JSON.stringify(data.parameters.message);
if (data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"] == undefined) {
expect(true).assertTrue();
} else {
expect(data.parameters.message["ohos.aafwk.param.AbilityRecoveryRestart"]).assertFalse();
}
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART]).assertEqual(undefined);
if (countFirst < 2) {
return;
}
...
...
@@ -862,8 +786,8 @@ export default function abilityTest() {
if(data.event == "ACTS_AppRecovery_Second") {
countSecond++;
flag=true;
let message = data.parameters.message
;
expect(
message["ohos.aafwk.param.AbilityRecoveryRestart"
]).assertTrue();
expect(data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART] != undefined).assertTrue()
;
expect(
data.parameters.message[wantConstant.Params.ABILITY_RECOVERY_RESTART
]).assertTrue();
if (countSecond < 2) {
return;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录