未验证 提交 93c47a1e 编写于 作者: C chennian 提交者: Gitee

Signed-off-by:chennian<chennian1@huawei.com>

上级 baf0122f
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
*/ */
// @ts-nocheck // @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 abilityAccessCtrl from '@ohos.abilityAccessCtrl'
import bundle from '@ohos.bundle' import bundle from '@ohos.bundle'
import osAccount from '@ohos.account.osAccount'
var PermissionFlag = { var PermissionFlag = {
PERMISSION_USER_SET: 1, PERMISSION_USER_SET: 1,
...@@ -37,11 +38,13 @@ var permissionNameUser = "ohos.permission.ALPHA"; ...@@ -37,11 +38,13 @@ var permissionNameUser = "ohos.permission.ALPHA";
var permissionNameSystem = "ohos.permission.BETA"; var permissionNameSystem = "ohos.permission.BETA";
var tokenID = undefined var tokenID = undefined
describe('AccessTokenTest', function () { describe('AccessTokenTest', function () {
console.log('##########start AccessTokenTest'); console.info('##########start AccessTokenTest');
beforeAll(async function (done){ 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; tokenID = appInfo.accessTokenId;
console.log("AccessTokenTest accessTokenId:" + appInfo.accessTokenId + ", name:" + appInfo.name console.info("AccessTokenTest accessTokenId:" + appInfo.accessTokenId + ", name:" + appInfo.name
+ ", bundleName:" + appInfo.bundleName) + ", bundleName:" + appInfo.bundleName)
// setTimeout(done(),TIMEOUT); // setTimeout(done(),TIMEOUT);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册