提交 65d9974c 编写于 作者: W wangtiantian

IssueNo:#I6CUF8

Description:only systremres support definePermission
Sig:SIG_ApplicaitonFramework
Feature or Bugfix:Bugfix
Binary Source:No
Signed-off-by: Nwangtiantian <wangtiantian19@huawei.com>
上级 b9dcec5d
......@@ -63,14 +63,12 @@ describe('ActsBmsAccessTokenTest', function () {
await bundle.getBundleInfo(BUNDLE_NAME3, bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION)
.then(bundleInfo => {
expect(bundleInfo.name).assertEqual(BUNDLE_NAME3);
expect(bundleInfo.reqPermissions.length).assertEqual(3);
expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA");
expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.BETA");
expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING");
expect(bundleInfo.reqPermissionStates.length).assertEqual(3);
expect(bundleInfo.reqPermissions.length).assertEqual(2);
expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.DISTRIBUTED_DATASYNC");
expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING");
expect(bundleInfo.reqPermissionStates.length).assertEqual(2);
expect(bundleInfo.reqPermissionStates[0]).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
expect(bundleInfo.reqPermissionStates[1]).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
expect(bundleInfo.reqPermissionStates[2]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
expect(bundleInfo.reqPermissionStates[1]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
}).catch((err) => {
expect(err).assertFail();
......@@ -87,18 +85,16 @@ describe('ActsBmsAccessTokenTest', function () {
await bundle.getBundleInfo(BUNDLE_NAME2, bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION)
.then(bundleInfo => {
expect(bundleInfo.name).assertEqual(BUNDLE_NAME2);
expect(bundleInfo.reqPermissions.length).assertEqual(5);
expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA");
expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING");
expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND");
expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.USE_BLUETOOTH");
expect(bundleInfo.reqPermissions[4]).assertEqual("ohos.permission.VIBRATE");
expect(bundleInfo.reqPermissionStates.length).assertEqual(5);
expect(bundleInfo.reqPermissionStates[0]).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
expect(bundleInfo.reqPermissionStates[1]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
expect(bundleInfo.reqPermissionStates[2]).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
expect(bundleInfo.reqPermissions.length).assertEqual(4);
expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING");
expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND");
expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.USE_BLUETOOTH");
expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.VIBRATE");
expect(bundleInfo.reqPermissionStates.length).assertEqual(4);
expect(bundleInfo.reqPermissionStates[0]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
expect(bundleInfo.reqPermissionStates[1]).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
expect(bundleInfo.reqPermissionStates[2]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
expect(bundleInfo.reqPermissionStates[3]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
expect(bundleInfo.reqPermissionStates[4]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
}).catch((err) => {
expect(err).assertFail();
......@@ -115,20 +111,18 @@ describe('ActsBmsAccessTokenTest', function () {
await bundle.getBundleInfo(BUNDLE_NAME1, bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION)
.then(bundleInfo => {
expect(bundleInfo.name).assertEqual(BUNDLE_NAME1);
expect(bundleInfo.reqPermissions.length).assertEqual(6);
expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.ALPHA");
expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.BETA");
expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING");
expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND");
expect(bundleInfo.reqPermissions[4]).assertEqual("ohos.permission.USE_BLUETOOTH");
expect(bundleInfo.reqPermissions[5]).assertEqual("ohos.permission.VIBRATE");
expect(bundleInfo.reqPermissionStates.length).assertEqual(6);
expect(bundleInfo.reqPermissions.length).assertEqual(5);
expect(bundleInfo.reqPermissions[0]).assertEqual("ohos.permission.DISTRIBUTED_DATASYNC");
expect(bundleInfo.reqPermissions[1]).assertEqual("ohos.permission.KEEP_BACKGROUND_RUNNING");
expect(bundleInfo.reqPermissions[2]).assertEqual("ohos.permission.LOCATION_IN_BACKGROUND");
expect(bundleInfo.reqPermissions[3]).assertEqual("ohos.permission.USE_BLUETOOTH");
expect(bundleInfo.reqPermissions[4]).assertEqual("ohos.permission.VIBRATE");
expect(bundleInfo.reqPermissionStates.length).assertEqual(5);
expect(bundleInfo.reqPermissionStates[0]).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
expect(bundleInfo.reqPermissionStates[1]).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
expect(bundleInfo.reqPermissionStates[2]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
expect(bundleInfo.reqPermissionStates[3]).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
expect(bundleInfo.reqPermissionStates[1]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
expect(bundleInfo.reqPermissionStates[2]).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
expect(bundleInfo.reqPermissionStates[3]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
expect(bundleInfo.reqPermissionStates[4]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
expect(bundleInfo.reqPermissionStates[5]).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
}).catch((err) => {
expect(err).assertFail();
......
......@@ -67,34 +67,10 @@
}
}
],
"definePermissions":[
{
"availableLevel":"normal",
"description":"ALPHA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"ALPHA label",
"name":"ohos.permission.ALPHA",
"provisionEnable":true
},
{
"availableLevel":"normal",
"description":"BETA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"BETA label",
"name":"ohos.permission.BETA",
"provisionEnable":true
}
],
"reqPermissions":[
{
"name":"ohos.permission.ALPHA",
"reason":"use ohos.permission.ALPHA"
},
{
"name":"ohos.permission.BETA",
"reason":"use ohos.permission.BETA"
"name":"ohos.permission.DISTRIBUTED_DATASYNC",
"reason":"use ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
......
......@@ -67,34 +67,10 @@
}
}
],
"definePermissions":[
{
"availableLevel":"normal",
"description":"ALPHA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"ALPHA label",
"name":"ohos.permission.ALPHA",
"provisionEnable":true
},
{
"availableLevel":"normal",
"description":"BETA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"BETA label",
"name":"ohos.permission.BETA",
"provisionEnable":true
}
],
"reqPermissions":[
{
"name":"ohos.permission.ALPHA",
"reason":"use ohos.permission.ALPHA"
},
{
"name":"ohos.permission.BETA",
"reason":"use ohos.permission.BETA"
"name":"ohos.permission.DISTRIBUTED_DATASYNC",
"reason":"use ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
......
......@@ -67,34 +67,10 @@
}
}
],
"definePermissions":[
{
"availableLevel":"normal",
"description":"ALPHA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"ALPHA label",
"name":"ohos.permission.ALPHA",
"provisionEnable":true
},
{
"availableLevel":"normal",
"description":"BETA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"BETA label",
"name":"ohos.permission.BETA",
"provisionEnable":true
}
],
"reqPermissions":[
{
"name":"ohos.permission.ALPHA",
"reason":"use ohos.permission.ALPHA"
},
{
"name":"ohos.permission.BETA",
"reason":"use ohos.permission.BETA"
"name":"ohos.permission.DISTRIBUTED_DATASYNC",
"reason":"use ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
......
......@@ -67,31 +67,7 @@
}
}
],
"definePermissions":[
{
"availableLevel":"normal",
"description":"ALPHA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"ALPHA label",
"name":"ohos.permission.ALPHA",
"provisionEnable":true
},
{
"availableLevel":"normal",
"description":"BETA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"BETA label",
"name":"ohos.permission.BETA",
"provisionEnable":true
}
],
"reqPermissions":[
{
"name":"ohos.permission.ALPHA",
"reason":"use ohos.permission.ALPHA"
},
{
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
"reason": "use ohos.permission.KEEP_BACKGROUND_RUNNING"
......
......@@ -67,31 +67,7 @@
}
}
],
"definePermissions":[
{
"availableLevel":"normal",
"description":"ALPHA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"ALPHA label",
"name":"ohos.permission.ALPHA",
"provisionEnable":true
},
{
"availableLevel":"normal",
"description":"BETA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"BETA label",
"name":"ohos.permission.BETA",
"provisionEnable":true
}
],
"reqPermissions":[
{
"name":"ohos.permission.ALPHA",
"reason":"use ohos.permission.ALPHA"
},
{
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
"reason": "use ohos.permission.KEEP_BACKGROUND_RUNNING"
......
......@@ -67,34 +67,10 @@
}
}
],
"definePermissions":[
{
"availableLevel":"normal",
"description":"ALPHA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"ALPHA label",
"name":"ohos.permission.ALPHA",
"provisionEnable":true
},
{
"availableLevel":"normal",
"description":"BETA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"BETA label",
"name":"ohos.permission.BETA",
"provisionEnable":true
}
],
"reqPermissions":[
{
"name":"ohos.permission.ALPHA",
"reason":"use ohos.permission.ALPHA"
},
{
"name":"ohos.permission.BETA",
"reason":"use ohos.permission.BETA"
"name":"ohos.permission.DISTRIBUTED_DATASYNC",
"reason":"use ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
......
......@@ -67,34 +67,10 @@
}
}
],
"definePermissions":[
{
"availableLevel":"normal",
"description":"ALPHA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"ALPHA label",
"name":"ohos.permission.ALPHA",
"provisionEnable":true
},
{
"availableLevel":"normal",
"description":"BETA description",
"distributedSceneEnable":true,
"grantMode":"user_grant",
"label":"BETA label",
"name":"ohos.permission.BETA",
"provisionEnable":true
}
],
"reqPermissions":[
{
"name":"ohos.permission.ALPHA",
"reason":"use ohos.permission.ALPHA"
},
{
"name":"ohos.permission.BETA",
"reason":"use ohos.permission.BETA"
"name":"ohos.permission.DISTRIBUTED_DATASYNC",
"reason":"use ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
......
......@@ -17,8 +17,8 @@
"package": "ohos.acts.security.access_token.normal",
"name": ".entry",
"deviceType": [
"tablet",
"default",
"tablet",
"default",
"phone"
],
"distro": {
......@@ -26,34 +26,9 @@
"moduleName": "entry",
"moduleType": "entry"
},
"definePermissions": [
{
"name": "ohos.permission.ALPHA",
"grantMode": "user_grant",
"availableLevel": "system_basic",
"provisionEnable": true,
"distributedSceneEnable": true,
"label": "ALPHA label",
"description": "ALPHA description"
},
{
"name": "ohos.permission.BETA",
"grantMode": "system_grant",
"availableLevel": "system_basic",
"provisionEnable": true,
"distributedSceneEnable": true,
"label": "BETA label",
"description": "BETA description"
}
],
"reqPermissions": [
{
"name": "ohos.permission.ALPHA",
"reason": "use ohos.permission.ALPHA"
},
{
"name": "ohos.permission.BETA",
"reason": "use ohos.permission.BETA"
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
......
......@@ -35,8 +35,8 @@ const TIMEOUT = 5000;
const ERR_PARAM_INVALID = 12100001;
const DEFAULT_PERMISSION_FALG = 0;
var permissionNameUser = "ohos.permission.ALPHA";
var permissionNameSystem = "ohos.permission.BETA";
var permissionNameUser = "ohos.permission.DISTRIBUTED_DATASYNC";
var permissionNameSystem = "ohos.permission.GET_BUNDLE_INFO";
var tokenID = undefined;
export default function AccessTokenTest() {
describe('AccessTokenTest', function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册