Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ffc17af7
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看板
提交
ffc17af7
编写于
7月 20, 2023
作者:
K
kirl75
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xts补充接口自动化3
Signed-off-by:
N
kirl75
<
kirl.liu@huawei.com
>
上级
12afd1d0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
71 addition
and
4 deletion
+71
-4
ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/MainAbility/MainAbility.ts
...mappcallerb/entry/src/main/ets/MainAbility/MainAbility.ts
+12
-1
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/pages/index.ets
...st/uiextensionprovider/entry/src/main/ets/pages/index.ets
+20
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
...rhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
+39
-3
未找到文件。
ability/ability_runtime/actscalltest/systemappcallerb/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
ffc17af7
...
...
@@ -22,8 +22,9 @@ var caller;
var
event_getcaller
=
"
getcaller.com.example.systemcalltest.SecondAbility
"
;
var
event_call
=
"
call.com.example.systemcalltest.SecondAbility
"
;
var
event_release
=
"
release.com.example.systemcalltest.SecondAbility
"
;
var
event_onRemoteStateChangeCall
=
"
onRemoteStateChangeCall.com.example.systemcalltest.SecondAbility
"
;
var
subscribeInfo
=
{
events
:
[
event_getcaller
,
event_call
,
event_release
,
],
events
:
[
event_getcaller
,
event_call
,
event_release
,
event_onRemoteStateChangeCall
],
};
class
MySequenceable
{
...
...
@@ -100,6 +101,13 @@ function releaseCallee() {
commonEvent
.
unsubscribe
(
subscriber
,
unsubscribeCallback
);
}
function
onRemoteStateChangeCall
(){
function
OnRemoteStateChangeCallback
(
msg
){
console
.
log
(
'
SystemAppCallerB MainAbility onRemoteStateChange
'
+
msg
);
}
caller
.
onRemoteStateChange
(
OnRemoteStateChangeCallback
)
}
function
startNext
(
context
)
{
let
want
=
{
bundleName
:
"
com.example.systemappcallerc
"
,
...
...
@@ -122,6 +130,9 @@ export default class MainAbility extends Ability {
case
event_release
:
releaseCallee
();
break
;
case
event_onRemoteStateChangeCall
:
onRemoteStateChangeCall
();
break
;
default
:
console
.
log
(
'
SystemAppCallerB MainAbility subscribeCallBack event error:
'
+
data
.
event
);
break
;
...
...
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/pages/index.ets
浏览文件 @
ffc17af7
...
...
@@ -62,6 +62,26 @@ struct Index {
commonEventManager.unsubscribe(subscriber, async (err, data) => {
console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data));
});
} else if (data.event == "terminateSelfPromise") {
this.session.terminateSelf().then((data)=>{
console.log(TAG + "terminateSelfPromise : " + JSON.stringify(data));
}).catch((err)=>{
console.log(TAG + "terminateSelfPromise : " + JSON.stringify(err));
})
} else if (data.event == "terminateSelfCallback") {
this.session.terminateSelf((err, data)=>{
console.log(TAG + "terminateSelfCallback : " + JSON.stringify(data));
})
} else if (data.event == "setWindowPrivacyModeFalseCallback") {
this.session.setWindowPrivacyMode(false, (err, data)=>{
console.log(TAG + "setWindowPrivacyModeFalseCallback : " + JSON.stringify(data));
})
} else if (data.event == "setWindowPrivacyModeFalsePromise") {
this.session.setWindowPrivacyMode(false).then(()=>{
console.log(TAG + "setWindowPrivacyModeFalsePromise : " + JSON.stringify(data));
}).catch((err)=>{
console.log(TAG + "setWindowPrivacyModeFalsePromise : " + JSON.stringify(err));
})
}
});
}).catch((error) => {
...
...
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
浏览文件 @
ffc17af7
...
...
@@ -374,13 +374,13 @@ export default function ApiCoverTest() {
})
})
/*
/*
* @tc.number SUB_AA_AMS_Context_0200
* @tc.name Register the listener of Ability and cancel the listener.
* @tc.desc Function test
* @tc.level 3
*/
it
(
'SUB_AA_AMS_Context_0200'
,
0
,
async
function
(
done
)
{
it
(
'SUB_AA_AMS_Context_0200'
,
0
,
async
function
(
done
)
{
await
globalThis
.
abilityContext
.
eventHub
.
on
(
"contextEvent"
,
func1
)
globalThis
.
abilityContext
.
eventHub
.
emit
(
"contextEvent"
,
"aa"
,
"bb"
)
await
sleep
(
500
)
...
...
@@ -523,6 +523,8 @@ export default function ApiCoverTest() {
expect
(
1
)
.
assertEqual
(
abilityConstant
.
MemoryLevel
.
MEMORY_LEVEL_LOW
)
expect
(
2
)
.
assertEqual
(
abilityConstant
.
MemoryLevel
.
MEMORY_LEVEL_CRITICAL
)
expect
(
5
)
.
assertEqual
(
abilityConstant
.
LaunchReason
.
SHARE
)
expect
(
0
)
.
assertEqual
(
abilityConstant
.
ContinueState
.
ACTIVE
)
expect
(
1
)
.
assertEqual
(
abilityConstant
.
ContinueState
.
INACTIVE
)
expect
(
'ohos.extra.param.key.contentTitle'
)
.
assertEqual
(
wantConstant
.
Params
.
CONTENT_TITLE_KEY
)
expect
(
'ohos.extra.param.key.shareAbstract'
)
.
assertEqual
(
wantConstant
.
Params
.
SHARE_ABSTRACT_KEY
)
expect
(
'ohos.extra.param.key.shareUrl'
)
.
assertEqual
(
wantConstant
.
Params
.
SHARE_URL_KEY
)
...
...
@@ -790,7 +792,7 @@ export default function ApiCoverTest() {
})
/*
* @tc.number SUB_AA_Form_formBindingData_0100
* @tc.name
The form of a callback getRunningProcessInformation
* @tc.name
Create FormBindingData
* @tc.desc Function test
* @tc.level 3
*/
...
...
@@ -808,5 +810,39 @@ export default function ApiCoverTest() {
expect
(
formBinding
!=
undefined
)
.
assertTrue
()
done
()
})
/*
* @tc.number SUB_AA_UIAbilityContext_setMissionContinueState_0100
* @tc.name setMissionContinueState with callback for Ability.
* @tc.desc Function test
* @tc.level 3
*/
it
(
'SUB_AA_UIAbilityContext_setMissionContinueState_0100'
,
0
,
async
function
(
done
)
{
TAG
=
'SUB_AA_UIAbilityContext_setMissionContinueState_0100'
;
globalThis
.
abilityContext
.
setMissionContinueState
(
0
,
(
err
,
data
)
=>
{
console
.
log
(
`${TAG} setMissionContinueState data ${JSON.stringify(err)}`
);
expect
(
data
)
.
assertEqual
(
undefined
);
done
();
})
})
/*
* @tc.number SUB_AA_UIAbilityContext_setMissionContinueState_0200
* @tc.name setMissionContinueState with promise for Ability.
* @tc.desc Function test
* @tc.level 3
*/
it
(
'SUB_AA_UIAbilityContext_setMissionContinueState_0200'
,
0
,
async
function
(
done
)
{
TAG
=
'SUB_AA_UIAbilityContext_setMissionContinueState_0200'
;
globalThis
.
abilityContext
.
setMissionContinueState
(
0
)
.
then
((
data
)
=>
{
console
.
log
(
`${TAG} setMissionContinueState data ${JSON.stringify(data)}`
);
expect
(
data
)
.
assertEqual
(
undefined
);
done
();
})
.
catch
((
err
)
=>
{
console
.
log
(
`${TAG} setMissionContinueState promise err ${JSON.stringify(err)}`
);
expect
()
.
assertFail
();
done
();
})
})
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录