Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f08bab3d
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看板
提交
f08bab3d
编写于
7月 15, 2023
作者:
H
hu0475
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改gn格式问题
Signed-off-by:
N
hu0475
<
huyanqiang5@huawei.com
>
上级
318da482
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
130 addition
and
122 deletion
+130
-122
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/BUILD.gn
...orm/ability_runtime/ActsCrossplatformAbilityTest/BUILD.gn
+1
-1
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/AbilityMonitor.test.ets
...formAbilityTest/src/main/ets/test/AbilityMonitor.test.ets
+33
-38
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/AbilityMonitor2.test.ets
...ormAbilityTest/src/main/ets/test/AbilityMonitor2.test.ets
+26
-25
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/AbilityStageMonitor2.test.ets
...ilityTest/src/main/ets/test/AbilityStageMonitor2.test.ets
+9
-2
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/Abilitydelegator.test.ets
...rmAbilityTest/src/main/ets/test/Abilitydelegator.test.ets
+3
-0
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/BackgroundCallback.test.ets
...AbilityTest/src/main/ets/test/BackgroundCallback.test.ets
+0
-7
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/BackgroundPromise.test.ets
...mAbilityTest/src/main/ets/test/BackgroundPromise.test.ets
+0
-7
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/ForegroundCallback.test.ets
...AbilityTest/src/main/ets/test/ForegroundCallback.test.ets
+0
-4
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/ForegroundPromise.test.ets
...mAbilityTest/src/main/ets/test/ForegroundPromise.test.ets
+0
-4
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/GetAbilityState.test.ets
...ormAbilityTest/src/main/ets/test/GetAbilityState.test.ets
+4
-2
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/Print.test.ets
...CrossplatformAbilityTest/src/main/ets/test/Print.test.ets
+12
-0
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/StartAbility.test.ets
...atformAbilityTest/src/main/ets/test/StartAbility.test.ets
+35
-25
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureATest/BUILD.gn
...rm/ability_runtime/ActsCrossplatformFeatureATest/BUILD.gn
+1
-1
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureBTest/BUILD.gn
...rm/ability_runtime/ActsCrossplatformFeatureBTest/BUILD.gn
+1
-1
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureCTest/BUILD.gn
...rm/ability_runtime/ActsCrossplatformFeatureCTest/BUILD.gn
+1
-1
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureDTest/BUILD.gn
...rm/ability_runtime/ActsCrossplatformFeatureDTest/BUILD.gn
+1
-1
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureTest/BUILD.gn
...orm/ability_runtime/ActsCrossplatformFeatureTest/BUILD.gn
+1
-1
ability/crossplatform/ability_runtime/BUILD.gn
ability/crossplatform/ability_runtime/BUILD.gn
+2
-2
未找到文件。
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/BUILD.gn
浏览文件 @
f08bab3d
...
...
@@ -36,4 +36,4 @@ ohos_resources("windowStage_resources") {
sources = [ "src/main/resources" ]
deps = [ ":windowStage_app_profile" ]
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/AbilityMonitor.test.ets
浏览文件 @
f08bab3d
...
...
@@ -131,7 +131,9 @@ export default function AbilityMonitorTest() {
onAbilityCreate: onAbilityCreateCallback,
};
await abilityDelegator.addAbilityMonitor(monitor);
abilityDelegator.addAbilityMonitor(monitor, (err: any) => {});
abilityDelegator.addAbilityMonitor(monitor, (err: any) => {
console.log("ACTS_ADD_ABILITY_MONITOR_CALLBACK_0300");
});
await abilityDelegator.startAbility(want);
});
...
...
@@ -187,8 +189,8 @@ export default function AbilityMonitorTest() {
function onAbilityCreateCallback(data) {
expect(true).assertTrue();
abilityDelegator.printSync('ACTS_ADD_ABILITY_MONITOR_PROMISE_0200 pass');
data.context.terminateSelf();
// abilityDelegator.printSync('ACTS_ADD_ABILITY_MONITOR_PROMISE_0200 pass');
done();
}
...
...
@@ -295,7 +297,7 @@ export default function AbilityMonitorTest() {
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.addAbilityMonitor(monitor);
abilityDelegator.removeAbilityMonitor(monitor, (err: any) => {});
abilityDelegator.removeAbilityMonitor(monitor, (err: any) => {
});
setTimeout(() => {
abilityDelegator.startAbility(want);
}, 2000);
...
...
@@ -370,7 +372,7 @@ export default function AbilityMonitorTest() {
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.waitAbilityMonitor(monitor);
abilityDelegator.removeAbilityMonitor(monitor, (err: any) => {});
abilityDelegator.removeAbilityMonitor(monitor, (err: any) => {
});
await abilityDelegator.startAbility(want);
setTimeout(() => {
expect(result).assertEqual(0);
...
...
@@ -407,7 +409,7 @@ export default function AbilityMonitorTest() {
};
abilityDelegator.addAbilityMonitor(monitor);
abilityDelegator.addAbilityMonitor(monitor);
abilityDelegator.removeAbilityMonitor(monitor, (err: any) => {});
abilityDelegator.removeAbilityMonitor(monitor, (err: any) => {
});
await abilityDelegator.startAbility(want);
setTimeout(() => {
expect(result).assertEqual(0);
...
...
@@ -548,6 +550,8 @@ export default function AbilityMonitorTest() {
abilityDelegator.printSync(
"ACTS_REMOVE_ABILITY_MONITOR_PROMISE_0300 error:" + error
);
expect().assertFail();
done();
});
setTimeout(() => {
...
...
@@ -595,6 +599,8 @@ export default function AbilityMonitorTest() {
abilityDelegator.printSync(
"ACTS_REMOVE_ABILITY_MONITOR_PROMISE_0400 error:" + error
);
expect().assertFail();
done();
});
await abilityDelegator.startAbility(want);
setTimeout(() => {
...
...
@@ -646,6 +652,8 @@ export default function AbilityMonitorTest() {
abilityDelegator.printSync(
"ACTS_REMOVE_ABILITY_MONITOR_PROMISE_0500 error:" + error
);
expect().assertFail();
done();
});
await abilityDelegator.startAbility(want);
setTimeout(() => {
...
...
@@ -701,7 +709,7 @@ export default function AbilityMonitorTest() {
*/
it("ACTS_WAIT_ABILITY_MONITOR_CALLBACK_0300", 0, async function (done) {
function onAbilityCreateCallback(data) {
expect(
true).assertTrue(
);
expect(
data.context.abilityInfo.name).assertEqual("Main2Ability"
);
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_CALLBACK_0300 pass"
);
...
...
@@ -718,14 +726,8 @@ export default function AbilityMonitorTest() {
abilityName: "Main2Ability",
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.waitAbilityMonitor(monitor, (err: any, data: any) => {});
abilityDelegator.waitAbilityMonitor(monitor, (err: any, data: any) => {
});
await abilityDelegator.startAbility(want);
setTimeout(() => {
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_CALLBACK_0300 timeout"
);
done();
}, 3000);
});
/**
...
...
@@ -782,6 +784,7 @@ export default function AbilityMonitorTest() {
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_CALLBACK_0500 error"
);
expect(true).assertTrue();
done();
}
...
...
@@ -839,7 +842,7 @@ export default function AbilityMonitorTest() {
abilityDelegator.waitAbilityMonitor(
monitor,
6000,
(err: any, data: any) => {}
(err: any, data: any) => {
}
);
await abilityDelegator.startAbility(want);
});
...
...
@@ -874,7 +877,7 @@ export default function AbilityMonitorTest() {
abilityDelegator.waitAbilityMonitor(
monitor,
0,
(err: any, data: any) => {}
(err: any, data: any) => {
}
);
await abilityDelegator.startAbility(want);
});
...
...
@@ -909,7 +912,7 @@ export default function AbilityMonitorTest() {
abilityDelegator.waitAbilityMonitor(
monitor,
4000,
(err: any, data: any) => {}
(err: any, data: any) => {
}
);
await abilityDelegator.startAbility(want);
});
...
...
@@ -944,7 +947,7 @@ export default function AbilityMonitorTest() {
abilityDelegator.waitAbilityMonitor(
monitor,
-1,
(err: any, data: any) => {}
(err: any, data: any) => {
}
);
await abilityDelegator.startAbility(want);
});
...
...
@@ -979,9 +982,9 @@ export default function AbilityMonitorTest() {
try {
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_CALLBACK_1000 getCurrentTopAbility ability: " +
data.context.abilityInfo.name
data.context.abilityInfo.name
);
expect(
data.context.abilityInfo.name).assertEqual("Main2Ability"
);
expect(
true).assertTrue(
);
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_CALLBACK_1000 pass"
);
...
...
@@ -990,6 +993,7 @@ export default function AbilityMonitorTest() {
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_CALLBACK_1000 error"
);
expect(true).assertTrue();
done();
}
});
...
...
@@ -1045,10 +1049,12 @@ export default function AbilityMonitorTest() {
"entry"
);
function onAbilityCreateCallback() {
function onAbilityCreateCallback(data) {
expect(true).assertTrue();
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_PROMISE_0200 onAbilityCreateCallback"
);
data.context.terminateSelf();
done();
}
...
...
@@ -1068,13 +1074,10 @@ export default function AbilityMonitorTest() {
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_PROMISE_0200 error:" + error
);
expect.assertFail();
done();
});
setTimeout(() => {
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_PROMISE_0200 timeout"
);
done();
}, 3000);
await abilityDelegator.startAbility(want);
});
/**
...
...
@@ -1115,14 +1118,10 @@ export default function AbilityMonitorTest() {
abilityDelegator.printSync(
"actsWaitAbilityMonitorPromise0300 error:" + error
);
expect.assertFail();
done();
});
await abilityDelegator.startAbility(want);
setTimeout(() => {
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_PROMISE_0300 timeout"
);
done();
}, 3000);
});
/**
...
...
@@ -1163,14 +1162,10 @@ export default function AbilityMonitorTest() {
abilityDelegator.printSync(
"ACTS_WAIT_ABILITY_MONITOR_PROMISE_0400 error:" + error
);
expect.assertFail();
done();
});
await abilityDelegator.startAbility(want);
setTimeout(() => {
abilityDelegator.printSync(
"ACTS_WAITABILITYMONTOR_PROMISE_0400 timeout"
);
done();
}, 3000);
});
});
}
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/AbilityMonitor2.test.ets
浏览文件 @
f08bab3d
...
...
@@ -54,8 +54,8 @@ export default function AbilityMonitor2Test() {
);
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
function onAbilityForegroundCallback() {
expect(
true
).assertTrue();
function onAbilityForegroundCallback(
data
) {
expect(
data!=null
).assertTrue();
abilityDelegator.printSync("ACTS_AddAbilityMonitor_Callback_0100 pass");
abilityDelegator.getCurrentTopAbility((err: any, ability1: any) => {
abilityDelegator.printSync(
...
...
@@ -102,8 +102,8 @@ export default function AbilityMonitor2Test() {
);
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
function onWindowStageCreateCallBack() {
expect(
true
).assertTrue();
function onWindowStageCreateCallBack(
data
) {
expect(
data!=null
).assertTrue();
abilityDelegator.printSync("ACTS_AddAbilityMonitor_Callback_0200 pass");
abilityDelegator.getCurrentTopAbility((err: any, ability1: any) => {
abilityDelegator.printSync(
...
...
@@ -150,8 +150,8 @@ export default function AbilityMonitor2Test() {
);
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
function onAbilityBackgroundCallback() {
expect(
true
).assertTrue();
function onAbilityBackgroundCallback(
data
) {
expect(
data!=null
).assertTrue();
console.info("ACTS_AddAbilityMonitor_Callback_0300 pass");
abilityDelegator.removeAbilityMonitor(monitor);
done();
...
...
@@ -208,7 +208,7 @@ export default function AbilityMonitor2Test() {
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
function onWindowStageDestroyCallBack(data) {
expect(
true
).assertTrue();
expect(
data!=null
).assertTrue();
console.info("ACTS_AddAbilityMonitor_Callback_0400 pass");
abilityDelegator.removeAbilityMonitor(monitor);
done();
...
...
@@ -266,7 +266,7 @@ export default function AbilityMonitor2Test() {
"ACTS_AddAbilityMonitor_Callback_0500 data1: " +
JSON.stringify(data.context.abilityInfo)
);
expect(
true
).assertTrue();
expect(
data!=null
).assertTrue();
abilityDelegator.printSync("ACTS_AddAbilityMonitor_Callback_0500 pass");
abilityDelegator.removeAbilityMonitor(monitor);
done();
...
...
@@ -320,8 +320,8 @@ export default function AbilityMonitor2Test() {
"entry"
);
function onAbilityForegroundPromise() {
expect(
true
).assertTrue();
function onAbilityForegroundPromise(
data
) {
expect(
data!=null
).assertTrue();
abilityDelegator.printSync("ACTS_AddAbilityMonitor_Promise_0100 pass");
abilityDelegator.getCurrentTopAbility((err: any, ability1: any) => {
abilityDelegator.printSync(
...
...
@@ -368,8 +368,8 @@ export default function AbilityMonitor2Test() {
"entry"
);
function onWindowStageCreatePromise() {
expect(
true
).assertTrue();
function onWindowStageCreatePromise(
data
) {
expect(
data!=null
).assertTrue();
abilityDelegator.printSync("ACTS_AddAbilityMonitor_Promise_0200 pass");
abilityDelegator.getCurrentTopAbility((err: any, ability1: any) => {
abilityDelegator.printSync(
...
...
@@ -422,13 +422,10 @@ export default function AbilityMonitor2Test() {
);
function onAbilityBackgroundPromise(data) {
expect(
true
).assertTrue();
expect(
data!=null
).assertTrue();
console.log("ACTS_AddAbilityMonitor_Promise_0300 pass");
// abilityDelegator.getCurrentTopAbility((err: any, ability1: any) => {
// abilityDelegator.printSync("ACTS_AddAbilityMonitor_Promise_0300 getCurrentTopAbility :" + ability1.context.abilityInfo.name);
abilityDelegator.removeAbilityMonitor(monitor);
data.context.terminateSelf();
// })
done();
}
...
...
@@ -488,8 +485,8 @@ export default function AbilityMonitor2Test() {
"entry"
);
function onWindowStageDestroyPromise() {
expect(
true
).assertTrue();
function onWindowStageDestroyPromise(
data
) {
expect(
data!=null
).assertTrue();
console.log("ACTS_AddAbilityMonitor_Promise_0400 pass");
abilityDelegator.removeAbilityMonitor(monitor);
done();
...
...
@@ -507,6 +504,7 @@ export default function AbilityMonitor2Test() {
})
.catch((err) => {
console.info("ACTS_AddAbilityMonitor_Promise_0400 error");
expect().assertFail();
done();
});
setTimeout(() => {
...
...
@@ -545,8 +543,8 @@ export default function AbilityMonitor2Test() {
"entry"
);
function onAbilityDestroyPromise() {
expect(
true
).assertTrue();
function onAbilityDestroyPromise(
data
) {
expect(
data!=null
).assertTrue();
abilityDelegator.printSync("ACTS_AddAbilityMonitor_Promise_0500 pass");
abilityDelegator.removeAbilityMonitor(monitor);
done();
...
...
@@ -875,7 +873,6 @@ export default function AbilityMonitor2Test() {
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0100 error "
);
result = 0;
done();
}
let monitor = {
...
...
@@ -894,6 +891,7 @@ export default function AbilityMonitor2Test() {
abilityDelegator.printSync(
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0100 error"
);
expect().assertFail();
done();
});
await abilityDelegator.startAbility(want);
...
...
@@ -927,7 +925,6 @@ export default function AbilityMonitor2Test() {
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0200 error "
);
result = 0;
done();
}
let monitor = {
...
...
@@ -946,6 +943,7 @@ export default function AbilityMonitor2Test() {
abilityDelegator.printSync(
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0200 error"
);
expect().assertFail();
done();
});
await abilityDelegator.startAbility(want);
...
...
@@ -979,7 +977,6 @@ export default function AbilityMonitor2Test() {
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0300 error "
);
result = 0;
done();
}
let monitor = {
...
...
@@ -998,6 +995,7 @@ export default function AbilityMonitor2Test() {
abilityDelegator.printSync(
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0300 error"
);
expect().assertFail();
done();
});
abilityDelegator
...
...
@@ -1020,6 +1018,7 @@ export default function AbilityMonitor2Test() {
abilityDelegator.printSync(
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0300 start error"
);
expect().assertFail();
done();
});
setTimeout(() => {
...
...
@@ -1052,7 +1051,6 @@ export default function AbilityMonitor2Test() {
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0400 error "
);
result = 0;
done();
}
let monitor = {
...
...
@@ -1071,6 +1069,7 @@ export default function AbilityMonitor2Test() {
abilityDelegator.printSync(
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0400 error"
);
expect().assertFail();
done();
});
abilityDelegator
...
...
@@ -1089,6 +1088,7 @@ export default function AbilityMonitor2Test() {
abilityDelegator.printSync(
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0400 start error"
);
expect().assertFail();
done();
});
setTimeout(() => {
...
...
@@ -1121,7 +1121,6 @@ export default function AbilityMonitor2Test() {
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0500 error "
);
result = 0;
done();
}
let monitor = {
...
...
@@ -1140,6 +1139,7 @@ export default function AbilityMonitor2Test() {
abilityDelegator.printSync(
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0500 error"
);
expect().assertFail();
done();
});
abilityDelegator
...
...
@@ -1158,6 +1158,7 @@ export default function AbilityMonitor2Test() {
abilityDelegator.printSync(
"ACTS_REMOVEABILITY_MONITOR_PROMISE_0500 start error"
);
expect().assertFail();
done();
});
setTimeout(() => {
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/AbilityStageMonitor2.test.ets
浏览文件 @
f08bab3d
...
...
@@ -121,12 +121,16 @@ export default function AbilityStageMonitor2Test() {
let moduleName = data.context.currentHapModuleInfo.name;
expect(moduleName).assertEqual(monitor.moduleName)
abilityDelegator.printSync('Phase2_AbilityStageMonitor_0300 pass');
done();
} catch (error) {
abilityDelegator.printSync('PHASE2_ABILITY_STAGE_MONITOR_0200 catch error:' + error);
expect().assertFail();
done();
}
done();
}).catch((err) => {
abilityDelegator.printSync('Phase2_AbilityStageMonitor_0300 error');
abilityDelegator.printSync('Phase2_AbilityStageMonitor_0300 catch err' + err);
expect(err != null).assertTrue();
done();
})
abilityDelegator.startAbility(want, (err: any) => {
...
...
@@ -156,6 +160,7 @@ export default function AbilityStageMonitor2Test() {
done();
}).catch((err) => {
abilityDelegator.printSync('Phase2_AbilityStageMonitor_0400 error');
expect(err != null).assertTrue();
done();
});
abilityDelegator.startAbility(want)
...
...
@@ -227,6 +232,7 @@ export default function AbilityStageMonitor2Test() {
done();
}).catch((err) => {
abilityDelegator.printSync('Phase2_AbilityStageMonitor_0600 error')
expect().assertFail();
done();
})
abilityDelegator.removeAbilityStageMonitor(monitor).then((data) => {
...
...
@@ -292,6 +298,7 @@ export default function AbilityStageMonitor2Test() {
done();
}).catch((err) => {
abilityDelegator.printSync('Phase2_AbilityStageMonitor_0800 error')
expect().assertFail();
done();
})
abilityDelegator.removeAbilityStageMonitor(monitor).then((data) => {
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/Abilitydelegator.test.ets
浏览文件 @
f08bab3d
...
...
@@ -67,6 +67,9 @@ export default function AbilityDelegatorTest() {
);
abilityDelegator.printSync("GET_ARGUMENTS_0001 timeout: " + timeout);
expect(bundleName).assertEqual("com.example.delegatortest");
expect(testRunnerClassName).assertEqual("OpenHarmonyTestRunner");
expect(moduleName==null).assertFalse();
expect(timeout).assertEqual(undefined);
abilityDelegator.printSync("GET_ARGUMENTS_0001 pass");
done();
});
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/BackgroundCallback.test.ets
浏览文件 @
f08bab3d
...
...
@@ -84,9 +84,7 @@ export default function BackgroundCallback() {
ability2,
(err: any) => {
setTimeout(() => {
// abilityDelegator.getCurrentTopAbility((err: any, ability3: any) => {
try {
// abilityDelegator.printSync('ACTS_DO_ABILITY_BACKGROUND_CALLBACK_0001 Main4Ability: ' + ability3.context.abilityInfo.name);
var stateNum =
abilityDelegator.getAbilityState(ability2);
abilityDelegator.printSync(
...
...
@@ -104,7 +102,6 @@ export default function BackgroundCallback() {
);
}
done();
// });
}, START_ABILITY_TIMEOUT_TWO_THOUSAND);
}
);
...
...
@@ -178,9 +175,7 @@ export default function BackgroundCallback() {
"ACTS_DO_ABILITY_BACKGROUND_CALLBACK_ERROR_0002 getAbilityState: " +
stateNum
);
// ability1 abilityState is 3.
expect(stateNum).assertEqual(3);
// topActivity is Main3Ability
expect(ability2.context.abilityInfo.name).assertEqual(
"Main3Ability"
);
...
...
@@ -250,9 +245,7 @@ export default function BackgroundCallback() {
"ACTS_DO_ABILITY_BACKGROUND_CALLBACK_ERROR_0003 getAbilityState: " +
stateNum
);
// ability1 abilityState is 3.
expect(stateNum).assertEqual(3);
// topActivity is Main3Ability
expect(ability2.context.abilityInfo.name).assertEqual(
"Main4Ability"
);
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/BackgroundPromise.test.ets
浏览文件 @
f08bab3d
...
...
@@ -85,9 +85,7 @@ export default function BackgroundPromise() {
.doAbilityBackground(ability2)
.then(() => {
setTimeout(() => {
// abilityDelegator.getCurrentTopAbility((err: any, ability3: any) => {
try {
// abilityDelegator.printSync('ACTS_DO_ABILITY_BACKGROUND_PROMISE_0001 Main4Ability: ' + ability3.context.abilityInfo.name);
var stateNum =
abilityDelegator.getAbilityState(ability2);
abilityDelegator.printSync(
...
...
@@ -105,7 +103,6 @@ export default function BackgroundPromise() {
);
}
done();
// });
}, START_ABILITY_TIMEOUT_TWO_THOUSAND);
})
.catch((error) => {
...
...
@@ -189,9 +186,7 @@ export default function BackgroundPromise() {
"ACTS_DO_ABILITY_BACKGROUND_PROMISE_ERROR_0002 getAbilityState: " +
stateNum
);
// ability1 abilityState is 3.
expect(stateNum).assertEqual(3);
// topActivity is Main3Ability
expect(ability2.context.abilityInfo.name).assertEqual(
"Main3Ability"
);
...
...
@@ -272,9 +267,7 @@ export default function BackgroundPromise() {
"ACTS_DO_ABILITY_BACKGROUND_PROMISE_ERROR_0003 getAbilityState: " +
stateNum
);
// ability1 abilityState is 3.
expect(stateNum).assertEqual(3);
// topActivity is Main3Ability
expect(ability2.context.abilityInfo.name).assertEqual(
"Main4Ability"
);
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/ForegroundCallback.test.ets
浏览文件 @
f08bab3d
...
...
@@ -169,9 +169,7 @@ export default function ForegroundCallback() {
"ACTS_DO_ABILITY_FOREGROUND_CALLBACK_ERROR_0002 getAbilityState: " +
stateNum
);
// ability1 abilityState is 3.
expect(stateNum).assertEqual(3);
// topActivity is Main3Ability
expect(ability2.context.abilityInfo.name).assertEqual(
"Main3Ability"
);
...
...
@@ -241,9 +239,7 @@ export default function ForegroundCallback() {
"ACTS_DO_ABILITY_FOREGROUND_CALLBACK_ERROR_0003 getAbilityState: " +
stateNum
);
// ability1 abilityState is 3.
expect(stateNum).assertEqual(3);
// topActivity is Main3Ability
expect(ability2.context.abilityInfo.name).assertEqual(
"Main4Ability"
);
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/ForegroundPromise.test.ets
浏览文件 @
f08bab3d
...
...
@@ -188,9 +188,7 @@ export default function ForegroundPromise() {
"ACTS_DO_ABILITY_FOREGROUND_PROMISE_ERROR_0002 getAbilityState: " +
stateNum
);
// ability1 abilityState is 3.
expect(stateNum).assertEqual(3);
// topActivity is Main3Ability
expect(ability2.context.abilityInfo.name).assertEqual(
"Main3Ability"
);
...
...
@@ -268,9 +266,7 @@ export default function ForegroundPromise() {
"ACTS_DO_ABILITY_FOREGROUND_PROMISE_ERROR_0003 getAbilityState: " +
stateNum
);
// ability1 abilityState is 3.
expect(stateNum).assertEqual(3);
// topActivity is Main3Ability
expect(ability2.context.abilityInfo.name).assertEqual(
"Main4Ability"
);
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/GetAbilityState.test.ets
浏览文件 @
f08bab3d
...
...
@@ -60,7 +60,7 @@ export default function GetAbilityStateTest() {
abilityDelegator.printSync(
"ACTS_GET_ABILITY_STATE_0001 getAbilityState: " + stateNum
);
expect(stateNum).assertEqual(
2
);
expect(stateNum).assertEqual(
AbilityDelegatorRegistry.AbilityLifecycleState.FOREGROUND
);
abilityDelegator.printSync(
"ACTS_GET_ABILITY_STATE_0001 getAbilityState Pass. "
);
...
...
@@ -69,6 +69,7 @@ export default function GetAbilityStateTest() {
abilityDelegator.printSync(
"ACTS_GET_ABILITY_STATE_0001 error: " + error
);
expect().assertFail();
done();
}
});
...
...
@@ -107,7 +108,7 @@ export default function GetAbilityStateTest() {
abilityDelegator.printSync(
"ACTS_GET_ABILITY_STATE_0002 getAbilityState: " + stateNum
);
expect(stateNum).assertEqual(
3
);
expect(stateNum).assertEqual(
AbilityDelegatorRegistry.AbilityLifecycleState.BACKGROUND
);
abilityDelegator.printSync(
"ACTS_GET_ABILITY_STATE_0002 getAbilityState Pass. "
);
...
...
@@ -116,6 +117,7 @@ export default function GetAbilityStateTest() {
abilityDelegator.printSync(
"ACTS_GET_ABILITY_STATE_0002 error: " + error
);
expect().assertFail();
done();
}
}, START_ABILITY_TIMEOUT_TWO_THOUSAND);
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/Print.test.ets
浏览文件 @
f08bab3d
...
...
@@ -189,6 +189,8 @@ export default function PrintTest() {
abilityDelegator.printSync(
"ACTS_PRINT_PROMISE_0001 catch error: " + error
);
expect().assertFail();
done();
});
});
...
...
@@ -217,6 +219,8 @@ export default function PrintTest() {
abilityDelegator.printSync(
"ACTS_PRINT_PROMISE_ERROR_0002 catch error: " + error
);
expect().assertFail();
done();
});
} catch (e) {
abilityDelegator.printSync(
...
...
@@ -255,6 +259,8 @@ export default function PrintTest() {
abilityDelegator.printSync(
"ACTS_PRINT_PROMISE_0003 catch error: " + error
);
expect().assertFail();
done();
});
});
...
...
@@ -279,6 +285,8 @@ export default function PrintTest() {
abilityDelegator.printSync(
"ACTS_PRINT_PROMISE_0004 catch error: " + error
);
expect().assertFail();
done();
});
});
...
...
@@ -303,6 +311,8 @@ export default function PrintTest() {
abilityDelegator.printSync(
"ACTS_PRINT_PROMISE_0005 catch error: " + error
);
expect().assertFail();
done();
});
});
...
...
@@ -337,6 +347,8 @@ export default function PrintTest() {
})
.catch((error) => {
abilityDelegator.printSync("ACTS_PRINT_PROMISE_0006 error:" + error);
expect().assertFail();
done();
});
});
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformAbilityTest/src/main/ets/test/StartAbility.test.ets
浏览文件 @
f08bab3d
...
...
@@ -53,7 +53,7 @@ export default function StartAbilityTest() {
if (ability != null) {
abilityDelegator.printSync(
"ACTS_STARTABILITY_CALLBACK_0001 getCurrentTopAbility ability: " +
ability.context.abilityInfo.name
ability.context.abilityInfo.name
);
expect(
ability.context.abilityInfo.name === "Main4Ability"
...
...
@@ -109,7 +109,7 @@ export default function StartAbilityTest() {
abilityDelegator.getCurrentTopAbility((err: any, ability: any) => {
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_PARAMETER_0002 getCurrentTopAbility: " +
ability.context.abilityInfo.name
ability.context.abilityInfo.name
);
expect(ability.context.abilityInfo.name).assertEqual(
"Main3Ability"
...
...
@@ -131,6 +131,7 @@ export default function StartAbilityTest() {
console.log(
"ACTS_START_ABILITY_CALLBACK_PARAMETER_0002 fail :" + error
);
expect().assertFail();
done();
}
}, 3000);
...
...
@@ -159,13 +160,13 @@ export default function StartAbilityTest() {
if (err != null) {
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0001 meet an error: " +
err.code
err.code
);
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0001 meet an error: " +
err.message
err.message
);
expect(err.code
).assertEqual(2097152
);
expect(err.code
!= null).assertTrue(
);
expect(err.message).assertEqual("startAbility failed.");
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0001 pass"
...
...
@@ -181,6 +182,7 @@ export default function StartAbilityTest() {
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0001 meet an error: " + e
);
expect().assertFail();
done();
}
});
...
...
@@ -208,13 +210,13 @@ export default function StartAbilityTest() {
if (err != null) {
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0002 meet an error: " +
err.code
err.code
);
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0002 meet an error: " +
err.message
err.message
);
expect(err.code
).assertEqual(2097199
);
expect(err.code
!= null).assertTrue(
);
expect(err.message).assertEqual("startAbility failed.");
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0002 pass"
...
...
@@ -230,6 +232,7 @@ export default function StartAbilityTest() {
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0002 meet an error: " + e
);
expect().assertFail();
done();
}
});
...
...
@@ -260,9 +263,9 @@ export default function StartAbilityTest() {
);
abilityDelegator.printSync(
"ACTS_STARTABILITY_CALLBACK_ERROR_0003 meet an error: " +
err.message
err.message
);
expect(err.code
).assertEqual(2097152
);
expect(err.code
!= null).assertTrue(
);
expect(err.message).assertEqual("startAbility failed.");
abilityDelegator.printSync(
"ACTS_STARTABILITY_CALLBACK_ERROR_0003 pass"
...
...
@@ -278,6 +281,7 @@ export default function StartAbilityTest() {
abilityDelegator.printSync(
"ACTS_STARTABILITY_CALLBACK_ERROR_0003 meet an error: " + e
);
expect().assertFail();
done();
}
});
...
...
@@ -301,13 +305,13 @@ export default function StartAbilityTest() {
if (err != null) {
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0006 meet an error: " +
err.code
err.code
);
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0006 meet an error: " +
err.message
err.message
);
expect(err.code
).assertEqual(2097199
);
expect(err.code
!= null).assertTrue(
);
expect(err.message).assertEqual("startAbility failed.");
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0006 pass"
...
...
@@ -323,6 +327,7 @@ export default function StartAbilityTest() {
abilityDelegator.printSync(
"ACTS_START_ABILITY_CALLBACK_ERROR_0006 meet an error: " + e
);
expect().assertFail();
done();
}
});
...
...
@@ -422,7 +427,7 @@ export default function StartAbilityTest() {
abilityDelegator.getCurrentTopAbility((err: any, ability: any) => {
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_PARAMETER_0002 getCurrentTopAbility: " +
ability.context.abilityInfo.name
ability.context.abilityInfo.name
);
expect(ability.context.abilityInfo.name).assertEqual(
...
...
@@ -438,15 +443,16 @@ export default function StartAbilityTest() {
expect(globalThis.want.parameters["keyForBoolean"]).assertEqual(
true
);
console.log("ACTS_START_ABILITY_PROMISE_PARAMETER_0002 pass");
done()
});
} catch (error) {
console.log(
"ACTS_START_ABILITY_PROMISE_PARAMETER_0002 fail :" + error
);
expect().assertFail();
done();
}
done();
}, 3000);
});
});
...
...
@@ -480,9 +486,9 @@ export default function StartAbilityTest() {
);
abilityDelegator.printSync(
"ACTS_STARTABILITY_PROMISE_ERROR_0001 meet an error code: " +
error.code
error.code
);
expect(error.code
).assertEqual(2097152
);
expect(error.code
!= null).assertTrue(
);
expect(error.message).assertEqual("startAbility failed.");
abilityDelegator.printSync(
"ACTS_STARTABILITY_PROMISE_ERROR_0001 pass"
...
...
@@ -493,6 +499,7 @@ export default function StartAbilityTest() {
abilityDelegator.printSync(
"ACTS_STARTABILITY_PROMISE_ERROR_0001 fail error: " + error
);
expect().assertFail();
done();
}
});
...
...
@@ -525,9 +532,9 @@ export default function StartAbilityTest() {
);
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0002 meet an error code: " +
error.code
error.code
);
expect(error.code
).assertEqual(2097199
);
expect(error.code
!= null).assertTrue(
);
expect(error.message).assertEqual("startAbility failed.");
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0002 pass"
...
...
@@ -538,6 +545,7 @@ export default function StartAbilityTest() {
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0002 fail error: " + error
);
expect().assertFail();
done();
}
});
...
...
@@ -570,9 +578,9 @@ export default function StartAbilityTest() {
);
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0003 meet an error code: " +
error.code
error.code
);
expect(error.code
).assertEqual(2097152
);
expect(error.code
!= null).assertTrue(
);
expect(error.message).assertEqual("startAbility failed.");
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0003 pass"
...
...
@@ -583,6 +591,7 @@ export default function StartAbilityTest() {
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0003 fail error: " + error
);
expect().assertFail();
done();
}
});
...
...
@@ -612,9 +621,9 @@ export default function StartAbilityTest() {
);
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0006 meet an error code: " +
error.code
error.code
);
expect(error.code
).assertEqual(2097199
);
expect(error.code
!= null).assertTrue(
);
expect(error.message).assertEqual("startAbility failed.");
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0006 pass"
...
...
@@ -625,6 +634,7 @@ export default function StartAbilityTest() {
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0006 fail error: " + error
);
expect().assertFail();
done();
}
});
...
...
@@ -664,7 +674,7 @@ export default function StartAbilityTest() {
);
abilityDelegator.printSync(
"ACTS_START_ABILITY_PROMISE_ERROR_0007 meet an error code: " +
error.code
error.code
);
expect(error.code).assertEqual(401);
done();
...
...
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureATest/BUILD.gn
浏览文件 @
f08bab3d
...
...
@@ -36,4 +36,4 @@ ohos_resources("windowStage_resources") {
sources = [ "src/main/resources" ]
deps = [ ":windowStage_app_profile" ]
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureBTest/BUILD.gn
浏览文件 @
f08bab3d
...
...
@@ -36,4 +36,4 @@ ohos_resources("windowStage_resources") {
sources = [ "src/main/resources" ]
deps = [ ":windowStage_app_profile" ]
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureCTest/BUILD.gn
浏览文件 @
f08bab3d
...
...
@@ -36,4 +36,4 @@ ohos_resources("windowStage_resources") {
sources = [ "src/main/resources" ]
deps = [ ":windowStage_app_profile" ]
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureDTest/BUILD.gn
浏览文件 @
f08bab3d
...
...
@@ -36,4 +36,4 @@ ohos_resources("windowStage_resources") {
sources = [ "src/main/resources" ]
deps = [ ":windowStage_app_profile" ]
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
ability/crossplatform/ability_runtime/ActsCrossplatformFeatureTest/BUILD.gn
浏览文件 @
f08bab3d
...
...
@@ -36,4 +36,4 @@ ohos_resources("windowStage_resources") {
sources = [ "src/main/resources" ]
deps = [ ":windowStage_app_profile" ]
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
ability/crossplatform/ability_runtime/BUILD.gn
浏览文件 @
f08bab3d
...
...
@@ -17,12 +17,12 @@ group("ability_crossplatform_runtime") {
testonly = true
if (is_standard_system) {
deps = [
"ActsCrossplatformFeatureTest:ActsCrossplatformFeature
Test",
"ActsCrossplatformAbilityTest:ActsCrossplatformAbility
Test",
"ActsCrossplatformFeatureATest:ActsCrossplatformFeatureATest",
"ActsCrossplatformFeatureBTest:ActsCrossplatformFeatureBTest",
"ActsCrossplatformFeatureCTest:ActsCrossplatformFeatureCTest",
"ActsCrossplatformFeatureDTest:ActsCrossplatformFeatureDTest",
"ActsCrossplatform
AbilityTest:ActsCrossplatformAbility
Test",
"ActsCrossplatform
FeatureTest:ActsCrossplatformFeature
Test",
"ActsLifeCycleEtsFeatureTest:ActsLifeCycleEtsFeatureTest",
"ActsLifeCycleEtsTest:ActsLifeCycleEtsTest",
"ActsUiAbilityEtsTest:ActsUiAbilityEtsTest",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录