diff --git a/account/appaccount/actsaccountoperatetest/src/main/js/test/AuthToken.test.js b/account/appaccount/actsaccountoperatetest/src/main/js/test/AuthToken.test.js index 2387afcb49bbda2090616fba56393a9b9f57bdf3..d92f233917bfc59dd27aa68bc864b46fc3a0b3d7 100644 --- a/account/appaccount/actsaccountoperatetest/src/main/js/test/AuthToken.test.js +++ b/account/appaccount/actsaccountoperatetest/src/main/js/test/AuthToken.test.js @@ -3331,6 +3331,19 @@ export default function ActsAccountAuthToken() { done(); }); }); + + it('ActsAccountOAuthToken_13201', 0, async function (done) { + console.debug("====>ActsAccountOAuthToken_13201 start===="); + var appAccountManager = account.createAppAccountManager(); + await appAccountManager.queryAuthenticatorInfo("com.example.actsaccountOauthtoken").then((dataInfo) =>{ + console.debug("====>ActsAccountOAuthToken_13201 queryAuthenticatorInfo dataInfo:" + JSON.stringify(dataInfo)); + expect(isNaN(dataInfo.iconId)).assertFalse(); + expect(isNaN(dataInfo.labelId)).assertFalse(); + done(); + }).catch((err) => { + console.debug("====>ActsAccountOAuthToken_13201 queryAuthenticatorInfo err:" + JSON.stringify(err)); + }); + }); it('ActsAccountAuthToken_13300', 0, async function (done) { console.debug("====>ActsAccountAuthToken_13300 start===="); diff --git a/account/appaccount/actsaccounttest/src/main/js/test/OAuthToken.test.js b/account/appaccount/actsaccounttest/src/main/js/test/OAuthToken.test.js index c4b24715b8a8531c144cb711cf4310a11e00cf20..e994af82eca7cfb35ba100ae86ba6381016f696e 100644 --- a/account/appaccount/actsaccounttest/src/main/js/test/OAuthToken.test.js +++ b/account/appaccount/actsaccounttest/src/main/js/test/OAuthToken.test.js @@ -3367,6 +3367,19 @@ export default function ActsAccountOAuthToken() { done(); }); }); + + it('ActsAccountOAuthToken_13201', 0, async function (done) { + console.debug("====>ActsAccountOAuthToken_13201 start===="); + var appAccountManager = account.createAppAccountManager(); + await appAccountManager.getAuthenticatorInfo("com.example.actsaccountOauthtoken").then((dataInfo) =>{ + console.debug("====>ActsAccountOAuthToken_13201 getAuthenticatorInfo dataInfo:" + JSON.stringify(dataInfo)); + expect(isNaN(dataInfo.iconId)).assertFalse(); + expect(isNaN(dataInfo.labelId)).assertFalse(); + done(); + }).catch((err) => { + console.debug("====>ActsAccountOAuthToken_13201 getAuthenticatorInfo err:" + JSON.stringify(err)); + }); + }); it('ActsAccountOAuthToken_13300', 0, async function (done) { console.debug("====>ActsAccountOAuthToken_13300 start===="); diff --git a/account/appaccount/actsappaccountplugintest/entry/src/main/ets/test/actsAALoginPluginTest.test.ets b/account/appaccount/actsappaccountplugintest/entry/src/main/ets/test/actsAALoginPluginTest.test.ets index 5dbe9c91ee4f974747fe20bd261b0c276be9402e..3c7054e7b1efa51f110c6560b318ee99b136527f 100644 --- a/account/appaccount/actsappaccountplugintest/entry/src/main/ets/test/actsAALoginPluginTest.test.ets +++ b/account/appaccount/actsappaccountplugintest/entry/src/main/ets/test/actsAALoginPluginTest.test.ets @@ -272,7 +272,7 @@ export default function ActsAALoginPlugin() { let scheduler = new appAccount.AccountCapabilityScheduler(); scheduler.executeRequest(request, async (err, data) => { console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_1700 err: " + JSON.stringify(err)); - expect(err).assertEqual(12300002); + expect(err.code).assertEqual(12300002); console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_1700 end===="); await sleep(200) done(); @@ -303,7 +303,7 @@ export default function ActsAALoginPlugin() { done(); }).catch(async (err) => { console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_1800 err: " + JSON.stringify(err)); - expect(err).assertEqual(12300002); + expect(err.code).assertEqual(12300002); console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_1800 end===="); await sleep(200) done(); @@ -331,7 +331,7 @@ export default function ActsAALoginPlugin() { let scheduler = new appAccount.AccountCapabilityScheduler(); scheduler.executeRequest(request, async (err, data) => { console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_1900 err: " + JSON.stringify(err)); - expect(err).assertEqual(12300002); + expect(err.code).assertEqual(12300002); console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_1900 end===="); await sleep(200) done(); @@ -362,7 +362,7 @@ export default function ActsAALoginPlugin() { done(); }).catch(async (err) => { console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_2000 err: " + JSON.stringify(err)); - expect(err).assertEqual(12300002); + expect(err.code).assertEqual(12300002); console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_2000 end===="); await sleep(200) done(); @@ -388,7 +388,7 @@ export default function ActsAALoginPlugin() { let scheduler = new appAccount.AccountCapabilityScheduler(); scheduler.executeRequest(request, async (err, data) => { console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_2100 err: " + JSON.stringify(err)); - expect(err).assertEqual(12300002); + expect(err.code).assertEqual(12300002); console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_2100 end===="); await sleep(200) done(); @@ -419,7 +419,7 @@ export default function ActsAALoginPlugin() { done(); }).catch(async (err) => { console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_2200 err: " + JSON.stringify(err)); - expect(err).assertEqual(12300002); + expect(err.code).assertEqual(12300002); console.debug("====>SUB_ACCOUNT_APPACCOUNT_ExecuteRequest_2200 end===="); await sleep(200) done(); @@ -431,6 +431,36 @@ export default function ActsAALoginPlugin() { done() } }) + + /* + * @tc.number : SUB_ACCOUNT_APPACCOUNT_EXTENSION_ABILITY_0100 + * @tc.name : ExtensionAbility Attribute verification test_0100 + * @tc.desc : capabilityType & request + */ + it('SUB_ACCOUNT_APPACCOUNT_EXTENSION_ABILITY_0100', 0, async function (done) { + console.debug("====>SUB_ACCOUNT_APPACCOUNT_EXTENSION_ABILITY_0100 start===="); + try { + let capabilityType = appAccount.AccountCapabilityType.AUTHORIZATION + let testProvider = new appAccount.AccountCapabilityProvider(capabilityType) + let request = new TestAuthRequest(testProvider) + let testResponse = new appAccount.AccountCapabilityResponse(request) + let result_1 = (testProvider instanceof appAccount.AccountCapabilityProvider) + let result_2 = (testResponse instanceof appAccount.AccountCapabilityResponse) + console.debug("====>SUB_ACCOUNT_APPACCOUNT_EXTENSION_ABILITY_0100 testProvider result: " + JSON.stringify(result_1)); + console.debug("====>SUB_ACCOUNT_APPACCOUNT_EXTENSION_ABILITY_0100 testResponse result: " + JSON.stringify(result_2)); + expect(result_1).assertTrue() + expect(result_2).assertTrue() + console.debug("====>SUB_ACCOUNT_APPACCOUNT_EXTENSION_ABILITY_0100 end===="); + await sleep(200) + done(); + } catch (err) { + console.debug("====>SUB_ACCOUNT_APPACCOUNT_EXTENSION_ABILITY_0100 exception: " + JSON.stringify(err)); + console.debug("====>SUB_ACCOUNT_APPACCOUNT_EXTENSION_ABILITY_0100 err===="); + expect().assertFail(); + await sleep(200) + done() + } + }); /* * @tc.number : SUB_ACCOUNT_APPACCOUNT_Enum_AccountCapabilityType_0100