未验证 提交 232dae87 编写于 作者: 金海 提交者: Gitee

【security】【monthly0614】修改access_token用例localled获取方式

Signed-off-by: Njinhaihw <jinhai2@huawei.com>
上级 2f454cc0
......@@ -14,9 +14,10 @@
*/
// @ts-nocheck
import {describe, beforeEach, afterEach, it, expect} from 'deccjsunit/index'
import {describe, beforeAll, afterEach, it, expect} from 'deccjsunit/index'
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import bundle from '@ohos.bundle'
import osAccount from '@ohos.account.osAccount'
var PermissionFlag = {
PERMISSION_USER_SET: 1,
......@@ -37,11 +38,13 @@ var permissionNameUser = "ohos.permission.ALPHA";
var permissionNameSystem = "ohos.permission.BETA";
var tokenID = undefined
describe('AccessTokenTest', function () {
console.log('##########start AccessTokenTest');
console.info('##########start AccessTokenTest');
beforeAll(async function (done){
var appInfo = await bundle.getApplicationInfo('ohos.acts.security.access_token.normal', 0, 100);
var accountManager = osAccount.getAccountManager();
var localled = await accountManager.getOsAccountTypeFromProcess();
var appInfo = await bundle.getApplicationInfo('ohos.acts.security.access_token.normal', 0, localled);
tokenID = appInfo.accessTokenId;
console.log("AccessTokenTest accessTokenId:" + appInfo.accessTokenId + ", name:" + appInfo.name
console.info("AccessTokenTest accessTokenId:" + appInfo.accessTokenId + ", name:" + appInfo.name
+ ", bundleName:" + appInfo.bundleName)
// setTimeout(done(),TIMEOUT);
......@@ -79,7 +82,7 @@ describe('AccessTokenTest', function () {
/**
* @tc.number Test_verifyAccessToken_002
* @tc.name Test atManager.verifyAccessToken.
* @tc.desc After the installation, system_grant permission is not granted by default(Promise).
* @tc.desc After the installation, system_grant permission is granted by default(Promise).
*/
it('Test_verifyAccessToken_002', 0, async function(done){
console.log("Test_verifyAccessToken_002 start");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册