Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0d582481
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看板
未验证
提交
0d582481
编写于
7月 12, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4258 XTS关于specified的失败用例适配
Merge pull request !4258 from chengxingzhen/cherry-pick-1657542584
上级
3f70f3e9
075efce7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
94 addition
and
114 deletion
+94
-114
ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets
...ultiinstancetest/entry/src/main/ets/test/Ability.test.ets
+85
-108
ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js
...c/main/js/test/ActsStServiceAbilityClientCaseTest.test.js
+7
-5
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
...ytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
+2
-1
未找到文件。
ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
0d582481
...
...
@@ -14,24 +14,11 @@
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"deccjsunit/index"
import
commonEvent
from
'@ohos.commonEvent'
import
bundle
from
'@ohos.bundle'
import
missionManager
from
'@ohos.application.missionManager'
import
appManager
from
'@ohos.application.appManager'
var
subscriberInfoMultiInstance
=
{
let
subscriberInfoMultiInstance
=
{
events
:
[
"MultiInstanceStartNext"
,
"MultiInstanceStartFinish"
]
};
const
BUNDLE_PATHS
=
[[
'/data/ActsAmsAbilityMultiinstanceHapARelyHap.hap'
],
[
'/data/ActsAmsAbilityMultiinstanceHapBRelyHap.hap'
],
[
'/data/ActsAmsAbilityMultiinstanceHapCRelyHap.hap'
],
[
'/data/ActsAmsAbilityMultiinstanceHapDRelyHap.hap'
],
[
'/data/ActsAmsAbilityMultiinstanceHapERelyHap.hap'
]];
const
BUNDLE_NAMES
=
[
'com.example.amsabilitymultiinstanceappa'
,
'com.example.amsabilitymultiinstanceappb'
,
'com.example.amsabilitymultiinstanceappc'
,
'com.example.amsabilitymultiinstanceappd'
,
'com.example.amsabilitymultiinstanceappe'
];
const
BUNDLE_COUNT
=
5
;
const
START_ABILITY_TIMEOUT
=
9000
;
const
MAX_MISSION_NUM
=
1024
;
const
ONACCEPTWANT_KEY_NOTSET_ID
=
-
1
;
const
ONACCEPTWANT_KEY_UNDEFINED_ID
=
-
2
;
const
UNSUBSCRIBE_TIMEOUT
=
5000
;
...
...
@@ -48,6 +35,9 @@ async function startAbilityProcess(abilityContext, parameters) {
case
"StartA2"
:
parameters
.
startId
=
2
;
break
;
case
"StartA3"
:
parameters
.
startId
=
3
;
break
;
case
"StartANS"
:
parameters
.
startId
=
ONACCEPTWANT_KEY_NOTSET_ID
;
break
;
...
...
@@ -101,17 +91,6 @@ async function startAbilityProcess(abilityContext, parameters) {
export
default
function
abilityTest
(
abilityContext
)
{
describe
(
'ActsAbilityTest'
,
function
()
{
beforeEach
(
async
(
done
)
=>
{
console
.
log
(
'======>beforeEach ininin<======='
);
done
();
})
afterEach
(
async
(
done
)
=>
{
let
installer
=
await
bundle
.
getBundleInstaller
();
var
count
=
0
;
done
();
})
/*
* @tc.number: ACTS_AbilityMultiInstance_Multi_0100
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
...
...
@@ -119,16 +98,15 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_0100'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0100====<begin'
);
var
subscriber
;
var
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId1"
,
"AppB:onCreateonForeground"
,
let
subscriber
;
let
id
;
let
result
;
let
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId1"
,
"AppB:onCreateonForeground"
,
"AppA:onForegroundonAcceptWantCalledId1"
];
var
checkIndex
=
0
;
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
if
(
data
.
event
==
"MultiInstanceStartFinish"
)
{
clearTimeout
(
id
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0100 finish callBackSeq = '
+
data
.
data
);
...
...
@@ -178,12 +156,11 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_0200'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0200====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId1"
,
"AppB:onCreateonForeground"
,
let
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId3"
,
"AppB:onCreateonForeground"
,
"AppA:onCreateonForegroundonAcceptWantCalledId2"
];
var
checkIndex
=
0
;
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -227,7 +204,7 @@ export default function abilityTest(abilityContext) {
startId
:
0
,
stepNum
:
3
,
nextStep
:
0
,
step
:
[
"StartA
1
"
,
"StartB"
,
"StartA2"
]
step
:
[
"StartA
3
"
,
"StartB"
,
"StartA2"
]
});
})
...
...
@@ -238,12 +215,12 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_0300'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0300====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreate
onForegroundonAcceptWantCalledId1"
,
"AppC:onCreateonForeground"
,
let
result
;
let
checkEventResults
=
[
"AppA:
onForegroundonAcceptWantCalledId1"
,
"AppC:onCreateonForeground"
,
"AppA:onForegroundonAcceptWantCalledId1"
];
var
checkIndex
=
0
;
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -298,12 +275,12 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_0400'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0400====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId1"
,
"AppC:onCreate
onForeground"
,
"AppA:on
Createon
ForegroundonAcceptWantCalledId2"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppA:onForegroundonAcceptWantCalledId3"
,
"AppC:
onForeground"
,
"AppA:onForegroundonAcceptWantCalledId2"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -312,7 +289,7 @@ export default function abilityTest(abilityContext) {
clearTimeout
(
id
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0400 finish callBackSeq = '
+
data
.
data
);
expect
(
data
.
data
)
.
assertEqual
(
checkEventResults
[
checkIndex
++
]);
expect
(
checkIndex
)
.
assertEqual
(
3
);
expect
(
checkIndex
)
.
assertEqual
(
2
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0400 finish'
);
}
else
if
(
data
.
event
==
"MultiInstanceStartNext"
)
{
...
...
@@ -347,7 +324,7 @@ export default function abilityTest(abilityContext) {
startId
:
0
,
stepNum
:
3
,
nextStep
:
0
,
step
:
[
"StartA
1
"
,
"StartC"
,
"StartA2"
]
step
:
[
"StartA
3
"
,
"StartC"
,
"StartA2"
]
});
})
...
...
@@ -358,12 +335,12 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_0600'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0600====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreate
onForegroundonAcceptWantCalledId1"
,
"AppA:on
Createon
ForegroundonAcceptWantCalledId2"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppA:
onForegroundonAcceptWantCalledId1"
,
"AppA:onForegroundonAcceptWantCalledId2"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -418,12 +395,12 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_0700'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0700====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreate
onForegroundonAcceptWantCalledId1"
,
"AppB:onCreateonForeground"
,
"AppC:on
Createon
Foreground"
,
"AppA:onForegroundonAcceptWantCalledId1"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppA:
onForegroundonAcceptWantCalledId1"
,
"AppB:onCreateonForeground"
,
"AppC:onForeground"
,
"AppA:onForegroundonAcceptWantCalledId1"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -432,7 +409,7 @@ export default function abilityTest(abilityContext) {
clearTimeout
(
id
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0700 finish callBackSeq = '
+
data
.
data
);
expect
(
data
.
data
)
.
assertEqual
(
checkEventResults
[
checkIndex
++
]);
expect
(
checkIndex
)
.
assertEqual
(
4
);
expect
(
checkIndex
)
.
assertEqual
(
3
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0700 finish'
);
}
else
if
(
data
.
event
==
"MultiInstanceStartNext"
)
{
...
...
@@ -478,12 +455,12 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_0800'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0800====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId1
"
,
"AppB:onCreateonForeground"
,
"AppC:on
Createon
Foreground"
,
"AppA:onCreateonForegroundonAcceptWantCalledId2"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppA:onForegroundonAcceptWantCalledId3
"
,
"AppB:onCreateonForeground"
,
"AppC:onForeground"
,
"AppA:onCreateonForegroundonAcceptWantCalledId2"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -492,7 +469,7 @@ export default function abilityTest(abilityContext) {
clearTimeout
(
id
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0800 finish callBackSeq = '
+
data
.
data
);
expect
(
data
.
data
)
.
assertEqual
(
checkEventResults
[
checkIndex
++
]);
expect
(
checkIndex
)
.
assertEqual
(
4
);
expect
(
checkIndex
)
.
assertEqual
(
3
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0800 finish'
);
}
else
if
(
data
.
event
==
"MultiInstanceStartNext"
)
{
...
...
@@ -527,7 +504,7 @@ export default function abilityTest(abilityContext) {
startId
:
0
,
stepNum
:
4
,
nextStep
:
0
,
step
:
[
"StartA
1
"
,
"StartB"
,
"StartC"
,
"StartA2"
]
step
:
[
"StartA
3
"
,
"StartB"
,
"StartC"
,
"StartA2"
]
});
})
...
...
@@ -538,12 +515,12 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_0900'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0900====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppB:onCreateonForeground"
,
"AppA:onCreate
onForegroundonAcceptWantCalledId1"
,
"AppC:on
Createon
Foreground"
,
"AppA:onForegroundonAcceptWantCalledId1"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppB:onCreateonForeground"
,
"AppA:
onForegroundonAcceptWantCalledId1"
,
"AppC:onForeground"
,
"AppA:onForegroundonAcceptWantCalledId1"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -552,7 +529,7 @@ export default function abilityTest(abilityContext) {
clearTimeout
(
id
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0900 finish callBackSeq = '
+
data
.
data
);
expect
(
data
.
data
)
.
assertEqual
(
checkEventResults
[
checkIndex
++
]);
expect
(
checkIndex
)
.
assertEqual
(
4
);
expect
(
checkIndex
)
.
assertEqual
(
3
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_0900 finish'
);
}
else
if
(
data
.
event
==
"MultiInstanceStartNext"
)
{
...
...
@@ -598,12 +575,12 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_1000'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1000====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppB:onCreateonForeground"
,
"AppA:onCreate
onForegroundonAcceptWantCalledId1"
,
"AppC:on
CreateonForeground"
,
"AppA:onCreate
onForegroundonAcceptWantCalledId2"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppB:onCreateonForeground"
,
"AppA:
onForegroundonAcceptWantCalledId1"
,
"AppC:on
Foreground"
,
"AppA:
onForegroundonAcceptWantCalledId2"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -612,7 +589,7 @@ export default function abilityTest(abilityContext) {
clearTimeout
(
id
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1000 finish callBackSeq = '
+
data
.
data
);
expect
(
data
.
data
)
.
assertEqual
(
checkEventResults
[
checkIndex
++
]);
expect
(
checkIndex
)
.
assertEqual
(
4
);
expect
(
checkIndex
)
.
assertEqual
(
3
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
);
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1000 finish'
);
}
else
if
(
data
.
event
==
"MultiInstanceStartNext"
)
{
...
...
@@ -658,12 +635,12 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_1100'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1100====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppD:onCreateonForegroundonAcceptWantCalledId1"
,
"AppD:onCreateonForeground"
,
let
result
;
let
checkEventResults
=
[
"AppD:onCreateonForegroundonAcceptWantCalledId1"
,
"AppD:onCreateonForeground"
,
"AppD:onCreateonForeground"
,
"AppD:onForegroundonAcceptWantCalledId1"
];
var
checkIndex
=
0
;
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -718,12 +695,12 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_1200'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1200====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppD:onCreateonForegroundonAcceptWantCalledId1
"
,
"AppD:onCreateonForeground"
,
"AppD:on
CreateonForeground"
,
"AppD:onCreateonForegroundonAcceptWantCalledId2
"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppD:onCreateonForegroundonAcceptWantCalledId2
"
,
"AppD:onCreateonForeground"
,
"AppD:on
Foreground"
,
"AppD:onForegroundonAcceptWantCalledId1
"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -767,7 +744,7 @@ export default function abilityTest(abilityContext) {
startId
:
0
,
stepNum
:
4
,
nextStep
:
0
,
step
:
[
"StartDMain
1"
,
"StartDSec"
,
"StartDThd"
,
"StartDMain2
"
]
step
:
[
"StartDMain
2"
,
"StartDSec"
,
"StartDThd"
,
"StartDMain1
"
]
});
})
...
...
@@ -778,11 +755,11 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_1300'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1300====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppB:onCreateonForeground"
,
"AppB:onCreateonForeground"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppB:onCreateonForeground"
,
"AppB:onCreateonForeground"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -837,11 +814,11 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_1400'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1400====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppE:onInitonShow"
,
"AppA:onCreate
onForegroundonAcceptWantCalledId1"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppE:onInitonShow"
,
"AppA:
onForegroundonAcceptWantCalledId1"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -896,11 +873,11 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_1500'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1500====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId1
"
,
"AppE:onInitonShow"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppA:onForegroundonAcceptWantCalledId2
"
,
"AppE:onInitonShow"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -944,7 +921,7 @@ export default function abilityTest(abilityContext) {
startId
:
0
,
stepNum
:
2
,
nextStep
:
0
,
step
:
[
"StartA
1
"
,
"StartE"
]
step
:
[
"StartA
2
"
,
"StartE"
]
});
})
...
...
@@ -955,11 +932,11 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_1600'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1600====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId-1"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId-1"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
@@ -1013,11 +990,11 @@ export default function abilityTest(abilityContext) {
*/
it
(
'ACTS_AbilityMultiInstance_Single_1700'
,
0
,
async
function
(
done
)
{
console
.
log
(
'ACTS_AbilityMultiInstance_Single_1700====<begin'
);
var
subscriber
;
let
subscriber
;
let
id
;
var
result
;
var
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId-2"
];
var
checkIndex
=
0
;
let
result
;
let
checkEventResults
=
[
"AppA:onCreateonForegroundonAcceptWantCalledId-2"
];
let
checkIndex
=
0
;
function
subscribeCallBack
(
err
,
data
)
{
console
.
debug
(
"====>Subscribe CallBack data:====>"
+
JSON
.
stringify
(
data
));
...
...
ability/ability_runtime/actsstserviceabilityclientcase/entry/src/main/js/test/ActsStServiceAbilityClientCaseTest.test.js
浏览文件 @
0d582481
...
...
@@ -16,6 +16,8 @@ import featureAbility from '@ohos.ability.featureAbility'
import
commonEvent
from
'
@ohos.commonEvent
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
errCode
=
1
;
describe
(
'
ActsStServiceAbilityTest
'
,
function
()
{
let
bundleName
=
"
com.amsst.stserviceabilityserver
"
;
let
abilityName
=
"
com.amsst.stserviceabilityserver.ServiceAbility
"
;
...
...
@@ -98,7 +100,7 @@ describe('ActsStServiceAbilityTest', function () {
featureAbility
.
startAbility
(
StartAbilityParameter
,(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AAbilityStartSetting_0100 asyncCallback errCode :
'
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
expect
(
2097152
).
assertEqual
(
err
.
code
);
expect
(
errCode
).
assertEqual
(
err
.
code
);
done
();
});
}
catch
(
error
){
...
...
@@ -136,7 +138,7 @@ describe('ActsStServiceAbilityTest', function () {
featureAbility
.
startAbility
(
StartAbilityParameter
,(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AAbilityStartSettingNew_0200 asyncCallback errCode :
'
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
expect
(
2097152
).
assertEqual
(
err
.
code
);
expect
(
errCode
).
assertEqual
(
err
.
code
);
done
();
});
}
catch
(
error
){
...
...
@@ -174,7 +176,7 @@ it("ACTS_AAbilityStartSettingNew_0300",0, async function(done){
featureAbility
.
startAbility
(
StartAbilityParameter
,(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AAbilityStartSettingNew_0300 asyncCallback errCode :
'
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
expect
(
2097152
).
assertEqual
(
err
.
code
);
expect
(
errCode
).
assertEqual
(
err
.
code
);
done
();
});
}
catch
(
error
){
...
...
@@ -212,7 +214,7 @@ it("ACTS_AAbilityStartSettingNew_0400",0, async function(done){
featureAbility
.
startAbility
(
StartAbilityParameter
,(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AAbilityStartSettingNew_0400 asyncCallback errCode :
'
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
expect
(
2097152
).
assertEqual
(
err
.
code
);
expect
(
errCode
).
assertEqual
(
err
.
code
);
done
();
});
}
catch
(
error
){
...
...
@@ -250,7 +252,7 @@ it("ACTS_AAbilityStartSettingNew_0500",0, async function(done){
featureAbility
.
startAbility
(
StartAbilityParameter
,(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_AAbilityStartSettingNew_0500 asyncCallback errCode :
'
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
expect
(
2097152
).
assertEqual
(
err
.
code
);
expect
(
errCode
).
assertEqual
(
err
.
code
);
done
();
});
}
catch
(
error
){
...
...
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
浏览文件 @
0d582481
...
...
@@ -25,6 +25,7 @@ const CREATELOCALDIR = "/data/storage/el2/base/haps/entry";
const
START_ABILITY_TIMEOUT
=
4000
;
const
TERMINATE_ABILITY_TIMEOUT
=
1000
;
const
TIMEOUT
=
1000
;
const
errCode
=
1
;
var
subscriberInfoActsStartAbility0100
=
{
events
:
[
"
ACTS_StartAbility_0100_CommonEvent
"
],
};
...
...
@@ -1845,7 +1846,7 @@ describe('ActsFeatureAbilityTest', function () {
featureAbility
.
startAbility
(
StartAbilityParameter
,(
err
,
data
)
=>
{
console
.
log
(
'
ACTS_StartAbility_0700 asyncCallback errCode :
'
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
==
2097152
).
assertTrue
(
);
expect
(
err
Code
).
assertEqual
(
error
.
code
);
done
();
});
}
catch
(
error
){
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录