From cae07f31c979cbe115e2983a74eb26d298e0fdbb Mon Sep 17 00:00:00 2001 From: 15829070344 Date: Tue, 28 Jun 2022 21:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E4=BE=8B=E8=A6=86=E7=9B=96=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=86=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 15829070344 --- .../entry/src/main/js/test/OAuthToken.test.js | 31 +++++++++++++++++++ .../src/main/js/test/Getallaccounts.test.js | 2 +- .../src/main/js/test/Getallaccessible.test.js | 2 +- .../src/main/js/test/Getmultiple.test.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../src/main/js/default/pages/index/index.js | 2 +- .../src/main/js/test/OsAccountGet.test.js | 2 +- 7 files changed, 37 insertions(+), 6 deletions(-) diff --git a/account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js b/account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js index 82685f048..33cbcf329 100644 --- a/account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js +++ b/account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js @@ -2494,6 +2494,25 @@ describe('ActsAccountOAuthToken', function () { appAccountManager.getAuthenticatorInfo(OWNERSELF,(err,databack)=>{ console.debug("====>ActsAccountOAuthToken_9500 getAuthenticatorInfo err:" + JSON.stringify(err)); expect(err.code!=0).assertEqual(true); + except(account.ResultCode.SUCCESS).assertEqual(0); + expect(account.ResultCode.ERROR_ACCOUNT_NOT_EXIST).assertEqual(10001); + expect(account.ResultCode.ERROR_APP_ACCOUNT_SERVICE_EXCEPTION).assertEqual(10002); + expect(account.ResultCode.ERROR_INVALID_PASSWORD).assertEqual(10003); + expect(account.ResultCode.ERROR_INVALID_REQUEST).assertEqual(10004); + expect(account.ResultCode.ERROR_INVALID_RESPONSE).assertEqual(10005); + expect(account.ResultCode.ERROR_NETWORK_EXCEPTION).assertEqual(10006); + expect(account.ResultCode.ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST).assertEqual(10007); + expect(account.ResultCode.ERROR_OAUTH_CANCELED).assertEqual(10008); + expect(account.ResultCode.ERROR_OAUTH_LIST_TOO_LARGE).assertEqual(10009); + expect(account.ResultCode.ERROR_OAUTH_SERVICE_BUSY).assertEqual(10010); + expect(account.ResultCode.ERROR_OAUTH_SERVICE_EXCEPTION).assertEqual(10011); + expect(account.ResultCode.ERROR_OAUTH_SESSION_NOT_EXIST).assertEqual(10012); + expect(account.ResultCode.ERROR_OAUTH_TIMEOUT).assertEqual(10013); + expect(account.ResultCode.ERROR_OAUTH_TOKEN_NOT_EXIST).assertEqual(10014); + expect(account.ResultCode.ERROR_OAUTH_TOKEN_TOO_MANY).assertEqual(10015); + expect(account.ResultCode.ERROR_OAUTH_UNSUPPORT_ACTION).assertEqual(10016); + expect(account.ResultCode.ERROR_OAUTH_UNSUPPORT_AUTH_TYPE).assertEqual(10017); + expect(account.ResultCode.ERROR_PERMISSION_DENIED).assertEqual(10018); done(); }); }); @@ -2504,6 +2523,16 @@ describe('ActsAccountOAuthToken', function () { appAccountManager.getAuthenticatorInfo("",(err,databack)=>{ console.debug("====>ActsAccountOAuthToken_9600 getAuthenticatorInfo err:" + JSON.stringify(err)); expect(err.code!=0).assertEqual(true); + expect(account.Constants.ACTION_ADD_ACCOUNT_IMPLICITLY).assertEqual('addAccountImplicitly'); + expect(account.Constants.ACTION_AUTHENTICATE).assertEqual('authenticate'); + expect(account.Constants.KEY_NAME).assertEqual('name'); + expect(account.Constants.KEY_OWNER).assertEqual('owner'); + expect(account.Constants.KEY_TOKEN).assertEqual('token'); + expect(account.Constants.KEY_AUTHTYPE).assertEqual('authType'); + expect(account.Constants.KEY_SESSION_ID).assertEqual('sessionId'); + expect(account.Constants.KEY_CALLER_PID).assertEqual('callerPid'); + expect(account.Constants.KEY_CALLER_UID).assertEqual('callerUid'); + expect(account.Constants.KEY_CALLER_BUNDLE_NAME).assertEqual('callerBundleName'); done(); }); }); @@ -3337,6 +3366,8 @@ describe('ActsAccountOAuthToken', function () { console.debug("====>ActsAccountOAuthToken_13200 getAuthenticatorInfo err:" + JSON.stringify(err)); console.debug("====>ActsAccountOAuthToken_13200 getAuthenticatorInfo dataInfo:" + JSON.stringify(dataInfo)); expect(err.code).assertEqual(0); + expect(isNaN(dataInfo.iconId)).assertFalse(); + expect(isNaN(dataInfo.labelId)).assertFalse(); done(); }); }); diff --git a/account/appaccount/actsgetallaccounts/entry/src/main/js/test/Getallaccounts.test.js b/account/appaccount/actsgetallaccounts/entry/src/main/js/test/Getallaccounts.test.js index ee12e3f8d..dcf06f897 100755 --- a/account/appaccount/actsgetallaccounts/entry/src/main/js/test/Getallaccounts.test.js +++ b/account/appaccount/actsgetallaccounts/entry/src/main/js/test/Getallaccounts.test.js @@ -13,7 +13,7 @@ * limitations under the License. */ import account from '@ohos.account.appAccount' -import featureAbility from '@ohos.ability.featureability' +import featureAbility from '@ohos.ability.featureAbility' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' const TIMEOUT = 2000; diff --git a/account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/js/test/Getallaccessible.test.js b/account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/js/test/Getallaccessible.test.js index c4e9e2083..29f0b71f9 100755 --- a/account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/js/test/Getallaccessible.test.js +++ b/account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/js/test/Getallaccessible.test.js @@ -13,7 +13,7 @@ * limitations under the License. */ import account from '@ohos.account.appAccount' -import featureAbility from '@ohos.ability.featureability' +import featureAbility from '@ohos.ability.featureAbility' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' const TIMEOUT = 2000; diff --git a/account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/Getmultiple.test.js b/account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/Getmultiple.test.js index a044de06b..47e0a82c7 100755 --- a/account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/Getmultiple.test.js +++ b/account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/Getmultiple.test.js @@ -13,7 +13,7 @@ * limitations under the License. */ import account from '@ohos.account.appAccount' -import featureAbility from '@ohos.ability.featureability' +import featureAbility from '@ohos.ability.featureAbility' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' const TIMEOUT = 5000; diff --git a/account/appaccount/sceneProject/actsaccountaccessibleFirst/entry/src/main/js/default/pages/index/index.js b/account/appaccount/sceneProject/actsaccountaccessibleFirst/entry/src/main/js/default/pages/index/index.js index 7275bde5c..c884b7363 100755 --- a/account/appaccount/sceneProject/actsaccountaccessibleFirst/entry/src/main/js/default/pages/index/index.js +++ b/account/appaccount/sceneProject/actsaccountaccessibleFirst/entry/src/main/js/default/pages/index/index.js @@ -13,7 +13,7 @@ * limitations under the License. */ import account from '@ohos.account.appAccount' -import featureAbility from '@ohos.ability.featureability' +import featureAbility from '@ohos.ability.featureAbility' const injectRef = Object.getPrototypeOf(global) || global injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') diff --git a/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js b/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js index ebf6a328a..2a4d51d25 100755 --- a/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js +++ b/account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js @@ -13,7 +13,7 @@ * limitations under the License. */ import account from '@ohos.account.appAccount' -import commonevent from '@ohos.commonevent' +import commonevent from '@ohos.commonEvent' const ACCOUNT_TEST_ONOFF_EXTRA = 1 const ACCOUNT_TEST_ONOFF_ASSOCIATEDDATA = 2 diff --git a/account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountGet.test.js b/account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountGet.test.js index e9d8aa321..55ee7641a 100755 --- a/account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountGet.test.js +++ b/account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountGet.test.js @@ -17,7 +17,7 @@ import bundle from '@ohos.bundle' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' const ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR = 4653057; -describe('ActsOsAccountThirdPartyTest_third_1', function () { +describe('ActsOsAccountThirdPartyTest_third_2', function () { /* * @tc.number : ActsOsAccountGetIdFormUid_0100 -- GitLab