Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
bb5e1f3e
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看板
提交
bb5e1f3e
编写于
7月 12, 2023
作者:
H
hu0475
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试abilityconstant和更改gn格式
Signed-off-by:
N
hu0475
<
huyanqiang5@huawei.com
>
上级
ea69e945
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
62 addition
and
9 deletion
+62
-9
ability/BUILD.gn
ability/BUILD.gn
+1
-1
ability/crossplatform/BUILD.gn
ability/crossplatform/BUILD.gn
+1
-3
ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/BUILD.gn
...form/ability_runtime/ActsLifeCycleEtsFeatureTest/BUILD.gn
+5
-1
ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/BUILD.gn
...ossplatform/ability_runtime/ActsLifeCycleEtsTest/BUILD.gn
+5
-1
ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/BUILD.gn
...ossplatform/ability_runtime/ActsUiAbilityEtsTest/BUILD.gn
+5
-1
ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/src/main/ets/MainAbility1/MainAbility1.ts
...iAbilityEtsTest/src/main/ets/MainAbility1/MainAbility1.ts
+1
-0
ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/src/main/ets/test/abilityLifeCycle.test.ets
...bilityEtsTest/src/main/ets/test/abilityLifeCycle.test.ets
+38
-0
ability/crossplatform/ability_runtime/BUILD.gn
ability/crossplatform/ability_runtime/BUILD.gn
+1
-1
ability/crossplatform/ability_runtime/commonTestAbilityApp/BUILD.gn
...ossplatform/ability_runtime/commonTestAbilityApp/BUILD.gn
+5
-1
未找到文件。
ability/BUILD.gn
浏览文件 @
bb5e1f3e
...
...
@@ -18,8 +18,8 @@ group("ability") {
if (is_standard_system) {
deps = [
"ability_runtime:ability_runtime",
"crossplatform:ability_crossplatform",
"dmsfwk:dmsfwk",
"crossplatform:ability_crossplatform"
]
}
}
ability/crossplatform/BUILD.gn
浏览文件 @
bb5e1f3e
...
...
@@ -16,8 +16,6 @@ import("//build/ohos_var.gni")
group("ability_crossplatform") {
testonly = true
if (is_standard_system) {
deps = [
"ability_runtime:ability_crossplatform_runtime",
]
deps = [ "ability_runtime:ability_crossplatform_runtime" ]
}
}
ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/BUILD.gn
浏览文件 @
bb5e1f3e
...
...
@@ -21,6 +21,7 @@ ohos_hap_assist_suite("ActsLifeCycleEtsFeatureTest") {
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
# hap_name: HAP的名字,可选,默认为目标名
hap_name = "ActsLifeCycleEtsFeatureTest"
subsystem_name = "ability"
...
...
@@ -29,6 +30,7 @@ ohos_hap_assist_suite("ActsLifeCycleEtsFeatureTest") {
ohos_app_scope("windowStage_app_profile") {
# app_profile: HAP的AppScope中的app.json,只在Stage模型下使用
app_profile = "AppScope/app.json"
# sources: 资源文件路径
sources = [ "AppScope/resources" ]
}
...
...
@@ -39,8 +41,10 @@ ohos_js_assets("windowStage_js_assets") {
ohos_resources("windowStage_resources") {
# sources: 资源文件路径
sources = [ "src/main/resources" ]
# deps: 当前目标的依赖
deps = [ ":windowStage_app_profile" ]
# hap_profile: HAP的config.json,Stage模型对应module.json
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/BUILD.gn
浏览文件 @
bb5e1f3e
...
...
@@ -21,6 +21,7 @@ ohos_js_hap_suite("ActsLifeCycleEtsTest") {
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
# hap_name: HAP的名字,可选,默认为目标名
hap_name = "ActsLifeCycleEtsTest"
subsystem_name = "ability"
...
...
@@ -29,6 +30,7 @@ ohos_js_hap_suite("ActsLifeCycleEtsTest") {
ohos_app_scope("windowStage_app_profile") {
# app_profile: HAP的AppScope中的app.json,只在Stage模型下使用
app_profile = "AppScope/app.json"
# sources: 资源文件路径
sources = [ "AppScope/resources" ]
}
...
...
@@ -39,8 +41,10 @@ ohos_js_assets("windowStage_js_assets") {
ohos_resources("windowStage_resources") {
# sources: 资源文件路径
sources = [ "src/main/resources" ]
# deps: 当前目标的依赖
deps = [ ":windowStage_app_profile" ]
# hap_profile: HAP的config.json,Stage模型对应module.json
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/BUILD.gn
浏览文件 @
bb5e1f3e
...
...
@@ -21,6 +21,7 @@ ohos_js_hap_suite("ActsUiAbilityEtsTest") {
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
# hap_name: HAP的名字,可选,默认为目标名
hap_name = "ActsUiAbilityEtsTest"
subsystem_name = "ability"
...
...
@@ -29,6 +30,7 @@ ohos_js_hap_suite("ActsUiAbilityEtsTest") {
ohos_app_scope("windowStage_app_profile") {
# app_profile: HAP的AppScope中的app.json,只在Stage模型下使用
app_profile = "AppScope/app.json"
# sources: 资源文件路径
sources = [ "AppScope/resources" ]
}
...
...
@@ -39,8 +41,10 @@ ohos_js_assets("windowStage_js_assets") {
ohos_resources("windowStage_resources") {
# sources: 资源文件路径
sources = [ "src/main/resources" ]
# deps: 当前目标的依赖
deps = [ ":windowStage_app_profile" ]
# hap_profile: HAP的config.json,Stage模型对应module.json
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/src/main/ets/MainAbility1/MainAbility1.ts
浏览文件 @
bb5e1f3e
...
...
@@ -28,6 +28,7 @@ export default class MainAbility1 extends Ability {
onCreate
(
want
,
launchParam
)
{
console
.
log
(
"
[Demo] MainAbility1 onCreate
"
)
globalThis
.
launchParam1
=
launchParam
;
abilityName
=
want
.
abilityName
globalThis
.
list1
=
[];
recordLife
(
globalThis
.
list1
,
abilityName
,
'
onCreate
'
);
...
...
ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/src/main/ets/test/abilityLifeCycle.test.ets
浏览文件 @
bb5e1f3e
...
...
@@ -14,6 +14,7 @@
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import aConstant from '@ohos.app.ability.AbilityConstant'
function sleep(time) {
return new Promise((resolve) => setTimeout(resolve, time));
...
...
@@ -481,5 +482,42 @@ export default function abilityTest() {
// await sleep(500);
// done();
// })
/**
*@tc.number : UIAbilityConstantTest0100
*@tc.name : UIAbilityConstantTest0100
*@tc.desc : start mainability1, check ability constant.
*@tc.size : MediumTest
*@tc.type : Function
*@tc.level : Level 1
*/
it("UIAbilityConstantTest0100", 0, async (done) => {
console.log("------------UIAbilityConstantTest0100 START-------------");
TAG = "UIAbilityConstantTest0100";
var want = {
bundleName: "com.example.uiabilitylifecycle",
abilityName: "MainAbility1",
moduleName: moduleName,
};
globalThis.abilityContext
.startAbility(want)
.then((data) => {
console.info(TAG + " start successful. Data: " + data);
})
.catch((error) => {
console.error(TAG + " start failed. Cause: " + JSON.stringify(error));
});
await sleep(1000);
console.log('UIAbilityConstantTest0100:' + globalThis.launchParam1.lastExitReason)
expect(globalThis.launchParam1.launchReason == 1).assertTrue();
expect(globalThis.launchParam1.lastExitReason == 2).assertTrue();
expect(aConstant.LaunchReason.UNKNOWN == 0).assertTrue();
expect(aConstant.LastExitReason.UNKNOWN == 0).assertTrue();
done();
});
});
}
ability/crossplatform/ability_runtime/BUILD.gn
浏览文件 @
bb5e1f3e
...
...
@@ -20,7 +20,7 @@ group("ability_crossplatform_runtime") {
"ActsLifeCycleEtsFeatureTest:ActsLifeCycleEtsFeatureTest",
"ActsLifeCycleEtsTest:ActsLifeCycleEtsTest",
"ActsUiAbilityEtsTest:ActsUiAbilityEtsTest",
"commonTestAbilityApp:commonTestAbilityApp"
"commonTestAbilityApp:commonTestAbilityApp"
,
]
}
}
ability/crossplatform/ability_runtime/commonTestAbilityApp/BUILD.gn
浏览文件 @
bb5e1f3e
...
...
@@ -21,6 +21,7 @@ ohos_hap_assist_suite("commonTestAbilityApp") {
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
# hap_name: HAP的名字,可选,默认为目标名
hap_name = "commonTestAbilityApp"
subsystem_name = "ability"
...
...
@@ -29,6 +30,7 @@ ohos_hap_assist_suite("commonTestAbilityApp") {
ohos_app_scope("windowStage_app_profile") {
# app_profile: HAP的AppScope中的app.json,只在Stage模型下使用
app_profile = "AppScope/app.json"
# sources: 资源文件路径
sources = [ "AppScope/resources" ]
}
...
...
@@ -39,8 +41,10 @@ ohos_js_assets("windowStage_js_assets") {
ohos_resources("windowStage_resources") {
# sources: 资源文件路径
sources = [ "src/main/resources" ]
# deps: 当前目标的依赖
deps = [ ":windowStage_app_profile" ]
# hap_profile: HAP的config.json,Stage模型对应module.json
hap_profile = "src/main/module.json"
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录