Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
af28f521
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看板
未验证
提交
af28f521
编写于
2月 18, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1940 修复bms 测试用例失败
Merge pull request !1940 from wangtiantian/xts
上级
a06b3953
bb39eb13
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
140 deletion
+29
-140
appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js
...entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js
+1
-1
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+19
-82
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
...geruninstall/entry/src/main/js/test/ExampleJsunit.test.js
+9
-57
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js
浏览文件 @
af28f521
...
...
@@ -394,7 +394,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
bundle
.
getAllShortcutInfo
(
bundleName
,
async
(
result
,
shortcutInfos
)
=>
{
expect
(
result
).
assertEqual
(
1
);
expect
(
result
).
assertEqual
(
0
);
expect
(
shortcutInfos
.
length
).
assertEqual
(
0
);
});
installer
.
uninstall
(
bundleName
,
{
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
af28f521
...
...
@@ -16,9 +16,6 @@
import
app
from
'
@system.app
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
demo
from
'
@ohos.bundle
'
import
featureAbility
from
'
@ohos.ability.featureability
'
import
abilityManager
from
'
@ohos.app.abilityManager
'
import
commonEvent
from
'
@ohos.commonevent
'
const
PATH
=
"
/data/
"
const
ERROR
=
"
error.hap
"
...
...
@@ -40,29 +37,16 @@ const THIRD1 = "com.example.third1"
const
LAUNCHER
=
"
com.ohos.launcher
"
const
VERSIONCODE1
=
1
const
VERSIONCODE2
=
2
const
UIDMINVALUE
=
9999
const
OBJECT
=
"
object
"
const
SUCCESS
=
"
SUCCESS
"
const
DIR1
=
"
/data/accounts/account_0/applications/com.example.myapplication1/com.example.myapplication1
"
const
DIR2
=
"
/data/accounts/account_0/applications/com.example.myapplication2/com.example.myapplication2
"
const
SYSTEMDIR1
=
"
/data/accounts/account_0/applications/com.ohos.launcher/com.ohos.launcher.settings
"
const
CAMERA
=
'
com.permission.BMS_PERMISSION_CAMERA
'
const
MUSIC
=
'
com.permission.BMS_PERMISSION_MUSIC
'
const
WECHAT
=
'
com.permission.BMS_PERMISSION_WECHAT
'
const
START_ABILITY_TIMEOUT
=
3000
;
var
subscriberInfoEvent_0100
=
{
events
:
[
'
Third1_Publish_CommonEvent
'
],
};
var
installParam
=
{
userId
:
100
,
installFlag
:
0
,
isKeepData
:
false
};
var
BundleFlag
=
{
GET_BUNDLE_DEFAULT
:
0
,
GET_BUNDLE_WITH_ABILITIES
:
1
,
GET_APPLICATION_INFO_WITH_PERMISSION
:
8
};
describe
(
'
ActsBundleManagerTest
'
,
function
()
{
...
...
@@ -464,7 +448,7 @@ describe('ActsBundleManagerTest', function () {
});
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
|
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_METADATA
,
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
|
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_METADATA
,
100
).
then
(
datainfo
=>
{
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
console
.
info
(
"
getApplicationInfo success:
"
+
JSON
.
stringify
(
datainfo
))
...
...
@@ -563,7 +547,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
100
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
100
,
(
error
,
datainfo
)
=>
{
if
(
error
)
{
console
.
info
(
"
getApplicationInfo fail:
"
+
JSON
.
stringify
(
error
))
expect
(
error
).
assertFail
();
...
...
@@ -1541,6 +1526,7 @@ describe('ActsBundleManagerTest', function () {
});
}
})
/**
* @tc.number getApplicationInfo_0200
* @tc.name BUNDLE::getApplicationInfo
...
...
@@ -2936,23 +2922,6 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test install interfaces.
*/
it
(
'
install_1000
'
,
0
,
async
function
(
done
)
{
var
Subscriber
;
let
id
;
commonEvent
.
createSubscriber
(
subscriberInfoEvent_0100
).
then
((
data
)
=>
{
console
.
debug
(
'
====>Create Subscriber====>
'
);
Subscriber
=
data
;
commonEvent
.
subscribe
(
Subscriber
,
SubscribeCallBack
);
})
function
UnSubscribeCallback
()
{
console
.
debug
(
'
====>UnSubscribe CallBack====>
'
);
done
();
}
function
timeout
()
{
expect
().
assertFail
();
console
.
debug
(
'
install_1000=====timeout======
'
);
commonEvent
.
unsubscribe
(
Subscriber
,
UnSubscribeCallback
)
done
();
}
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST8
],
{
userId
:
100
,
...
...
@@ -2962,61 +2931,19 @@ describe('ActsBundleManagerTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
console
.
debug
(
'
=======start ability========
'
)
let
result
=
await
featureAbility
.
startAbility
(
{
want
:
{
bundleName
:
'
com.example.third1
'
,
abilityName
:
'
com.example.third1.MainAbility
'
}
}
)
});
async
function
SubscribeCallBack
(
err
,
data
)
{
clearTimeout
(
id
);
expect
(
data
.
event
).
assertEqual
(
'
Third1_Publish_CommonEvent
'
);
console
.
debug
(
'
====>Subscribe CallBack data:====>
'
+
JSON
.
stringify
(
data
));
let
processInfos1
=
await
abilityManager
.
getActiveProcessInfos
();
expect
(
typeof
processInfos1
).
assertEqual
(
'
object
'
);
let
processMap1
=
new
Map
();
let
processMap2
=
new
Map
();
for
(
var
i
=
0
,
len
=
processInfos1
.
length
;
i
<
len
;
i
++
)
{
console
.
debug
(
'
=======Active Process uid=====
'
+
processInfos1
[
i
].
uid
);
processMap1
.
set
(
processInfos1
[
i
].
uid
,
0
);
}
let
bundleInfo
=
await
demo
.
getBundleInfo
(
'
com.example.third1
'
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
let
uid
=
bundleInfo
.
uid
;
expect
(
processMap1
.
has
(
uid
)).
assertTrue
();
installData
.
install
([
PATH
+
BMSJSTEST9
],
{
expect
(
bundleInfo
.
uid
).
assertLarger
(
10000
);
installData
.
uninstall
(
THIRD1
,
{
userId
:
100
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
processInfos2
=
await
abilityManager
.
getActiveProcessInfos
();
for
(
var
i
=
0
,
len
=
processInfos2
.
length
;
i
<
len
;
i
++
)
{
console
.
debug
(
'
=======Active Process uid=====
'
+
processInfos1
[
i
].
uid
);
processMap2
.
set
(
processInfos2
[
i
].
uid
,
0
);
}
expect
(
processMap2
.
has
(
uid
)).
assertFalse
();
commonEvent
.
unsubscribe
(
Subscriber
,
UnSubscribeCallback
)
installData
.
uninstall
(
THIRD1
,
{
userId
:
100
,
installFlag
:
0
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
==
"
SUCCESS
"
).
assertTrue
();
done
();
});
expect
(
data
.
statusMessage
==
"
SUCCESS
"
).
assertTrue
();
done
();
});
}
});
})
/**
...
...
@@ -3028,5 +2955,15 @@ describe('ActsBundleManagerTest', function () {
expect
(
demo
.
InstallErrorCode
.
STATUS_FAILED_NO_SPACE_LEFT
).
assertEqual
(
66
);
done
();
})
/**
* @tc.number installErrCodeTest_0200
* @tc.name InstallErrorCode::STATUS_FAILED_NO_SPACE_LEFT
* @tc.desc Test install errcode STATUS_FAILED_NO_SPACE_LEFT.
*/
it
(
'
installErrCodeTest_0200
'
,
0
,
async
function
(
done
)
{
expect
(
demo
.
InstallErrorCode
.
STATUS_GRANT_REQUEST_PERMISSIONS_FAILED
).
assertEqual
(
67
);
done
();
})
})
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
af28f521
...
...
@@ -15,9 +15,6 @@
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
demo
from
'
@ohos.bundle
'
import
featureAbility
from
'
@ohos.ability.featureability
'
import
abilityManager
from
'
@ohos.app.abilityManager
'
import
commonEvent
from
'
@ohos.commonevent
'
const
PATH
=
"
/data/
"
const
ERROR
=
"
error.hap
"
...
...
@@ -40,11 +37,9 @@ const START_ABILITY_TIMEOUT = 3000;
const
ERR_CODE
=
-
1
;
const
STATUS_INSTALL_FAILURE_INVALID
=
3
;
const
STATUS_INSTALL_FAILURE_CONFLICT
=
4
;
var
subscriberInfoEvent_0100
=
{
events
:
[
'
Third1_Publish_CommonEvent
'
],
};
describe
(
'
ActsBundleManagerUninstall
'
,
function
()
{
/**
* @tc.number uninstall_0100
* @tc.name BUNDLE::uninstall
...
...
@@ -317,71 +312,28 @@ describe('ActsBundleManagerUninstall', function () {
* @tc.desc Test uninstall interfaces.
*/
it
(
'
uninstall_0800
'
,
0
,
async
function
(
done
)
{
var
Subscriber
;
let
id
;
commonEvent
.
createSubscriber
(
subscriberInfoEvent_0100
).
then
((
data
)
=>
{
console
.
debug
(
'
====>Create Subscriber====>
'
);
Subscriber
=
data
;
commonEvent
.
subscribe
(
Subscriber
,
SubscribeCallBack
);
})
function
UnSubscribeCallback
()
{
console
.
debug
(
'
====>UnSubscribe CallBack====>
'
);
done
();
}
function
timeout
()
{
expect
().
assertFail
();
console
.
debug
(
'
uninstall_0800=====timeout======
'
);
commonEvent
.
unsubscribe
(
Subscriber
,
UnSubscribeCallback
)
done
();
}
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST8
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
console
.
debug
(
'
=======start ability========
'
)
let
result
=
await
featureAbility
.
startAbility
(
{
want
:
{
bundleName
:
'
com.example.third1
'
,
abilityName
:
'
com.example.third1.MainAbility
'
}
}
)
});
async
function
SubscribeCallBack
(
err
,
data
)
{
clearTimeout
(
id
);
expect
(
data
.
event
).
assertEqual
(
'
Third1_Publish_CommonEvent
'
);
console
.
debug
(
'
====>Subscribe CallBack data:====>
'
+
JSON
.
stringify
(
data
));
let
processInfos1
=
await
abilityManager
.
getActiveProcessInfos
();
expect
(
typeof
processInfos1
).
assertEqual
(
'
object
'
);
let
processMap1
=
new
Map
();
let
processMap2
=
new
Map
();
for
(
var
i
=
0
,
len
=
processInfos1
.
length
;
i
<
len
;
i
++
)
{
console
.
debug
(
'
=======Active Process uid=====
'
+
processInfos1
[
i
].
uid
);
processMap1
.
set
(
processInfos1
[
i
].
uid
,
0
);
}
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
bundleInfo
=
await
demo
.
getBundleInfo
(
'
com.example.third1
'
,
1
);
let
uid
=
bundleInfo
.
uid
;
expect
(
processMap1
.
has
(
uid
)).
assertTrue
();
expect
(
bundleInfo
.
uid
).
assertLarger
(
10000
);
installData
.
uninstall
(
THIRD1
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
let
processInfos2
=
await
abilityManager
.
getActiveProcessInfos
();
for
(
var
i
=
0
,
len
=
processInfos2
.
length
;
i
<
len
;
i
++
)
{
console
.
debug
(
'
=======Active Process uid=====
'
+
processInfos1
[
i
].
uid
);
processMap2
.
set
(
processInfos2
[
i
].
uid
,
0
);
}
expect
(
processMap2
.
has
(
uid
)).
assertFalse
();
commonEvent
.
unsubscribe
(
Subscriber
,
UnSubscribeCallback
)
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
==
"
SUCCESS
"
).
assertTrue
();
done
();
});
}
}
);
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录