Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c6cdc142
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看板
未验证
提交
c6cdc142
编写于
10月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6195 【Monthly1018挑单】覆盖Caller与AbilityContext的新增接口
Merge pull request !6195 from HuangXW/cherry-pick-1666878504
上级
a053c1f9
41b85888
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
234 addition
and
18 deletion
+234
-18
ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/module.json
...selector/actsappselectorpctest/entry/src/main/module.json
+10
-0
ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/module.json
...ppselector/actsappselectortest/entry/src/main/module.json
+10
-0
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
...temcallentrytest/entry/src/main/ets/test/Ability.test.ets
+181
-0
ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets
...st/thirdcalltest/entry/src/main/ets/test/Ability.test.ets
+10
-10
ability/ability_runtime/actssingleton/SystemSingletonExtension/entry/src/main/ets/test/Ability.test.ets
...ngletonExtension/entry/src/main/ets/test/Ability.test.ets
+2
-2
ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json
...ctsAmsUsersExtensionSystemTest/entry/src/main/module.json
+8
-0
ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/module.json
...ActsAmsUsersExtensionThirdTest/entry/src/main/module.json
+10
-0
ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets
...est/entry/src/main/ets/test/manyusersabilitytest.test.ets
+3
-6
未找到文件。
ability/ability_runtime/actsappselector/actsappselectorpctest/entry/src/main/module.json
浏览文件 @
c6cdc142
...
...
@@ -32,6 +32,16 @@
}
]
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
},
{
"name"
:
"ohos.permission.START_INVISIBLE_ABILITY"
,
"reason"
:
"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
}
\ No newline at end of file
ability/ability_runtime/actsappselector/actsappselectortest/entry/src/main/module.json
浏览文件 @
c6cdc142
...
...
@@ -31,6 +31,16 @@
}
]
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
},
{
"name"
:
"ohos.permission.START_INVISIBLE_ABILITY"
,
"reason"
:
"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
c6cdc142
...
...
@@ -1002,5 +1002,186 @@ export default function abilityTest() {
expect(exceptionFlag).assertEqual(true);
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_5500
* @tc.name: The callee exits abnormally after the caller requests the call to be called successfully.
* @tc.desc: Verify that the caller can register the server's death listener.
*/
it('ACTS_CommonComponent_Call_5500', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5500 begin');
function releaseCallback(data) {
console.log('ACTS_CommonComponent_Call_5500 releaseCallBack:' + data);
expect(data).assertEqual("died");
done();
}
let bundleNameCallee = "com.example.systemappcalleea";
let abilityNameCallee = "com.example.systemappcalleea.MainAbility";
let want = {
bundleName: bundleNameCallee,
abilityName: abilityNameCallee,
}
let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want);
if (typeof caller !== "object" || caller == null) {
console.log('ACTS_CommonComponent_Call_5500 startAbilityByCall fail');
expect().assertFail();
}
try {
caller.on('release', releaseCallback);
} catch (e) {
console.log('ACTS_CommonComponent_Call_5500 Caller onRelease fail ' + e);
expect().assertFail();
}
await appManager.killProcessesByBundleName(bundleNameCallee);
})
/**
* @tc.number: ACTS_CommonComponent_Call_5600
* @tc.name: The callee exits abnormally after the caller requests the call to be called successfully.
* @tc.desc: Verify that the caller can unregister the server's death listener.
*/
it('ACTS_CommonComponent_Call_5600', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5600 begin');
function releaseCallback(data) {
console.log('ACTS_CommonComponent_Call_5600 releaseCallBack:' + data);
expect(data).assertEqual("died");
done();
}
let bundleNameCallee = "com.example.systemappcalleea";
let abilityNameCallee = "com.example.systemappcalleea.MainAbility";
let want = {
bundleName: bundleNameCallee,
abilityName: abilityNameCallee,
}
let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want);
if (typeof caller !== "object" || caller == null) {
console.log('ACTS_CommonComponent_Call_5600 startAbilityByCall fail');
expect().assertFail();
}
try {
caller.off('release', releaseCallback);
} catch (e) {
console.log('ACTS_CommonComponent_Call_5600 Caller onRelease fail ' + e);
expect().assertFail();
done();
}
await appManager.killProcessesByBundleName(bundleNameCallee);
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_5700
* @tc.name: The callee exits abnormally after the caller requests the call to be called successfully.
* @tc.desc: Verify that the caller can unregister the server's death listener.
*/
it('ACTS_CommonComponent_Call_5700', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5700 begin');
function releaseCallback(data) {
console.log('ACTS_CommonComponent_Call_5700 releaseCallBack:' + data);
expect(data).assertEqual("died");
done();
}
let bundleNameCallee = "com.example.systemappcalleea";
let abilityNameCallee = "com.example.systemappcalleea.MainAbility";
let want = {
bundleName: bundleNameCallee,
abilityName: abilityNameCallee,
}
let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want);
if (typeof caller !== "object" || caller == null) {
console.log('ACTS_CommonComponent_Call_5700 startAbilityByCall fail');
expect().assertFail();
}
let flag = false;
try {
caller.off('release');
} catch (e) {
console.log('ACTS_CommonComponent_Call_5700 Caller onRelease fail ' + e);
flag = true;
}
await appManager.killProcessesByBundleName(bundleNameCallee);
expect(flag).assertEqual(true);
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_5800
* @tc.name: The callee exits abnormally after the caller requests the call to be called successfully.
* @tc.desc: Verify that the caller can unregister the server's death listener.
*/
it('ACTS_CommonComponent_Call_5800', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5800 begin');
function releaseCallback(data) {
console.log('ACTS_CommonComponent_Call_5800 releaseCallBack:' + data);
expect(data).assertEqual("died");
done();
}
let bundleNameCallee = "com.example.systemappcalleea";
let abilityNameCallee = "com.example.systemappcalleea.MainAbility";
let want = {
bundleName: bundleNameCallee,
abilityName: abilityNameCallee,
}
let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want);
if (typeof caller !== "object" || caller == null) {
console.log('ACTS_CommonComponent_Call_5800 startAbilityByCall fail');
expect().assertFail();
}
let flag = false;
try {
caller.off('Not release', releaseCallback);
} catch (e) {
console.log('ACTS_CommonComponent_Call_5800 Caller onRelease fail ' + e);
flag = true;
}
await appManager.killProcessesByBundleName(bundleNameCallee);
expect(flag).assertEqual(true);
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_5900
* @tc.name: The callee exits abnormally after the caller requests the call to be called successfully.
* @tc.desc: Verify that the caller can unregister the server's death listener.
*/
it('ACTS_CommonComponent_Call_5900', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5900 begin');
function releaseCallback(data) {
console.log('ACTS_CommonComponent_Call_5900 releaseCallBack:' + data);
expect(data).assertEqual("died");
done();
}
let bundleNameCallee = "com.example.systemappcalleea";
let abilityNameCallee = "com.example.systemappcalleea.MainAbility";
let want = {
bundleName: bundleNameCallee,
abilityName: abilityNameCallee,
}
let caller = await globalThis.globalThis.abilityContext.startAbilityByCall(want);
if (typeof caller !== "object" || caller == null) {
console.log('ACTS_CommonComponent_Call_5900 startAbilityByCall fail');
expect().assertFail();
}
let flag = false;
try {
caller.off('Not release');
} catch (e) {
console.log('ACTS_CommonComponent_Call_5900 Caller onRelease fail ' + e);
flag = true;
}
await appManager.killProcessesByBundleName(bundleNameCallee);
expect(flag).assertEqual(true);
done();
})
})
}
\ No newline at end of file
ability/ability_runtime/actscalltest/thirdcalltest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
c6cdc142
...
...
@@ -88,8 +88,8 @@ export default function abilityTest() {
/**
* @tc.number: ACTS_CommonComponent_Call_1100
* @tc.name: The
parameter "method" of the Caller.callWithResult function is an empty string
.
* @tc.desc: Verify that the
parameter "method" of the Caller.callWithResult function is an empty string
.
* @tc.name: The
thirdApp is not allowed to startAbilityByCall
.
* @tc.desc: Verify that the
thirdApp is not allowed to startAbilityByCall
.
*/
it('ACTS_CommonComponent_Call_1100', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1100 begin');
...
...
@@ -111,8 +111,8 @@ export default function abilityTest() {
/**
* @tc.number: ACTS_CommonComponent_Call_1500
* @tc.name: The
parameter "method" of the Caller.callWithResult function is an empty string
.
* @tc.desc: Verify that the
parameter "method" of the Caller.callWithResult function is an empty string
.
* @tc.name: The
thirdApp is not allowed to startAbilityByCall
.
* @tc.desc: Verify that the
thirdApp is not allowed to startAbilityByCall
.
*/
it('ACTS_CommonComponent_Call_1500', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1500 begin');
...
...
@@ -122,20 +122,20 @@ export default function abilityTest() {
}
globalThis.abilityContext.startAbilityByCall(want)
.then(data => {
console.info(`ACTS_CommonComponent_Call_1
1
00 startAbilityByCall SUCCESS`);
console.info(`ACTS_CommonComponent_Call_1
5
00 startAbilityByCall SUCCESS`);
expect().assertFail();
done();
})
.catch(error => {
console.info(`ACTS_CommonComponent_Call_1
1
00 startAbilityByCall Catch`);
console.info(`ACTS_CommonComponent_Call_1
5
00 startAbilityByCall Catch`);
done();
});
})
/**
* @tc.number: ACTS_CommonComponent_Call_1600
* @tc.name: The
parameter "method" of the Caller.callWithResult function is an empty string
.
* @tc.desc: Verify that the
parameter "method" of the Caller.callWithResult function is an empty string
.
* @tc.name: The
thirdApp is not allowed to startAbilityByCall
.
* @tc.desc: Verify that the
thirdApp is not allowed to startAbilityByCall
.
*/
it('ACTS_CommonComponent_Call_1600', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1600 begin');
...
...
@@ -145,12 +145,12 @@ export default function abilityTest() {
}
globalThis.abilityContext.startAbilityByCall(want)
.then(data => {
console.info(`ACTS_CommonComponent_Call_1
1
00 startAbilityByCall SUCCESS`);
console.info(`ACTS_CommonComponent_Call_1
6
00 startAbilityByCall SUCCESS`);
expect().assertFail();
done();
})
.catch(error => {
console.info(`ACTS_CommonComponent_Call_1
1
00 startAbilityByCall Catch`);
console.info(`ACTS_CommonComponent_Call_1
6
00 startAbilityByCall Catch`);
done();
});
})
...
...
ability/ability_runtime/actssingleton/SystemSingletonExtension/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
c6cdc142
...
...
@@ -48,7 +48,7 @@ export default function singleusermodelTest() {
console.debug("====>start connectAbilityWithAccount====>");
connId = globalThis.abilityContext.connectAbilityWithAccount(
connId = globalThis.abilityContext.connect
ServiceExtension
AbilityWithAccount(
{
bundleName: "com.singleusermodel.actssingleusertest",
abilityName: "ServiceAbility1",
...
...
@@ -86,7 +86,7 @@ export default function singleusermodelTest() {
console.info('executeShellCommand : err : ' + JSON.stringify(err));
})
console.debug('ACTS_ExtensionSingleUserModel_0500====>timeout====>');
await globalThis.abilityContext.disconnectAbility(connId).then((data) => {
await globalThis.abilityContext.disconnect
ServiceExtension
Ability(connId).then((data) => {
console.debug("====>data is====>" + JSON.stringify(data));
})
}, START_ABILITY_TIMEOUT);
...
...
ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json
浏览文件 @
c6cdc142
...
...
@@ -114,6 +114,14 @@
{
"name"
:
"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"
,
"reason"
:
"need use ohos.permission.MANAGE_LOCAL_ACCOUNTS"
},
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
},
{
"name"
:
"ohos.permission.START_INVISIBLE_ABILITY"
,
"reason"
:
"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
...
...
ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/module.json
浏览文件 @
c6cdc142
...
...
@@ -61,6 +61,16 @@
"type"
:
"service"
,
"visible"
:
true
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
,
"reason"
:
"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
},
{
"name"
:
"ohos.permission.START_INVISIBLE_ABILITY"
,
"reason"
:
"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
}
ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets
浏览文件 @
c6cdc142
...
...
@@ -81,13 +81,12 @@ export default function abilityTest() {
let id;
let connId;
function subscribeCallBack(err, data) {
console.debug("====>ACTS_ConnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data));
clearTimeout(id);
expect(data.event).assertEqual("AMS_ConnectAbility_0100_commonEvent");
console.debug("====>ACTS_ConnectAbility_0100 5 ");
globalThis.abilityContext.disconnectAbility(
globalThis.abilityContext.disconnect
ServiceExtension
Ability(
connId,
(error, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data)
...
...
@@ -98,7 +97,6 @@ export default function abilityTest() {
}
commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => {
console.debug("====>ACTS_ConnectAbility_0100 2 Subscriber1====>");
subscriber = data;
...
...
@@ -114,7 +112,7 @@ export default function abilityTest() {
expect().assertFail();
console.debug('AMS_ConnectAbility_0100 timeout');
commonEvent.unsubscribe(subscriber, unSubscribeCallback)
globalThis.abilityContext.disconnectAbility(
globalThis.abilityContext.disconnect
ServiceExtension
Ability(
connId,
(error, data) => {
console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data)
...
...
@@ -139,7 +137,7 @@ export default function abilityTest() {
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
console.debug("====>ACTS_ConnectAbility_0100 3 ");
connId = await globalThis.abilityContext.connectAbility(
connId = await globalThis.abilityContext.connect
ServiceExtension
Ability(
{
bundleName: "com.example.actsconnectabilitysystemabilitytest",
abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility",
...
...
@@ -152,7 +150,6 @@ export default function abilityTest() {
}
);
console.debug("====>ACTS_ConnectAbility_0100 4 ");
})
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录