Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8f27c5fe
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看板
提交
8f27c5fe
编写于
10月 15, 2022
作者:
C
caochunlei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
caochunlei1@huawei.com
Signed-off-by:
N
caochunlei
<
caochunlei1@huawei.com
>
上级
482b4870
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
128 addition
and
92 deletion
+128
-92
ability/ability_runtime/actssingleton/SystemSingleton/entry/src/main/ets/test/Ability.test.ets
.../SystemSingleton/entry/src/main/ets/test/Ability.test.ets
+7
-7
ability/ability_runtime/actssingleton/SystemSingletonExtension/entry/src/main/ets/test/Ability.test.ets
...ngletonExtension/entry/src/main/ets/test/Ability.test.ets
+47
-33
ability/ability_runtime/actssingleton/SystemSingletonExtensionFalse/entry/src/main/ets/test/Ability.test.ets
...onExtensionFalse/entry/src/main/ets/test/Ability.test.ets
+49
-33
ability/ability_runtime/actssingleton/SystemSingletonFalse/entry/src/main/ets/test/Ability.test.ets
...emSingletonFalse/entry/src/main/ets/test/Ability.test.ets
+2
-2
ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/entry/src/main/ets/MainAbility3/MainAbility3.ts
...ThirdTest/entry/src/main/ets/MainAbility3/MainAbility3.ts
+7
-3
ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets
...itystagetest/entry/src/main/ets/test/StartAbilityTest.ets
+16
-14
未找到文件。
ability/ability_runtime/actssingleton/SystemSingleton/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
8f27c5fe
...
...
@@ -134,21 +134,21 @@ export default function singleusermodelTest() {
*/
it('ACTS_SingleUserModel_1600', 0, async function (done) {
console.
debug
("====>start startAbilityWithAccount====>");
console.
info
("====>start startAbilityWithAccount====>");
try {
await globalThis.abilityContext.startAbilityWithAccount(
{
bundleName: 'com.singleusermodel.actssingleusertest',
abilityName: 'SingleUserModel1600'
}, null).then((data) => {
console.
debug
("====>startAbilityWithAccount 1600 end====>" + data);
console.
info
("====>startAbilityWithAccount 1600 end====>" + data);
}).catch((err) => {
console.
debug
("====>startAbilityWithAccount 1600 end====>" + err);
console.
info
("====>startAbilityWithAccount 1600 end====>" + err);
})
} catch (err) {
let e = err.toString()
let errLog = "
Cannot read property then of undefined
"
console.
debug("
====>e====>" + e);
let errLog = "
Invalid input parameter
"
console.
info("ACTS_SingleUserModel_1600
====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue()
}
setTimeout(async () => {
...
...
@@ -176,7 +176,7 @@ export default function singleusermodelTest() {
console.debug('ACTS_SingleUserModel_1600====>timeout====>');
}, START_ABILITY_TIMEOUT)
setTimeout(() => {
console.
debug
('ACTS_SingleUserModel_1600====>done====>');
console.
info
('ACTS_SingleUserModel_1600====>done====>');
done();
}, ABILITY_TIMEOUT)
})
...
...
@@ -202,7 +202,7 @@ export default function singleusermodelTest() {
})
} catch (err) {
let e = err.toString()
let errLog = "
Cannot read property then of undefined
"
let errLog = "
Invalid input parameter
"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue()
}
...
...
ability/ability_runtime/actssingleton/SystemSingletonExtension/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
8f27c5fe
...
...
@@ -182,23 +182,30 @@ export default function singleusermodelTest() {
*/
it('ACTS_ExtensionSingleUserModel_0700', 0, async function (done) {
console.log("ACTS_ExtensionSingleUserModel_0700====>callback start====>");
let connId;
console.debug("====>start connectAbilityWithAccount====>");
connId = globalThis.abilityContext.connectAbilityWithAccount(
{
bundleName: "com.singleusermodel.actssingleusertest",
abilityName: "ServiceAbility3",
action: "StartAbilityPromise"
},
null,
{
onConnect: onConnectCallbackC,
onDisconnect: onDisconnectCallbackC,
onFailed: onFailedCallbackC,
}
);
console.log('ACTS_ExtensionSingleUserModel_0700====>StartConnectNative ' +
'connectAbilityWithAccount connId : ' + connId);
try {
let connId;
console.debug("====>start connectAbilityWithAccount====>");
connId = globalThis.abilityContext.connectAbilityWithAccount(
{
bundleName: "com.singleusermodel.actssingleusertest",
abilityName: "ServiceAbility3",
action: "StartAbilityPromise"
},
null,
{
onConnect: onConnectCallbackC,
onDisconnect: onDisconnectCallbackC,
onFailed: onFailedCallbackC,
}
);
console.log('ACTS_ExtensionSingleUserModel_0700====>StartConnectNative ' +
'connectAbilityWithAccount connId : ' + connId);
} catch (err) {
let e = err.toString()
let errLog = "Invalid input parameter"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue()
}
setTimeout(async () => {
let abilityDelegator = undefined
...
...
@@ -318,23 +325,30 @@ export default function singleusermodelTest() {
*/
it('ACTS_ExtensionSingleUserModel_1300', 0, async function (done) {
console.log("ACTS_ExtensionSingleUserModel_1300====>callback start====>");
let connId;
try {
let connId;
connId = globalThis.abilityContext.connectAbilityWithAccount(
{
bundleName: "com.singleusermodel.actssingleusertest",
abilityName: "ServiceAbility5",
action: "StartAbilityPromise"
},
undefined,
{
onConnect: onConnectCallbackE,
onDisconnect: onDisconnectCallbackE,
onFailed: onFailedCallbackE,
}
);
console.log('ACTS_ExtensionSingleUserModel_1300====>StartConnectNative ' +
'connectAbilityWithAccount connId : ' + connId);
} catch (err) {
let e = err.toString()
let errLog = "Invalid input parameter"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue()
}
connId = globalThis.abilityContext.connectAbilityWithAccount(
{
bundleName: "com.singleusermodel.actssingleusertest",
abilityName: "ServiceAbility5",
action: "StartAbilityPromise"
},
undefined,
{
onConnect: onConnectCallbackE,
onDisconnect: onDisconnectCallbackE,
onFailed: onFailedCallbackE,
}
);
console.log('ACTS_ExtensionSingleUserModel_1300====>StartConnectNative ' +
'connectAbilityWithAccount connId : ' + connId);
setTimeout(async () => {
let abilityDelegator = undefined
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
...
...
ability/ability_runtime/actssingleton/SystemSingletonExtensionFalse/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
8f27c5fe
...
...
@@ -183,24 +183,31 @@ export default function singleusermodelTest() {
*/
it('ACTS_ExtensionSingleUserModel_1600', 0, async function(done){
console.log("ACTS_ExtensionSingleUserModel_1600====>callback start====>");
let connId;
console.debug("====>start connectAbilityWithAccount====>");
connId = globalThis.abilityContext.connectAbilityWithAccount(
{
bundleName: "com.singleusermodel.actssingleusertest",
abilityName: "ServiceAbility3",
action: "StartAbilityPromise"
},
null,
{
onConnect: onConnectCallbackC,
onDisconnect: onDisconnectCallbackC,
onFailed: onFailedCallbackC,
}
);
console.log('ACTS_ExtensionSingleUserModel_1600====>StartConnectNative ' +
'connectAbilityWithAccount connId : ' + connId);
try {
let connId;
console.debug("====>start connectAbilityWithAccount====>");
connId = globalThis.abilityContext.connectAbilityWithAccount(
{
bundleName: "com.singleusermodel.actssingleusertest",
abilityName: "ServiceAbility3",
action: "StartAbilityPromise"
},
null,
{
onConnect: onConnectCallbackC,
onDisconnect: onDisconnectCallbackC,
onFailed: onFailedCallbackC,
}
);
console.log('ACTS_ExtensionSingleUserModel_1600====>StartConnectNative ' +
'connectAbilityWithAccount connId : ' + connId);
} catch (err) {
let e = err.toString()
let errLog = "Invalid input parameter"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue()
}
setTimeout(async()=> {
let abilityDelegator = undefined
...
...
@@ -323,22 +330,31 @@ export default function singleusermodelTest() {
*/
it('ACTS_ExtensionSingleUserModel_1900', 0, async function(done){
console.log("ACTS_ExtensionSingleUserModel_1900====>callback start====>");
let connId;
connId = globalThis.abilityContext.connectAbilityWithAccount(
{
bundleName: "com.singleusermodel.actssingleusertest",
abilityName: "ServiceAbility5",
action: "StartAbilityPromise"
},
undefined,
{
onConnect: onConnectCallbackE,
onDisconnect: onDisconnectCallbackE,
onFailed: onFailedCallbackE,
}
);
console.log('ACTS_ExtensionSingleUserModel_1900====>StartConnectNative ' +
'connectAbilityWithAccount connId : ' + connId);
try {
let connId;
connId = globalThis.abilityContext.connectAbilityWithAccount(
{
bundleName: "com.singleusermodel.actssingleusertest",
abilityName: "ServiceAbility5",
action: "StartAbilityPromise"
},
undefined,
{
onConnect: onConnectCallbackE,
onDisconnect: onDisconnectCallbackE,
onFailed: onFailedCallbackE,
}
);
console.log('ACTS_ExtensionSingleUserModel_1900====>StartConnectNative ' +
'connectAbilityWithAccount connId : ' + connId);
} catch (err) {
let e = err.toString()
let errLog = "Invalid input parameter"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue()
}
setTimeout(async()=> {
let abilityDelegator = undefined
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
...
...
ability/ability_runtime/actssingleton/SystemSingletonFalse/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
8f27c5fe
...
...
@@ -150,7 +150,7 @@ export default function singleusermodelTest() {
})
} catch (err) {
let e = err.toString();
let errLog = "
Cannot read property then of undefined
"
let errLog = "
Invalid input parameter
"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue()
}
...
...
@@ -252,7 +252,7 @@ export default function singleusermodelTest() {
})
} catch (err) {
let e = err.toString();
let errLog = "
Cannot read property then of undefined
"
let errLog = "
Invalid input parameter
"
console.debug("====>e====>" + e);
expect(e.indexOf(errLog) >= 0).assertTrue()
}
...
...
ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/entry/src/main/ets/MainAbility3/MainAbility3.ts
浏览文件 @
8f27c5fe
...
...
@@ -46,9 +46,13 @@ export default class MainAbility extends Ability {
onForeground
()
{
console
.
log
(
"
MainAbility3 onForeground
"
)
globalThis
.
abilityContext3
.
terminateSelfWithResult
({
resultCode
:
1
})
try
{
globalThis
.
abilityContext3
.
terminateSelfWithResult
({
resultCode
:
1
})
}
catch
(
error
)
{
}
}
onBackground
()
{
...
...
ability/ability_runtime/freeinstalltest/startabilitystagetest/actsfreeinstallstartabilitystagetest/entry/src/main/ets/test/StartAbilityTest.ets
浏览文件 @
8f27c5fe
...
...
@@ -24,7 +24,9 @@ import Prompt from '@system.prompt';
import
abilityManager
from
'@ohos.application.abilityManager'
;
import
commonEvent
from
'@ohos.commonEvent'
;
const
SYSTEM_INNER_ERROR
=
16000050
const
ERR_COMPONENT_NOF_FOUND
=
16000001
const
ERR_NOT_TOP
=
16000053
export
default
function
startAbilityTest
(
abilityContext
)
{
describe
(
'startAbilityTest'
,
function
()
{
...
...
@@ -228,7 +230,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
4
)
.
assertTrue
();
expect
(
error
.
code
==
SYSTEM_INNER_ERROR
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_0300-------------"
);
...
...
@@ -504,7 +506,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
1
)
.
assertTrue
();
expect
(
error
.
code
==
ERR_COMPONENT_NOF_FOUND
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_1100-------------"
);
...
...
@@ -568,7 +570,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
1
)
.
assertTrue
();
expect
(
error
.
code
==
ERR_COMPONENT_NOF_FOUND
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_1300-------------"
);
...
...
@@ -632,7 +634,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
1
)
.
assertTrue
();
expect
(
error
.
code
==
ERR_COMPONENT_NOF_FOUND
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_1500-------------"
);
...
...
@@ -694,7 +696,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
1
)
.
assertTrue
();
expect
(
error
.
code
==
ERR_COMPONENT_NOF_FOUND
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_1700-------------"
);
...
...
@@ -831,7 +833,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
13
)
.
assertTrue
();
expect
(
error
.
code
==
ERR_NOT_TOP
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_2300-------------"
);
...
...
@@ -866,7 +868,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
13
)
.
assertTrue
();
expect
(
error
.
code
==
ERR_NOT_TOP
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_2400-------------"
);
...
...
@@ -914,7 +916,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
3
)
.
assertTrue
();
expect
(
error
.
code
==
SYSTEM_INNER_ERROR
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_2500-------------"
);
...
...
@@ -1010,7 +1012,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
4
)
.
assertTrue
();
expect
(
error
.
code
==
SYSTEM_INNER_ERROR
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_3100-------------"
);
...
...
@@ -1049,7 +1051,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
1
)
.
assertTrue
();
expect
(
error
.
code
==
SYSTEM_INNER_ERROR
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_3200-------------"
);
...
...
@@ -1077,7 +1079,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
1
)
.
assertTrue
();
expect
(
error
.
code
==
SYSTEM_INNER_ERROR
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_3300-------------"
);
...
...
@@ -1181,7 +1183,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
13
)
.
assertTrue
();
expect
(
error
.
code
==
ERR_NOT_TOP
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_1900-------------"
);
...
...
@@ -1228,7 +1230,7 @@ export default function startAbilityTest(abilityContext) {
console
.
log
(
TAG
+
": startAbility success. data: "
+
JSON
.
stringify
(
data
));
})
.
catch
((
error
)
=>
{
console
.
log
(
TAG
+
": startAbility fail. err: "
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
==
13
)
.
assertTrue
();
expect
(
error
.
code
==
ERR_NOT_TOP
)
.
assertTrue
();
});
await
sleep
(
2000
);
console
.
info
(
"------------end FreeInstall_Stage_Local_StartAbility_2000-------------"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录