Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
471f53c6
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看板
提交
471f53c6
编写于
6月 06, 2022
作者:
I
inter515
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
系统应用包名修改为辅助demo包名'
Signed-off-by:
N
inter515
<
ry.renyi@huawei.com
>
上级
aa651cb0
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
49 addition
and
24 deletion
+49
-24
appexecfwk/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/Test.json
...andard/bundlemanager/actsbmsetsunpermissiontest/Test.json
+23
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets
...try/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets
+9
-10
appexecfwk/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/Test.json
...tandard/bundlemanager/actsbmsjsunpermissiontest/Test.json
+5
-1
appexecfwk/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/entry/src/main/js/test/ActsBmsJsUnPermissionTest.test.js
.../entry/src/main/js/test/ActsBmsJsUnPermissionTest.test.js
+2
-2
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetAbilityIcon.test.ets
...eretstest/entry/src/main/ets/test/GetAbilityIcon.test.ets
+2
-2
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetNameForUid.test.ets
...geretstest/entry/src/main/ets/test/GetNameForUid.test.ets
+1
-1
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+7
-8
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/Test.json
浏览文件 @
471f53c6
...
...
@@ -14,6 +14,29 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"remount"
,
"mkdir /data/test"
]
},
{
"type"
:
"PushKit"
,
"push"
:
[
"bmsJstest1.hap->/data/test/bmsJstest1.hap"
]
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"chmod 644 /data/test/*.hap"
,
"bm install -p /data/test/bmsJstest1.hap"
],
"teardown-command"
:[
"bm uninstall -n com.example.myapplication1"
]
}
]
}
appexecfwk/bundle_standard/bundlemanager/actsbmsetsunpermissiontest/entry/src/main/ets/test/ActsBmsEtsUnPermissionTest.test.ets
浏览文件 @
471f53c6
...
...
@@ -20,11 +20,10 @@ import account from '@ohos.account.osAccount'
const
DEFAULT_FLAG
=
bundle
.
BundleFlag
.
GET_BUNDLE_DEFAULT
;
const
INVALID_CODE
=
1
;
const
LAUNCHER_BUNDLE_NAME
=
"com.ohos.launcher"
;
const
SELF_BUNDLENAME
=
"com.example.actsbmsetsunpermissiontest"
;
const
SELF_ABILITYNAME
=
"com.example.actsbmsetsunpermissiontest.MainAbility"
;
const
BUNDLE_
SETTINGS
=
"com.ohos.settings
"
;
const
ABILITIY_
SETTINGS
=
"com.ohos.settings
.MainAbility"
;
const
BUNDLE_
NAME_OTHER
=
"com.example.myapplication1
"
;
const
ABILITIY_
NAME_OTHER
=
"com.example.myapplication1
.MainAbility"
;
const
BUNDLE_NAME1
=
"ohos.acts.bundle.stage"
;
const
ABILITY_NAME1
=
"ExtensionAbility1"
;
let
userId
=
0
;
...
...
@@ -67,12 +66,12 @@ export default function actsBmsJsUnPermissionTest() {
* @tc.desc test getBundleInfo
*/
it
(
'getBundleInfo_2000'
,
0
,
async
function
(
done
)
{
await
bundle
.
getBundleInfo
(
LAUNCHER_BUNDLE_NAME
,
DEFAULT_FLAG
,
{
userId
:
userId
})
.
then
(
data
=>
{
await
bundle
.
getBundleInfo
(
BUNDLE_NAME_OTHER
,
DEFAULT_FLAG
,
{
userId
:
userId
})
.
then
(
data
=>
{
expect
()
.
assertFail
();
})
.
catch
(
err
=>
{
expect
(
err
)
.
assertEqual
(
INVALID_CODE
);
});
bundle
.
getBundleInfo
(
LAUNCHER_BUNDLE_NAME
,
DEFAULT_FLAG
,
{
userId
:
userId
},
(
err
,
data
)
=>
{
bundle
.
getBundleInfo
(
BUNDLE_NAME_OTHER
,
DEFAULT_FLAG
,
{
userId
:
userId
},
(
err
,
data
)
=>
{
expect
(
err
)
.
assertEqual
(
INVALID_CODE
);
expect
(
data
)
.
assertEqual
(
undefined
);
done
();
...
...
@@ -85,12 +84,12 @@ export default function actsBmsJsUnPermissionTest() {
* @tc.desc test getApplicationInfo
*/
it
(
'getApplicationInfo_1800'
,
0
,
async
function
(
done
)
{
await
bundle
.
getApplicationInfo
(
LAUNCHER_BUNDLE_NAME
,
DEFAULT_FLAG
)
.
then
(
data
=>
{
await
bundle
.
getApplicationInfo
(
BUNDLE_NAME_OTHER
,
DEFAULT_FLAG
)
.
then
(
data
=>
{
expect
()
.
assertFail
();
})
.
catch
(
err
=>
{
expect
(
err
)
.
assertEqual
(
INVALID_CODE
);
});
bundle
.
getApplicationInfo
(
LAUNCHER_BUNDLE_NAME
,
DEFAULT_FLAG
,
(
err
,
data
)
=>
{
bundle
.
getApplicationInfo
(
BUNDLE_NAME_OTHER
,
DEFAULT_FLAG
,
(
err
,
data
)
=>
{
expect
(
err
)
.
assertEqual
(
INVALID_CODE
);
expect
(
data
)
.
assertEqual
(
undefined
);
done
();
...
...
@@ -130,7 +129,7 @@ export default function actsBmsJsUnPermissionTest() {
*/
it
(
'SUB_BMS_HAP_STATUS_0012'
,
0
,
async
function
(
done
)
{
pkg
.
hasInstalled
({
bundleName
:
LAUNCHER_BUNDLE_NAME
,
bundleName
:
BUNDLE_NAME_OTHER
,
success
:
function
success
(
data
)
{
console
.
info
(
"get hasInstalled success"
+
JSON
.
stringify
(
data
));
expect
(
data
.
result
)
.
assertFalse
();
...
...
@@ -155,12 +154,12 @@ export default function actsBmsJsUnPermissionTest() {
* @tc.desc: test getAbilityIcon without permission
*/
it
(
'SUB_BMS_APPINFO_GETABILITYICON_0006'
,
0
,
async
function
(
done
)
{
await
bundle
.
getAbilityIcon
(
BUNDLE_
SETTINGS
,
ABILITIY_SETTINGS
)
.
then
(
pixelmap
=>
{
await
bundle
.
getAbilityIcon
(
BUNDLE_
NAME_OTHER
,
ABILITIY_NAME_OTHER
)
.
then
(
pixelmap
=>
{
expect
(
pixelmap
)
.
assertFail
();
})
.
catch
(
err
=>
{
expect
(
err
)
.
assertEqual
(
1
);
});
bundle
.
getAbilityIcon
(
BUNDLE_
SETTINGS
,
ABILITIY_SETTINGS
,
(
err
,
pixelmap
)
=>
{
bundle
.
getAbilityIcon
(
BUNDLE_
NAME_OTHER
,
ABILITIY_NAME_OTHER
,
(
err
,
pixelmap
)
=>
{
expect
(
err
)
.
assertEqual
(
1
);
done
();
});
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/Test.json
浏览文件 @
471f53c6
...
...
@@ -31,7 +31,11 @@
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"chmod 644 /data/test/*.hap"
"chmod 644 /data/test/*.hap"
,
"bm install -p /data/test/bmsJstest1.hap"
],
"teardown-command"
:[
"bm uninstall -n com.example.myapplication1"
]
}
]
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/entry/src/main/js/test/ActsBmsJsUnPermissionTest.test.js
浏览文件 @
471f53c6
...
...
@@ -17,8 +17,8 @@ import bundle from '@ohos.bundle'
import
account
from
'
@ohos.account.osAccount
'
import
{
describe
,
beforeAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
LAUNCHER_BUNDLE_NAME
=
'
com.
ohos.launcher
'
;
const
LAUNCHER_MAIN_ABILITY
=
'
com.
ohos.launcher
.MainAbility
'
;
const
LAUNCHER_BUNDLE_NAME
=
'
com.
example.myapplication1
'
;
const
LAUNCHER_MAIN_ABILITY
=
'
com.
example.myapplication1
.MainAbility
'
;
const
DEFAULT_FLAG
=
bundle
.
BundleFlag
.
GET_BUNDLE_DEFAULT
;
const
INVALID_CODE
=
1
;
let
userId
=
0
;
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetAbilityIcon.test.ets
浏览文件 @
471f53c6
...
...
@@ -20,8 +20,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
const BUNDLE_NAME = "com.open.harmony.packagemag";
const ABILITIY_NAME = "com.open.harmony.packagemag.MainAbility";
const SERVICE_NAME = "com.open.harmony.packagemag.ServiceAbility";
const BUNDLE_NAME_OTHER = "com.
ohos.settings
";
const ABILITIY_NAME_OTHER = "com.
ohos.settings
.MainAbility";
const BUNDLE_NAME_OTHER = "com.
example.l3jsdemo
";
const ABILITIY_NAME_OTHER = "com.
example.l3jsdemo
.MainAbility";
const BUNDLE_NAME_ERROR = "com.ohos.packagemag";
const ABILITIY_NAME_ERROR = "com.ohos.packagemag.MainAbility";
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/GetNameForUid.test.ets
浏览文件 @
471f53c6
...
...
@@ -16,7 +16,7 @@
import bundle from '@ohos.bundle'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
const BUNDLE_NAME1 = 'com.
ohos.launcher
';
const BUNDLE_NAME1 = 'com.
example.l3jsdemo
';
const BUNDLE_NAME2 = 'com.open.harmony.packagemag';
export default function getNameForUid() {
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
471f53c6
...
...
@@ -24,7 +24,6 @@ const NAME2 = "com.example.myapplication2"
const
NAME3
=
"
com.example.myapplication4
"
const
NAME4
=
"
com.example.myapplication5
"
const
NAME5
=
"
com.example.myapplication6
"
const
LAUNCHER
=
"
com.ohos.launcher
"
const
VERSIONCODE1
=
1
const
OBJECT
=
"
object
"
const
DIR1
=
"
/data/app/el1/bundle/public/com.example.myapplication1/com.example.myapplication1
"
...
...
@@ -436,13 +435,13 @@ describe('ActsBundleManagerTest', function () {
/**
* @tc.number getBundleInfo_1400
* @tc.name BUNDLE::getBundleInfo
* @tc.desc Test getBundleInfo interfaces with
LAUNCHER ha
p.(by callback)
* @tc.desc Test getBundleInfo interfaces with
systemAp
p.(by callback)
*/
it
(
'
getBundleInfo_1400
'
,
0
,
async
function
(
done
)
{
let
bundleOptions
=
{
userId
:
userId
};
demo
.
getBundleInfo
(
LAUNCHER
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
demo
.
getBundleInfo
(
NAME1
,
demo
.
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
bundleOptions
,
(
err
,
datainfo
)
=>
{
if
(
err
)
{
console
.
info
(
"
getBundleInfo_1400 fail:
"
+
JSON
.
stringify
(
err
));
...
...
@@ -451,12 +450,12 @@ describe('ActsBundleManagerTest', function () {
return
;
}
console
.
info
(
"
getBundleInfo_1400 success:
"
+
JSON
.
stringify
(
datainfo
));
expect
(
datainfo
.
name
).
assertEqual
(
LAUNCHER
);
expect
(
datainfo
.
vendor
).
assertEqual
(
"
ohos
"
);
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
000000
);
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
);
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
);
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
);
expect
(
datainfo
.
versionName
.
length
).
assertLarger
(
0
);
expect
(
datainfo
.
uid
).
assertLarger
(
2099
);
expect
(
datainfo
.
appInfo
.
name
).
assertEqual
(
LAUNCHER
);
expect
(
datainfo
.
appInfo
.
name
).
assertEqual
(
NAME1
);
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
true
);
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
datainfo
.
appInfo
.
moduleInfos
.
length
).
assertLarger
(
0
);
...
...
@@ -597,7 +596,7 @@ describe('ActsBundleManagerTest', function () {
done
();
return
;
}
console
.
info
(
"
getBundleInfo_1800 success
"
+
JSON
.
stringify
(
data
i
nfo
));
console
.
info
(
"
getBundleInfo_1800 success
"
+
JSON
.
stringify
(
data
I
nfo
));
expect
(
dataInfo
).
assertFail
();
done
();
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录