Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3816fa97
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看板
未验证
提交
3816fa97
编写于
10月 29, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6213 使用UIAbility替换Ability
Merge pull request !6213 from yangzk/add_test
上级
130c7e59
3742e830
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
17 deletion
+4
-17
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
...rhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
+1
-12
ability/ability_runtime/apicover/formmodule/entry/src/main/ets/ModuleAbility/ModuleAbility.ts
...mmodule/entry/src/main/ets/ModuleAbility/ModuleAbility.ts
+3
-5
未找到文件。
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
浏览文件 @
3816fa97
...
@@ -315,7 +315,7 @@ export default function ApiCoverTest() {
...
@@ -315,7 +315,7 @@ export default function ApiCoverTest() {
try
{
try
{
let
info
:
appManager
.
ProcessRunningInfo
;
let
info
:
appManager
.
ProcessRunningInfo
;
let
stageContext
:
common
.
AbilityStageContext
=
globalThis
.
stageContext
;
let
stageContext
:
common
.
AbilityStageContext
=
globalThis
.
stageContext
;
let
abilityContext
:
common
.
AbilityContext
=
globalThis
.
abilityContext
;
let
abilityContext
:
common
.
UI
AbilityContext
=
globalThis
.
abilityContext
;
let
appContext
:
common
.
ApplicationContext
=
abilityContext
.
getApplicationContext
();
let
appContext
:
common
.
ApplicationContext
=
abilityContext
.
getApplicationContext
();
let
baseContext
:
common
.
BaseContext
=
stageContext
;
let
baseContext
:
common
.
BaseContext
=
stageContext
;
let
context
:
common
.
Context
=
stageContext
;
let
context
:
common
.
Context
=
stageContext
;
...
@@ -340,18 +340,7 @@ export default function ApiCoverTest() {
...
@@ -340,18 +340,7 @@ export default function ApiCoverTest() {
abilityDelegator
.
addAbilityMonitor
(
abilityMonitor
,
(
err
,
data
)
=>
{
abilityDelegator
.
addAbilityMonitor
(
abilityMonitor
,
(
err
,
data
)
=>
{
console
.
log
(
`printMsg, err: ${JSON.stringify(err)}, data: ${JSON.stringify(data)}`
);
console
.
log
(
`printMsg, err: ${JSON.stringify(err)}, data: ${JSON.stringify(data)}`
);
})
})
abilityDelegator
.
printMsg
(
undefined
);
abilityDelegator
.
printMsg
(
undefined
,
(
err
,
data
)
=>
{
console
.
log
(
`printMsg, err: ${JSON.stringify(err)}, data: ${JSON.stringify(data)}`
);
});
let
shellCmdResult
:
abilityDelegatorRegistry
.
ShellCmdResult
;
let
shellCmdResult
:
abilityDelegatorRegistry
.
ShellCmdResult
;
shellCmdResult
=
await
abilityDelegator
.
executeShellCmd
(
undefined
);
abilityDelegator
.
executeShellCmd
(
undefined
,
0
,
(
err
,
data
)
=>
{
console
.
log
(
`executeShellCmd, err: ${JSON.stringify(err)}, data: ${JSON.stringify(data)}`
);
});
abilityDelegator
.
executeShellCmd
(
undefined
,
(
err
,
data
)
=>
{
console
.
log
(
`executeShellCmd, err: ${JSON.stringify(err)}, data: ${JSON.stringify(data)}`
);
});
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
`catch code: ${err.code}, message: ${err.message}`
);
console
.
log
(
`catch code: ${err.code}, message: ${err.message}`
);
}
}
...
...
ability/ability_runtime/apicover/formmodule/entry/src/main/ets/ModuleAbility/ModuleAbility.ts
浏览文件 @
3816fa97
import
Ability
from
'
@ohos.app.ability.Ability
'
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
import
AbilityConstant
import
AbilityConstant
from
'
@ohos.app.ability.AbilityConstant
'
;
from
"
../../../../../../../../../../../../interface/sdk-js/api/@ohos.app.ability.AbilityConstant
"
;
export
default
class
ModuleAbility
extends
Ability
{
export
default
class
ModuleAbility
extends
UI
Ability
{
onCreate
(
want
,
launchParam
)
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
abilityWant
=
want
;
...
@@ -53,5 +52,4 @@ export default class ModuleAbility extends Ability {
...
@@ -53,5 +52,4 @@ export default class ModuleAbility extends Ability {
console
.
log
(
"
[Demo] MainAbility onDump:
"
+
JSON
.
stringify
(
param
))
console
.
log
(
"
[Demo] MainAbility onDump:
"
+
JSON
.
stringify
(
param
))
return
[
"
MainAbility
"
]
return
[
"
MainAbility
"
]
}
}
};
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录