From 232dae8708d93270001884ac39c87db2ca13edfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E6=B5=B7?= Date: Thu, 30 Jun 2022 03:07:52 +0000 Subject: [PATCH] =?UTF-8?q?=E3=80=90security=E3=80=91=E3=80=90monthly0614?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E6=94=B9access=5Ftoken=E7=94=A8=E4=BE=8Bloca?= =?UTF-8?q?lled=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F=20Signed-off-by:=20jin?= =?UTF-8?q?haihw=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/js/default/test/AccessToken.test.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/security/access_token/AccessTokenTest_Normal_js/src/main/js/default/test/AccessToken.test.js b/security/access_token/AccessTokenTest_Normal_js/src/main/js/default/test/AccessToken.test.js index f5a3f40de..a2f6d3a37 100755 --- a/security/access_token/AccessTokenTest_Normal_js/src/main/js/default/test/AccessToken.test.js +++ b/security/access_token/AccessTokenTest_Normal_js/src/main/js/default/test/AccessToken.test.js @@ -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"); -- GitLab