Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
85ea2b58
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看板
提交
85ea2b58
编写于
1月 11, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cxzMaster
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
eb5a5405
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
148 addition
and
118 deletion
+148
-118
aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...hscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+14
-11
aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...tscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+14
-11
aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...hscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+15
-12
aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...dscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+15
-12
aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...dscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+16
-13
aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...hscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+14
-11
aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...tscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+15
-12
aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...hscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+15
-12
aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...dscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+15
-12
aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
...dscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+15
-12
未找到文件。
aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -67,7 +67,8 @@ describe('ActsAmsCallBackFifthScene', function () {
},
},
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -76,7 +77,7 @@ describe('ActsAmsCallBackFifthScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -127,8 +128,13 @@ describe('ActsAmsCallBackFifthScene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -147,15 +153,13 @@ describe('ActsAmsCallBackFifthScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_6600 getAllRunningProcesses JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -182,7 +186,8 @@ describe('ActsAmsCallBackFifthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it
(
'
Acts_Ams_test_7000
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
,
(
error
,
data
)
=>
{
console
.
info
(
'
queryRecentAbilityMissionInfos error.code :
\
...
...
@@ -282,15 +287,13 @@ describe('ActsAmsCallBackFifthScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_9000 getActiveProcessInfos data
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -64,7 +64,8 @@ describe('ActsAmsCallBackFirstScene', function () {
},
},
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -73,7 +74,7 @@ describe('ActsAmsCallBackFirstScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -98,8 +99,13 @@ describe('ActsAmsCallBackFirstScene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -118,15 +124,13 @@ describe('ActsAmsCallBackFirstScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_0200 getAllRunningProcesses data
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
9
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -200,7 +204,8 @@ describe('ActsAmsCallBackFirstScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it
(
'
Acts_Ams_test_0600
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
,
(
error
,
info
)
=>
{
console
.
info
(
'
queryRunningAbilityMissionInfos error.code :
\
...
...
@@ -253,15 +258,13 @@ describe('ActsAmsCallBackFirstScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_8600 getActiveProcessInfos data
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
9
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -70,7 +70,8 @@ describe('ActsAmsCallBackFourthScene', function () {
},
},
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -79,7 +80,7 @@ describe('ActsAmsCallBackFourthScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -143,8 +144,13 @@ describe('ActsAmsCallBackFourthScene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -163,15 +169,13 @@ describe('ActsAmsCallBackFourthScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_5000 getAllRunningProcesses JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
11
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -199,7 +203,8 @@ describe('ActsAmsCallBackFourthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it
(
'
Acts_Ams_test_5400
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
100
,
flag
=
1
;
var
maxnum
=
100
;
var
flag
=
1
;
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
,
(
error
,
data
)
=>
{
console
.
info
(
'
queryRecentAbilityMissionInfos error.code :
\
...
...
@@ -319,15 +324,13 @@ describe('ActsAmsCallBackFourthScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_8900 getActiveProcessInfos data
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
11
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
@@ -496,7 +499,7 @@ describe('ActsAmsCallBackFourthScene', function () {
console
.
info
(
'
Acts_Ams_test_6400 killProcessesByBundleName error.code
\
'
+
error
.
code
+
'
,data [
'
+
info
+
'
]
'
);
expect
(
typeof
(
info
)).
assertEqual
(
"
number
"
);
expect
(
info
).
assertEqual
(
0
);
expect
(
info
).
assertEqual
(
2097215
);
done
();
});
setTimeout
(
timeout
,
5000
);
...
...
aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -66,7 +66,8 @@ describe('ActsAmsCallBackSecondScene', function () {
},
},
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -75,7 +76,7 @@ describe('ActsAmsCallBackSecondScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -113,8 +114,13 @@ describe('ActsAmsCallBackSecondScene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -133,15 +139,13 @@ describe('ActsAmsCallBackSecondScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_1800 getAllRunningProcesses data
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -215,7 +219,8 @@ describe('ActsAmsCallBackSecondScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it
(
'
Acts_Ams_test_2200
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
20
,
flag
=
1
;
var
maxnum
=
20
;
var
flag
=
1
;
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
,
(
error
,
info
)
=>
{
console
.
info
(
'
queryRunningAbilityMissionInfos error.code :
\
...
...
@@ -268,15 +273,13 @@ describe('ActsAmsCallBackSecondScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_8700 getActiveProcessInfos data
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
@@ -442,7 +445,7 @@ describe('ActsAmsCallBackSecondScene', function () {
(
error
,
info
)
=>
{
console
.
info
(
'
Acts_Ams_test_3200 killProcessesByBundleName error.code:
\
'
+
error
.
code
+
'
,data [
'
+
info
+
'
]
'
);
expect
(
info
).
assertEqual
(
0
);
expect
(
info
).
assertEqual
(
2097215
);
done
();
});
setTimeout
(
timeout
,
5000
);
...
...
aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -64,7 +64,8 @@ describe('ActsAmsCallBackThirdScene', function () {
},
}
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -73,7 +74,7 @@ describe('ActsAmsCallBackThirdScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -123,9 +124,14 @@ describe('ActsAmsCallBackThirdScene', function () {
}
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
startTime
=
(
new
Date
()).
getTime
();
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -144,15 +150,13 @@ describe('ActsAmsCallBackThirdScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_3400 getAllRunningProcesses data
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -226,7 +230,8 @@ describe('ActsAmsCallBackThirdScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it
(
'
Acts_Ams_test_3800
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
20
,
flag
=
2
;
var
maxnum
=
20
;
var
flag
=
2
;
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
,
(
error
,
info
)
=>
{
console
.
info
(
'
queryRunningAbilityMissionInfos error.code :
\
...
...
@@ -279,15 +284,13 @@ describe('ActsAmsCallBackThirdScene', function () {
'
+
error
.
code
+
'
, data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_8800 getActiveProcessInfos data
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
@@ -471,7 +474,7 @@ describe('ActsAmsCallBackThirdScene', function () {
(
error
,
info
)
=>
{
console
.
info
(
'
Acts_Ams_test_4800 killProcessesByBundleName error.code:
\
'
+
error
.
code
+
'
,data [
'
+
info
+
'
]
'
);
expect
(
info
).
assertEqual
(
0
);
expect
(
info
).
assertEqual
(
2097215
);
done
();
});
setTimeout
(
timeout
,
5000
);
...
...
aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -72,7 +72,8 @@ describe('ActsAmsTestFifthScene', function () {
},
},
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -81,7 +82,7 @@ describe('ActsAmsTestFifthScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -147,8 +148,13 @@ describe('ActsAmsTestFifthScene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -165,15 +171,13 @@ describe('ActsAmsTestFifthScene', function () {
console
.
info
(
'
getAllRunningProcesses data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_6500 getAllRunningProcesses JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -219,7 +223,8 @@ describe('ActsAmsTestFifthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it
(
'
Acts_Ams_test_6900
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
info
(
'
queryRecentAbilityMissionInfos data length [
'
+
data
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_6900 queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
...
...
@@ -265,15 +270,13 @@ describe('ActsAmsTestFifthScene', function () {
var
info
=
await
abilitymanager
.
getActiveProcessInfos
();
console
.
info
(
'
Acts_Ams_test_8500 getActiveProcessInfos JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -69,7 +69,8 @@ describe('ActsAmsTestFirstScene', function () {
},
},
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -78,7 +79,7 @@ describe('ActsAmsTestFirstScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -108,8 +109,13 @@ describe('ActsAmsTestFirstScene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -125,15 +131,13 @@ describe('ActsAmsTestFirstScene', function () {
var
info
=
await
abilitymanager
.
getAllRunningProcesses
();
console
.
info
(
'
Acts_Ams_test_0100 getAllRunningProcesses JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
9
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -188,7 +192,7 @@ describe('ActsAmsTestFirstScene', function () {
expect
(
data
[
i
].
baseAbility
.
deviceId
.
length
).
assertEqual
(
0
);
expect
(
typeof
(
data
[
i
].
baseAbility
.
bundleName
)).
assertEqual
(
"
string
"
);
expect
(
data
[
i
].
baseAbility
.
bundleName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
data
[
i
].
baseAbility
.
bundleName
)).
assertLarger
(
-
1
);
;
expect
(
bundleNameList
.
indexOf
(
data
[
i
].
baseAbility
.
bundleName
)).
assertLarger
(
-
1
);
expect
(
typeof
(
data
[
i
].
baseAbility
.
abilityName
)).
assertEqual
(
"
string
"
);
expect
(
data
[
i
].
baseAbility
.
abilityName
.
length
).
assertLarger
(
0
);
expect
(
abilityNameList
.
indexOf
(
data
[
i
].
baseAbility
.
abilityName
)).
assertLarger
(
-
1
);
...
...
@@ -217,7 +221,8 @@ describe('ActsAmsTestFirstScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it
(
'
Acts_Ams_test_0500
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
info
(
'
Acts_Ams_test_0500 queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
expect
(
Array
.
isArray
(
data
)).
assertEqual
(
true
);
...
...
@@ -262,15 +267,13 @@ describe('ActsAmsTestFirstScene', function () {
var
info
=
await
abilitymanager
.
getActiveProcessInfos
();
console
.
info
(
'
Acts_Ams_test_8100 getActiveProcessInfos JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
9
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -74,7 +74,8 @@ describe('ActsAmsTestFourthScene', function () {
},
},
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -83,7 +84,7 @@ describe('ActsAmsTestFourthScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -167,8 +168,13 @@ describe('ActsAmsTestFourthScene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -185,15 +191,13 @@ describe('ActsAmsTestFourthScene', function () {
console
.
info
(
'
getAllRunningProcesses data length [
'
+
info
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_4900 getAllRunningProcesses JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
11
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -222,15 +226,13 @@ describe('ActsAmsTestFourthScene', function () {
var
info
=
await
abilitymanager
.
getActiveProcessInfos
();
console
.
info
(
'
Acts_Ams_test_8400 getActiveProcessInfos JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
11
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
@@ -247,7 +249,8 @@ describe('ActsAmsTestFourthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it
(
'
Acts_Ams_test_5300
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
100
,
flag
=
1
;
var
maxnum
=
100
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
info
(
'
queryRecentAbilityMissionInfos data length [
'
+
data
.
length
+
'
]
'
);
expect
(
Array
.
isArray
(
data
)).
assertEqual
(
true
);
...
...
@@ -502,7 +505,7 @@ describe('ActsAmsTestFourthScene', function () {
var
info
=
await
abilitymanager
.
killProcessesByBundleName
(
'
xxxxxxxxxxxx
'
);
console
.
info
(
'
Acts_Ams_test_6300 killProcessesByBundleName data [
'
+
info
+
'
]
'
);
expect
(
typeof
(
info
)).
assertEqual
(
"
number
"
);
expect
(
info
).
assertEqual
(
0
);
expect
(
info
).
assertEqual
(
2097215
);
done
();
setTimeout
(
timeout
,
5000
);
})
...
...
aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -71,7 +71,8 @@ describe('ActsAmsTestSecondScene', function () {
},
},
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -80,7 +81,7 @@ describe('ActsAmsTestSecondScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -128,8 +129,13 @@ describe('ActsAmsTestSecondScene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -145,15 +151,13 @@ describe('ActsAmsTestSecondScene', function () {
var
info
=
await
abilitymanager
.
getAllRunningProcesses
();
console
.
info
(
'
Acts_Ams_test_1700 getAllRunningProcesses JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -237,7 +241,8 @@ describe('ActsAmsTestSecondScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it
(
'
Acts_Ams_test_2100
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
20
,
flag
=
1
;
var
maxnum
=
20
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
info
(
'
queryRecentAbilityMissionInfos data length [
'
+
data
.
length
+
'
]
'
);
console
.
info
(
'
Acts_Ams_test_2100 queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
...
...
@@ -283,15 +288,13 @@ describe('ActsAmsTestSecondScene', function () {
var
info
=
await
abilitymanager
.
getActiveProcessInfos
();
console
.
info
(
'
Acts_Ams_test_8200 getActiveProcessInfos JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
@@ -438,7 +441,7 @@ describe('ActsAmsTestSecondScene', function () {
it
(
'
Acts_Ams_test_3100
'
,
0
,
async
function
(
done
)
{
var
info
=
await
abilitymanager
.
killProcessesByBundleName
(
'
XXXXXXXXXXXX
'
);
console
.
info
(
'
Acts_Ams_test_3100 killProcessesByBundleName data [
'
+
info
+
'
]
'
);
expect
(
info
).
assertEqual
(
0
);
expect
(
info
).
assertEqual
(
2097215
);
done
();
setTimeout
(
timeout
,
5000
);
})
...
...
aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
85ea2b58
...
...
@@ -71,7 +71,8 @@ describe('ActsAmsTestThirdScene', function () {
},
},
);
var
maxnum
=
10
,
flag
=
1
;
var
maxnum
=
10
;
var
flag
=
1
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
log
(
'
queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
@@ -80,7 +81,7 @@ describe('ActsAmsTestThirdScene', function () {
var
info
=
abilitymanager
.
removeMission
(
data
[
i
].
id
);
console
.
log
(
'
removeMission data [
'
+
info
+
'
]
'
);
}
}
;
}
await
featureAbility
.
startAbility
(
{
want
:
...
...
@@ -146,8 +147,13 @@ describe('ActsAmsTestThirdScene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
var
endTime
=
(
new
Date
()).
getTime
();
for
(
let
index
=
1
;
index
>
0
;
index
++
)
{
if
(
endTime
-
startTime
>
delay
)
{
break
;
}
else
{
endTime
=
(
new
Date
()).
getTime
();
}
}
}
...
...
@@ -163,15 +169,13 @@ describe('ActsAmsTestThirdScene', function () {
var
info
=
await
abilitymanager
.
getAllRunningProcesses
();
console
.
info
(
'
Acts_Ams_test_3300 getAllRunningProcesses JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
pkgList
)).
assertEqual
(
true
);
expect
(
info
[
i
].
pkgList
.
length
).
assertEqual
(
0
);
...
...
@@ -239,7 +243,8 @@ describe('ActsAmsTestThirdScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it
(
'
Acts_Ams_test_3700
'
,
0
,
async
function
(
done
)
{
var
maxnum
=
20
,
flag
=
2
;
var
maxnum
=
20
;
var
flag
=
2
;
var
data
=
await
abilitymanager
.
queryRecentAbilityMissionInfos
(
maxnum
,
flag
);
console
.
info
(
'
Acts_Ams_test_3700 queryRecentAbilityMissionInfos data
'
+
JSON
.
stringify
(
data
));
expect
(
Array
.
isArray
(
data
)).
assertEqual
(
true
);
...
...
@@ -284,15 +289,13 @@ describe('ActsAmsTestThirdScene', function () {
var
info
=
await
abilitymanager
.
getActiveProcessInfos
();
console
.
info
(
'
Acts_Ams_test_8300 getActiveProcessInfos JSON String:
'
+
JSON
.
stringify
(
info
));
expect
(
Array
.
isArray
(
info
)).
assertEqual
(
true
);
expect
(
info
.
length
).
assert
Equal
(
1
0
);
expect
(
info
.
length
).
assert
Larger
(
0
);
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
expect
(
typeof
(
info
[
i
].
pid
)).
assertEqual
(
"
number
"
);
expect
(
info
[
i
].
pid
).
assertLarger
(
0
);
expect
(
typeof
(
info
[
i
].
processName
)).
assertEqual
(
"
string
"
);
expect
(
info
[
i
].
processName
.
length
).
assertLarger
(
0
);
expect
(
bundleNameList
.
indexOf
(
info
[
i
].
processName
)).
assertLarger
(
-
1
);
expect
(
Array
.
isArray
(
info
[
i
].
bundleNames
)).
assertEqual
(
true
);
expect
(
info
[
i
].
bundleNames
.
length
).
assertEqual
(
0
);
...
...
@@ -454,7 +457,7 @@ describe('ActsAmsTestThirdScene', function () {
it
(
'
Acts_Ams_test_4700
'
,
0
,
async
function
(
done
)
{
var
info
=
await
abilitymanager
.
killProcessesByBundleName
(
'
XXXXXXXX
'
);
console
.
info
(
'
Acts_Ams_test_4700 killProcessesByBundleName data [
'
+
info
+
'
]
'
);
expect
(
info
).
assertEqual
(
0
);
expect
(
info
).
assertEqual
(
2097215
);
done
();
setTimeout
(
timeout
,
5000
);
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录