Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f43217dc
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看板
未验证
提交
f43217dc
编写于
7月 18, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 18, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9373 元能力为应用开发者提供接口报告页面加载完成打点xts测试代码合并
Merge pull request !9373 from xinking129/master
上级
f9e7a351
af1dc142
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
729 addition
and
3 deletion
+729
-3
ability/ability_runtime/context/actsstagecontext/BUILD.gn
ability/ability_runtime/context/actsstagecontext/BUILD.gn
+3
-1
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/AppScope/app.json
...text/ReportDrawnCompletedManualTestRely/AppScope/app.json
+19
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/AppScope/resources/base/element/string.json
...anualTestRely/AppScope/resources/base/element/string.json
+8
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/AppScope/resources/base/media/app_icon.png
...ManualTestRely/AppScope/resources/base/media/app_icon.png
+0
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/BUILD.gn
...sstagecontext/ReportDrawnCompletedManualTestRely/BUILD.gn
+43
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/ets/entryability/EntryAbility.ts
...lTestRely/entry/src/main/ets/entryability/EntryAbility.ts
+69
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/ets/pages/Index.ets
...ompletedManualTestRely/entry/src/main/ets/pages/Index.ets
+31
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/ets/pages/Index2.ets
...mpletedManualTestRely/entry/src/main/ets/pages/Index2.ets
+31
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/module.json
...rtDrawnCompletedManualTestRely/entry/src/main/module.json
+38
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/base/element/color.json
...TestRely/entry/src/main/resources/base/element/color.json
+8
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/base/element/string.json
...estRely/entry/src/main/resources/base/element/string.json
+32
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/base/media/icon.png
...nualTestRely/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/base/profile/main_pages.json
...ely/entry/src/main/resources/base/profile/main_pages.json
+8
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/en_US/element/string.json
...stRely/entry/src/main/resources/en_US/element/string.json
+32
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/zh_CN/element/string.json
...stRely/entry/src/main/resources/zh_CN/element/string.json
+32
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/signature/openharmony_sx.p7b
...DrawnCompletedManualTestRely/signature/openharmony_sx.p7b
+0
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/AppScope/app.json
...sstagecontext/ReportDrawnCompletedReply/AppScope/app.json
+21
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/AppScope/resources/base/element/string.json
...ompletedReply/AppScope/resources/base/element/string.json
+8
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/AppScope/resources/base/media/app_icon.png
...CompletedReply/AppScope/resources/base/media/app_icon.png
+0
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/BUILD.gn
...ntext/actsstagecontext/ReportDrawnCompletedReply/BUILD.gn
+43
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/ets/Application/MyAbilityStage.ts
...tedReply/entry/src/main/ets/Application/MyAbilityStage.ts
+23
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/ets/MainAbility/DrawnAbility.ts
...letedReply/entry/src/main/ets/MainAbility/DrawnAbility.ts
+51
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/ets/pages/index.ets
...ortDrawnCompletedReply/entry/src/main/ets/pages/index.ets
+49
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/module.json
...text/ReportDrawnCompletedReply/entry/src/main/module.json
+38
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/resources/base/element/string.json
...edReply/entry/src/main/resources/base/element/string.json
+24
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/resources/base/media/icon.png
...mpletedReply/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/resources/base/profile/main_pages.json
...ply/entry/src/main/resources/base/profile/main_pages.json
+5
-0
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/signature/openharmony_sx.p7b
...xt/ReportDrawnCompletedReply/signature/openharmony_sx.p7b
+0
-0
ability/ability_runtime/context/actsstagecontext/actsstagecontextpropertiestest/Test.json
...actsstagecontext/actsstagecontextpropertiestest/Test.json
+3
-1
ability/ability_runtime/context/actsstagecontext/actsstagecontextpropertiestest/entry/src/main/ets/test/StageContextProperties.test.ets
...t/entry/src/main/ets/test/StageContextProperties.test.ets
+110
-1
未找到文件。
ability/ability_runtime/context/actsstagecontext/BUILD.gn
浏览文件 @
f43217dc
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2021
-2023
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
@@ -17,6 +17,8 @@ group("actsstagecontext") {
testonly = true
if (is_standard_system) {
deps = [
"ReportDrawnCompletedManualTestRely:ReportDrawnCompletedManualTestRely",
"ReportDrawnCompletedReply:ReportDrawnCompletedReply",
"actsstagecontextassistone:ActsStageContextAssistOne",
"actsstagecontextassisttwo:ActsStageContextAssistTwo",
"actsstagecontextpropertiestest:ActsStageContextPropertiesTest",
...
...
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/AppScope/app.json
0 → 100644
浏览文件 @
f43217dc
{
"app"
:
{
"bundleName"
:
"com.example.reportdrawncompletedmanualtest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
}
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
f43217dc
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ReportDrawnCompletedManualTest"
}
]
}
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
f43217dc
6.6 KB
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/BUILD.gn
0 → 100644
浏览文件 @
f43217dc
# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("ReportDrawnCompletedManualTestRely") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":reportdrawncompletedmanualtestrely_js_assets",
":reportdrawncompletedmanualtestrely_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ReportDrawnCompletedManualTestRely"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("reportdrawncompletedmanualtestrely_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("reportdrawncompletedmanualtestrely_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("reportdrawncompletedmanualtestrely_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":reportdrawncompletedmanualtestrely_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/ets/entryability/EntryAbility.ts
0 → 100644
浏览文件 @
f43217dc
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
hilog
from
'
@ohos.hilog
'
;
import
Ability
from
'
@ohos.app.ability.UIAbility
'
;
import
Window
from
'
@ohos.window
'
;
export
default
class
EntryAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onCreate
'
);
globalThis
.
context
=
this
.
context
;
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
want param:
'
+
JSON
.
stringify
(
want
)
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
launchParam:
'
+
JSON
.
stringify
(
launchParam
)
??
''
);
this
.
context
.
reportDrawnCompleted
(()
=>
{
console
.
info
(
'
The call to the reportDrawnCompleted interface succeeded
'
);
});
}
onDestroy
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onDestroy
'
);
}
onWindowStageCreate
(
windowStage
:
Window
.
WindowStage
)
{
// Main window is created, set main page for this ability
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onWindowStageCreate
'
);
windowStage
.
loadContent
(
'
pages/Index
'
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
ERROR
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
Failed to load the content. Cause: %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
return
;
}
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
Succeeded in loading the content. Data: %{public}s
'
,
JSON
.
stringify
(
data
)
??
''
);
});
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onWindowStageDestroy
'
);
}
onForeground
()
{
// Ability has brought to foreground
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onForeground
'
);
}
onBackground
()
{
// Ability has back to background
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onBackground
'
);
}
}
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/ets/pages/Index.ets
0 → 100644
浏览文件 @
f43217dc
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/ets/pages/Index2.ets
0 → 100644
浏览文件 @
f43217dc
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct Index2 {
@State message: string = 'Hello World';
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/module.json
0 → 100644
浏览文件 @
f43217dc
{
"module"
:
{
"name"
:
"entry"
,
"type"
:
"entry"
,
"description"
:
"$string:module_desc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"EntryAbility"
,
"srcEntrance"
:
"./ets/entryability/EntryAbility.ts"
,
"description"
:
"$string:EntryAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:EntryAbility_label"
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:start_window_background"
,
"launchType"
:
"standard"
,
"visible"
:
true
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
f43217dc
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
f43217dc
{
"string"
:
[
{
"name"
:
"module_desc"
,
"value"
:
"module description"
},
{
"name"
:
"EntryAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"EntryAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"UIAbility2_desc"
,
"value"
:
"description"
},
{
"name"
:
"UIAbility2_label"
,
"value"
:
"label"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
f43217dc
6.6 KB
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
f43217dc
{
"src"
:
[
"pages/Index"
,
"pages/Index"
,
"pages/Index2"
,
"pages/Index2"
]
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/en_US/element/string.json
0 → 100644
浏览文件 @
f43217dc
{
"string"
:
[
{
"name"
:
"module_desc"
,
"value"
:
"module description"
},
{
"name"
:
"EntryAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"EntryAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"UIAbility2_desc"
,
"value"
:
"description"
},
{
"name"
:
"UIAbility2_label"
,
"value"
:
"label"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/entry/src/main/resources/zh_CN/element/string.json
0 → 100644
浏览文件 @
f43217dc
{
"string"
:
[
{
"name"
:
"module_desc"
,
"value"
:
"模块描述"
},
{
"name"
:
"EntryAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"EntryAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"UIAbility2_desc"
,
"value"
:
"description"
},
{
"name"
:
"UIAbility2_label"
,
"value"
:
"label"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedManualTestRely/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
f43217dc
文件已添加
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/AppScope/app.json
0 → 100644
浏览文件 @
f43217dc
{
"app"
:
{
"bundleName"
:
"com.example.stagecontextpropertiestest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
f43217dc
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ActsStageContextAssistOne"
}
]
}
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
f43217dc
6.6 KB
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/BUILD.gn
0 → 100644
浏览文件 @
f43217dc
# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("ReportDrawnCompletedReply") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":reportdrawncompletedreply_js_assets",
":reportdrawncompletedreply_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ReportDrawnCompletedReply"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("reportdrawncompletedreply_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("reportdrawncompletedreply_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("reportdrawncompletedreply_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":reportdrawncompletedreply_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/ets/Application/MyAbilityStage.ts
0 → 100644
浏览文件 @
f43217dc
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityStage
from
'
@ohos.app.ability.AbilityStage
'
;
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
info
(
'
ActsStageContextAssistOne StageAbility onCreate
'
);
globalThis
.
abilityStageContextA
=
this
.
context
;
}
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/ets/MainAbility/DrawnAbility.ts
0 → 100644
浏览文件 @
f43217dc
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
Ability
from
'
@ohos.app.ability.UIAbility
'
;
import
commonEvent
from
'
@ohos.commonEvent
'
;
export
default
class
DrawnAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
info
(
'
ActsStageContextAssistOne DrawnAbility onCreate
'
);
this
.
context
.
reportDrawnCompleted
(()
=>
{
console
.
info
(
'
The call to the reportDrawnCompleted interface succeeded
'
);
});
}
onDestroy
()
{
console
.
info
(
'
ActsStageContextAssistOne DrawnAbility onDestroy
'
);
}
onWindowStageCreate
(
windowStage
)
{
console
.
info
(
'
ActsStageContextAssistOne DrawnAbility onWindowStageCreate
'
);
windowStage
.
setUIContent
(
this
.
context
,
'
pages/index
'
,
null
);
}
onWindowStageDestroy
()
{
console
.
info
(
'
ActsStageContextAssistOne DrawnAbility onWindowStageDestroy
'
);
}
onForeground
()
{
console
.
info
(
'
ActsStageContextAssistOne DrawnAbility onForeground
'
);
globalThis
.
abilityContextA
=
this
.
context
;
commonEvent
.
publish
(
'
StartDrawnAbility_CommonEvent_ContextOne
'
,
()
=>
{
console
.
log
(
'
Publish StartDrawnAbility_CommonEvent_ContextOne callback
'
);
});
}
onBackground
()
{
console
.
info
(
'
ActsStageContextAssistOne DrawnAbility onBackground
'
);
}
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/ets/pages/index.ets
0 → 100644
浏览文件 @
f43217dc
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
}
@State message: string = 'MainAbility3 Hello'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(() => {
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/module.json
0 → 100644
浏览文件 @
f43217dc
{
"module"
:
{
"name"
:
"drawn"
,
"type"
:
"feature"
,
"srcEntrance"
:
"./ets/Application/MyAbilityStage.ts"
,
"description"
:
"$string:entry_test_desc"
,
"mainElement"
:
"DrawnAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:main_pages"
,
"uiSyntax"
:
"ets"
,
"abilities"
:
[
{
"name"
:
"DrawnAbility"
,
"srcEntrance"
:
"./ets/MainAbility/DrawnAbility.ts"
,
"description"
:
"$string:MainAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:MainAbility_label"
,
"launchType"
:
"specified"
,
"visible"
:
true
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
f43217dc
{
"string"
:
[
{
"name"
:
"entry_test_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"feature_MainAbility"
},
{
"name"
:
"app_name"
,
"value"
:
"ActsStageContextAssistOne"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
}
]
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
f43217dc
6.6 KB
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
f43217dc
{
"src"
:
[
"pages/index"
]
}
\ No newline at end of file
ability/ability_runtime/context/actsstagecontext/ReportDrawnCompletedReply/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
f43217dc
文件已添加
ability/ability_runtime/context/actsstagecontext/actsstagecontextpropertiestest/Test.json
浏览文件 @
f43217dc
...
...
@@ -13,7 +13,9 @@
"test-file-name"
:
[
"ActsStageContextPropertiesTest.hap"
,
"ActsStageContextAssistOne.hap"
,
"ActsStageContextAssistTwo.hap"
"ActsStageContextAssistTwo.hap"
,
"ReportDrawnCompletedManualTestRely.hap"
,
"ReportDrawnCompletedReply.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
ability/ability_runtime/context/actsstagecontext/actsstagecontextpropertiestest/entry/src/main/ets/test/StageContextProperties.test.ets
浏览文件 @
f43217dc
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -15,6 +15,7 @@
import
{
describe
,
it
,
expect
,
afterEach
,
beforeAll
}
from
'@ohos/hypium'
import
commonEvent
from
'@ohos.commonEvent'
import
AbilityDelegatorRegistry
from
'@ohos.application.abilityDelegatorRegistry'
let
Subscriber
;
let
TAG
;
...
...
@@ -64,6 +65,15 @@ export default function stageContextPropertiesTest(abilityContext) {
},
1500
);
})
function
beforeEachLoadmanagement
()
{
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
executeShellCommand
(
"hilog -r"
,
async
(
err
,
data
)
=>
{});
abilityDelegator
.
executeShellCommand
(
"hilog -Q pidoff"
,
async
(
err
,
data
)
=>
{});
abilityDelegator
.
executeShellCommand
(
"hilog -Q domainoff"
,
async
(
err
,
data
)
=>
{});
abilityDelegator
.
executeShellCommand
(
"hilog -b D"
,
async
(
err
,
data
)
=>
{});
abilityDelegator
.
executeShellCommand
(
"hilog -G 20M"
,
async
(
err
,
data
)
=>
{});
}
/**
* @tc.number: SUB_AA_OpenHarmony_Context_0100
* @tc.name: Check that context paths of different Ability in the same hap are the same.
...
...
@@ -498,6 +508,105 @@ export default function stageContextPropertiesTest(abilityContext) {
}
});
/**
* @tc.number: Acts_ReportDrawnCompleted_AsyncCallback_1400
* @tc.name: Load management
* @tc.desc: The uiability of this application use asyncCallback way call reportDrawnCompleted interface
* viewing console output information.
* @tc.level 1
*/
it
(
'Acts_ReportDrawnCompleted_AsyncCallback_1400'
,
0
,
function
(
done
)
{
beforeEachLoadmanagement
();
setTimeout
(
function
()
{
let
want
=
{
"deviceId"
:
""
,
"bundleName"
:
"com.example.stagecontextpropertiestest"
,
"abilityName"
:
"DrawnAbility"
,
"moduleName"
:
"drawn"
,
};
globalThis
.
abilityContext
.
startAbility
(
want
,
()
=>
{});
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
setTimeout
(
function
()
{
console
.
log
(
'====>ReportDrawnCompleted_1400 expect start '
);
let
grepLog
=
"'
\"
name_
\"
:
\"
DRAWN_COMPLETED
\"
'"
;
let
cmd
=
"hilog -x | grep "
+
grepLog
;
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
console
.
log
(
'====>ReportDrawnCompleted_0100 executeShellCommand err : '
+
JSON
.
stringify
(
err
));
if
(
data
.
stdResult
)
{
console
.
log
(
'====>ReportDrawnCompleted_1400 data.stdResult : '
+
JSON
.
stringify
(
data
.
stdResult
));
try
{
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
domain_
\"
:
\"
AAFWK
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
name_
\"
:
\"
DRAWN_COMPLETED
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
type_
\"
:4"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
tz_
\"
:
\"
+0800
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
BUNDLE_NAME
\"
:
\"
com.example.stagecontextpropertiestest
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
MODULE_NAME
\"
:
\"
drawn
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
ABILITY_NAME
\"
:
\"
DrawnAbility
\"
"
);
}
catch
{
expect
()
.
assertFail
();
done
();
}
done
();
}
else
{
expect
()
.
assertFail
();
done
();
}
});
},
200
);
},
4000
);
})
/*
* @tc.number: Acts_ReportDrawnCompleted_AsyncCallback_1500
* @tc.name: Load management
* @tc.desc: The uiAbility of this external application use asyncCallback way call reportDrawnCompleted interface
* viewing console output information.
* @tc.level 1
*/
it
(
'Acts_ReportDrawnCompleted_AsyncCallback_1500'
,
0
,
function
(
done
)
{
beforeEachLoadmanagement
();
setTimeout
(
function
()
{
let
want
=
{
"deviceId"
:
""
,
"bundleName"
:
"com.example.reportdrawncompletedmanualtest"
,
"abilityName"
:
"EntryAbility"
};
globalThis
.
abilityContext
.
startAbility
(
want
,
()
=>
{});
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
setTimeout
(
function
()
{
console
.
log
(
'====>ReportDrawnCompleted_1500 expect start '
);
let
grepLog
=
"'
\"
name_
\"
:
\"
DRAWN_COMPLETED
\"
'"
;
let
cmd
=
"hilog -x | grep "
+
grepLog
;
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
console
.
log
(
'====>ReportDrawnCompleted_1500 executeShellCommand err : '
+
JSON
.
stringify
(
err
));
if
(
data
.
stdResult
)
{
console
.
log
(
'====>ReportDrawnCompleted_1500 data.stdResult : '
+
JSON
.
stringify
(
data
.
stdResult
));
try
{
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
domain_
\"
:
\"
AAFWK
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
name_
\"
:
\"
DRAWN_COMPLETED
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
type_
\"
:4"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
tz_
\"
:
\"
+0800
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
BUNDLE_NAME
\"
:
\"
com.example.reportdrawncompletedmanualtest
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
MODULE_NAME
\"
:
\"
entry
\"
"
);
expect
(
data
.
stdResult
)
.
assertContain
(
"
\"
ABILITY_NAME
\"
:
\"
EntryAbility
\"
"
);
}
catch
{
expect
()
.
assertFail
();
done
();
}
done
();
}
else
{
expect
()
.
assertFail
();
done
();
}
});
},
1000
);
},
4000
);
})
function
checkApplicationContextDir
(
applicationContext
)
{
expect
(
applicationContext
.
cacheDir
)
.
assertEqual
(
"/data/storage/el2/base/cache"
);
expect
(
applicationContext
.
tempDir
)
.
assertEqual
(
"/data/storage/el2/base/temp"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录