Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9aae33a4
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看板
提交
9aae33a4
编写于
7月 19, 2023
作者:
X
xinking129
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changesign
Signed-off-by:
N
xinking129
<
xinxin13@huawei.com
>
上级
36d67b8e
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
24 addition
and
55 deletion
+24
-55
ability/ability_runtime/actsforresult/forresulttest/signature/openharmony_sx.p7b
.../actsforresult/forresulttest/signature/openharmony_sx.p7b
+0
-0
ability/ability_runtime/actsforresult/main/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
...ain/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
+1
-1
ability/ability_runtime/actsforresult/main/entry/src/main/ets/entryability/EntryAbility.ts
...sult/main/entry/src/main/ets/entryability/EntryAbility.ts
+3
-3
ability/ability_runtime/actsforresult/main/signature/openharmony_sx.p7b
...y_runtime/actsforresult/main/signature/openharmony_sx.p7b
+0
-0
ability/ability_runtime/actsforresult/maintest/entry/src/main/ets/test/Ability.test.ets
...rresult/maintest/entry/src/main/ets/test/Ability.test.ets
+20
-51
ability/ability_runtime/actsforresult/maintest/signature/openharmony_sx.p7b
...ntime/actsforresult/maintest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
ability/ability_runtime/actsforresult/forresulttest/signature/openharmony_sx.p7b
浏览文件 @
9aae33a4
无法预览此类型文件
ability/ability_runtime/actsforresult/main/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
浏览文件 @
9aae33a4
...
...
@@ -59,7 +59,7 @@ export default class UIExtAbility extends UIExtensionAbility {
}
if
(
want
.
action
===
'
AsyncCallback_0300
'
)
{
console
.
info
(
'
=======>UIExtAbility onSessionCreate want.action == AsyncCallback_0
2
00======>
'
);
console
.
info
(
'
=======>UIExtAbility onSessionCreate want.action == AsyncCallback_0
3
00======>
'
);
this
.
context
.
startAbilityForResult
({
action
:
'
AsyncCallback_0300
'
,
bundleName
:
'
com.example.mainhap
'
,
...
...
ability/ability_runtime/actsforresult/main/entry/src/main/ets/entryability/EntryAbility.ts
浏览文件 @
9aae33a4
...
...
@@ -19,12 +19,12 @@ import window from '@ohos.window';
export
default
class
EntryAbility
extends
UIAbility
{
onCreate
(
want
,
launchParam
)
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
Ability onCreate
'
);
globalThis
.
terminate
=
()
=>
{
globalThis
.
terminate
=
(
str
)
=>
{
setTimeout
(()
=>
{
this
.
context
.
terminateSelf
().
then
(()
=>
{
console
.
debug
(
"
====>terminateSelf
end
"
);
console
.
info
(
"
====>terminateSelf
"
+
JSON
.
stringify
(
str
)
+
"
end
"
);
}).
catch
((
err
)
=>
{
console
.
debug
(
"
====>terminateSelf
err:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
====>terminateSelf
"
+
JSON
.
stringify
(
str
)
+
"
err:
"
+
JSON
.
stringify
(
err
));
});
},
50
)
};
...
...
ability/ability_runtime/actsforresult/main/signature/openharmony_sx.p7b
浏览文件 @
9aae33a4
无法预览此类型文件
ability/ability_runtime/actsforresult/maintest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
9aae33a4
...
...
@@ -74,15 +74,12 @@ export default function abilityTest() {
function unSubscribeCallback() {
console.info(`====>AsyncCallback_0100 unSubscribeCallback 'ACTS_CALL_EVENT'`)
globalThis.terminate()
globalThis.terminate(
'AsyncCallback_0100'
)
done()
}
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0200',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
...
...
@@ -122,9 +119,7 @@ export default function abilityTest() {
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0300',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
console.info(`====>AsyncCallback_0300 createSubscriber ${data}`)
...
...
@@ -164,7 +159,7 @@ export default function abilityTest() {
function unSubscribeCallback() {
console.info(`====>AsyncCallback_0300 unSubscribeCallback 'ACTS_CALL_EVENT'`)
setTimeout(() => {
globalThis.terminate()
globalThis.terminate(
'AsyncCallback_0300'
)
abilityDelegator.executeShellCommand('aa force-stop com.example.forresulttestsecond').then((result) =>{
console.info('====>AsyncCallback_0300 unSubscribeCallback pkill ok' + JSON.stringify(result));
done()
...
...
@@ -177,9 +172,6 @@ export default function abilityTest() {
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0400',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
...
...
@@ -216,16 +208,13 @@ export default function abilityTest() {
console.info(`====>AsyncCallback_0400 unSubscribeCallback 'ACTS_CALL_EVENT'`)
setTimeout(() => {
globalThis.terminate()
globalThis.terminate(
'AsyncCallback_0400'
)
done()
}, 1000
0
)
}, 1000)
}
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0500',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
...
...
@@ -245,7 +234,7 @@ export default function abilityTest() {
console.info(`====>AsyncCallback_0500 subscribeCallBack all ${data.event}`)
if(data.event == 'ACTS_CALL_EVENT') {
console.info(`====>AsyncCallback_0500 subscribeCallBack 'ACTS_CALL_EVENT' ${data}`)
expect(data.parameters.
result != 0).assertTrue(
);
expect(data.parameters.
num).assertEqual(16000001
);
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
}
}
...
...
@@ -253,16 +242,13 @@ export default function abilityTest() {
function unSubscribeCallback() {
console.info(`====>AsyncCallback_0500 unSubscribeCallback 'ACTS_CALL_EVENT'`)
setTimeout(() => {
globalThis.terminate()
globalThis.terminate(
'AsyncCallback_0500'
)
done()
}, 2000)
}
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0600',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
...
...
@@ -304,9 +290,7 @@ export default function abilityTest() {
it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0700',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
console.info(`====>AsyncCallback_0700 createSubscriber ${data}`)
...
...
@@ -346,9 +330,7 @@ export default function abilityTest() {
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0100',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
console.info(`====>Promise_0100 createSubscriber ${data}`)
...
...
@@ -374,15 +356,12 @@ export default function abilityTest() {
function unSubscribeCallback() {
console.info(`====>Promise_0100 unSubscribeCallback 'ACTS_CALL_EVENT'`)
globalThis.terminate()
globalThis.terminate(
'Promise_0100'
)
done()
}
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0200',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
console.info(`====>Promise_0200 createSubscriber ${data}`)
...
...
@@ -416,9 +395,7 @@ export default function abilityTest() {
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0300',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
await commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
console.info(`====>Promise_0300 createSubscriber ${data}`)
...
...
@@ -452,7 +429,7 @@ export default function abilityTest() {
expect(data.parameters.str).assertEqual('ACTION');
expect(data.parameters.result).assertEqual(0);
}
globalThis.terminate()
globalThis.terminate(
'Promise_0300'
)
abilityDelegator.executeShellCommand('aa force-stop com.example.forresulttestsecond').then(result =>{
console.info('====>Promise_0300 unSubscribeCallback pkill ok' + JSON.stringify(result));
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
...
...
@@ -469,9 +446,7 @@ export default function abilityTest() {
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0400',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
console.info(`====>Promise_0400 createSubscriber ${data}`)
...
...
@@ -506,16 +481,14 @@ export default function abilityTest() {
function unSubscribeCallback() {
console.info(`====>Promise_0400 unSubscribeCallback 'ACTS_CALL_EVENT'`)
setTimeout(() => {
globalThis.terminate()
globalThis.terminate(
'Promise_0400'
)
done()
}, 1000)
}
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0500',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
console.info(`====>Promise_0500 createSubscriber ${data}`)
...
...
@@ -534,24 +507,22 @@ export default function abilityTest() {
console.info(`====>Promise_0500 subscribeCallBack all ${data.event}`)
if(data.event == 'ACTS_CALL_EVENT') {
console.info(`====>Promise_0500 subscribeCallBack 'ACTS_CALL_EVENT' ${data}`)
expect(data.parameters.
result != 0).assertTrue(
);
expect(data.parameters.
num).assertEqual(16000001
);
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
}
}
function unSubscribeCallback() {
console.info(`====>Promise_0500 unSubscribeCallback 'ACTS_CALL_EVENT'`)
globalThis.terminate('Promise_0500')
setTimeout(() => {
globalThis.terminate()
done()
},
2
000)
},
1
000)
}
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0600',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
console.info(`====>Promise_0600 createSubscriber ${data}`)
...
...
@@ -591,9 +562,7 @@ export default function abilityTest() {
})
it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0700',0, async function (done) {
await setTimeout(() => {
console.info(`====>beforeEach setTimeout'`)
}, 2000)
await Driver.create().delayMs(2000)
var subscriber
commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => {
console.info(`====>Promise_0700 createSubscriber ${data}`)
...
...
ability/ability_runtime/actsforresult/maintest/signature/openharmony_sx.p7b
浏览文件 @
9aae33a4
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录