提交 5b50345d 编写于 作者: 1 15829070344

【账号】头协议补充

Signed-off-by: N15829070344 <hehaitao5@huawei.com>
上级 8eeb1b8d
...@@ -204,6 +204,7 @@ export default function ActsAccountAppAccess() { ...@@ -204,6 +204,7 @@ export default function ActsAccountAppAccess() {
console.debug("====>enableAppAccess 0700 err:" + JSON.stringify(err)); console.debug("====>enableAppAccess 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(null); expect(err).assertEqual(null);
appAccountManager.disableAppAccess("AppAccess_callback_account", enableBundle, (err)=>{ appAccountManager.disableAppAccess("AppAccess_callback_account", enableBundle, (err)=>{
console.debug("====>disableAppAccess 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(null) expect(err).assertEqual(null)
appAccountManager.deleteAccount("AppAccess_callback_account", (err)=>{ appAccountManager.deleteAccount("AppAccess_callback_account", (err)=>{
console.debug("====>delete Account ActsAccountAppAccess_0700 err:" + JSON.stringify(err)); console.debug("====>delete Account ActsAccountAppAccess_0700 err:" + JSON.stringify(err));
......
...@@ -376,7 +376,7 @@ export default function ActsAccountAppAccess() { ...@@ -376,7 +376,7 @@ export default function ActsAccountAppAccess() {
appAccountManager.getAccountCredential(name, "PIN").then((data) =>{ appAccountManager.getAccountCredential(name, "PIN").then((data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 getAccountCredential_data:" + JSON.stringify(data)); console.debug("====>ActsAccountDeleteAccountCredential_0200 getAccountCredential_data:" + JSON.stringify(data));
appAccountManager.deleteAccountCredential(name, "PIN").then((data) =>{ appAccountManager.deleteAccountCredential(name, "PIN").then((data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 data:" + JSON.stringify(data)); //expect undefined assertEqual true console.debug("====>ActsAccountDeleteAccountCredential_0200 data:" + JSON.stringify(data));
try{ try{
appAccountManager.deleteAccount(name) appAccountManager.deleteAccount(name)
console.debug('====>ActsAccountDeleteAccountCredential_0200 deleteAccount_success') console.debug('====>ActsAccountDeleteAccountCredential_0200 deleteAccount_success')
......
...@@ -503,37 +503,37 @@ export default function ActsAccountOAuthToken() { ...@@ -503,37 +503,37 @@ export default function ActsAccountOAuthToken() {
it('ActsAccountOAuthToken_8100', 0, async function (done) { it('ActsAccountOAuthToken_8100', 0, async function (done) {
var limitName = ''; var limitName = '';
for(var i = 0;i < LENGTHLIMIT + 1; i++){ for(var i = 0;i < LENGTHLIMIT + 1; i++){
limitName += 'c'; limitName += 'c';
} }
console.debug("====>ActsAccountOAuthToken_8100 start===="); console.debug("====>ActsAccountOAuthToken_8100 start====");
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens start===="); console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens start====");
appAccountManager.getAllOAuthTokens(limitName, OWNERSELF,(err,ArrayData)=>{ appAccountManager.getAllOAuthTokens(limitName, OWNERSELF).then((ArrayData)=>{
console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens err:" + JSON.stringify(err)); console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData)); expect(ArrayData.length).assertEqual(0);
expect(err.code!=0).assertEqual(true); console.debug("====>ActsAccountOAuthToken_8100 ====");
expect(ArrayData).assertEqual(null); done();
console.debug("====>ActsAccountOAuthToken_8100 ===="); }).catch((err)=>{
done(); expect(err.code!=0).assertEqual(true);
}); done();
}); })
});
it('ActsAccountOAuthToken_8200', 0, async function (done) {
console.debug("====>ActsAccountOAuthToken_8200 start===="); it('ActsAccountOAuthToken_8200', 0, async function (done) {
var appAccountManager = account.createAppAccountManager(); console.debug("====>ActsAccountOAuthToken_8200 start====");
console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens start===="); var appAccountManager = account.createAppAccountManager();
appAccountManager.getAllOAuthTokens("", OWNERSELF,(err,ArrayData)=>{ console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens start====");
console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens err:" + JSON.stringify(err)); appAccountManager.getAllOAuthTokens("", OWNERSELF,(err,ArrayData)=>{
console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData)); console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens err:" + JSON.stringify(err));
expect(err.code!=0).assertEqual(true); console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
expect(ArrayData).assertEqual(null); expect(err.code!=0).assertEqual(true);
console.debug("====>ActsAccountOAuthToken_8200 ===="); console.debug("====>ActsAccountOAuthToken_8200 ====");
done(); done();
});
}); });
});
it('ActsAccountOAuthToken_8300', 0, async function (done) { it('ActsAccountOAuthToken_8300', 0, async function (done) {
console.debug("====>ActsAccountOAuthToken_8300 start===="); console.debug("====>ActsAccountOAuthToken_8300 start====");
...@@ -1053,13 +1053,13 @@ export default function ActsAccountOAuthToken() { ...@@ -1053,13 +1053,13 @@ export default function ActsAccountOAuthToken() {
await appAccountManager.setOAuthToken("account_promise_setDeleteGet","new_authType","promise_setDeleteGet_token"); await appAccountManager.setOAuthToken("account_promise_setDeleteGet","new_authType","promise_setDeleteGet_token");
console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start===="); console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
var data1_beforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType"); var data1BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType");
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_beforeDel:" + data1_beforeDel); console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1BeforeDel:" + data1BeforeDel);
expect(data1_beforeDel).assertEqual("promise_setDeleteGet_token"); expect(data1_beforeDel).assertEqual("promise_setDeleteGet_token");
console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start===="); console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
var data2_beforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType"); var data2BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType");
console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 data2_beforeDel:" + data2_beforeDel); console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 data2BeforeDel:" + data2BeforeDel);
expect(data2_beforeDel).assertEqual("promise_setDeleteGet_token"); expect(data2beforeDel).assertEqual("promise_setDeleteGet_token");
console.debug("====>deleteOAuthToken deleteOld ActsAccountOAuthToken_1200 start===="); console.debug("====>deleteOAuthToken deleteOld ActsAccountOAuthToken_1200 start====");
try{ try{
...@@ -1072,8 +1072,8 @@ export default function ActsAccountOAuthToken() { ...@@ -1072,8 +1072,8 @@ export default function ActsAccountOAuthToken() {
console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start===="); console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
try{ try{
var data1_AfterDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",); var data1AfterDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AfterDel:" + data1_AfterDel); console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AfterDel:" + data1AfterDel);
expect().assertFail(); expect().assertFail();
} }
catch(err){ catch(err){
...@@ -1083,8 +1083,8 @@ export default function ActsAccountOAuthToken() { ...@@ -1083,8 +1083,8 @@ export default function ActsAccountOAuthToken() {
console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start===="); console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
try{ try{
var data2_AfterDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",); var data2_AfterDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AfterDel:" + data2_AfterDel); console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AfterDel:" + data2AfterDel);
expect(data2_AfterDel).assertEqual("promise_setDeleteGet_token"); expect(data2AfterDel).assertEqual("promise_setDeleteGet_token");
} }
catch(err){ catch(err){
console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 err:" + JSON.stringify(err)); console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 err:" + JSON.stringify(err));
...@@ -1101,8 +1101,8 @@ export default function ActsAccountOAuthToken() { ...@@ -1101,8 +1101,8 @@ export default function ActsAccountOAuthToken() {
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 start===="); console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 start====");
try{ try{
var data1_AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",); var data1AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AgainDel:" + data1_AgainDel); console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AgainDel:" + data1AgainDel);
expect().assertFail(); expect().assertFail();
} }
catch(err){ catch(err){
...@@ -1111,8 +1111,8 @@ export default function ActsAccountOAuthToken() { ...@@ -1111,8 +1111,8 @@ export default function ActsAccountOAuthToken() {
} }
console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 start===="); console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 start====");
try{ try{
var data2_AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",); var data2AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AgainDel:" + data2_AgainDel); console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AgainDel:" + data2AgainDel);
expect().assertFail(); expect().assertFail();
} }
catch(err){ catch(err){
...@@ -2457,13 +2457,16 @@ export default function ActsAccountOAuthToken() { ...@@ -2457,13 +2457,16 @@ export default function ActsAccountOAuthToken() {
it('ActsAccountOAuthToken_9200', 0, async function (done) { it('ActsAccountOAuthToken_9200', 0, async function (done) {
console.debug("====>ActsAccountOAuthToken_9200 start===="); console.debug("====>ActsAccountOAuthToken_9200 start====");
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
appAccountManager.getAuthenticatorCallback("test_sessionId",(err,databack)=>{ appAccountManager.getAuthenticatorCallback("test_sessionId").then((databack)=>{
console.debug("====>ActsAccountOAuthToken_9200 getAuthenticatorCallback data:" + JSON.stringify(databack))
expect(databack).assertEqual(undefined);
done();
}).catch((err)=>{
console.debug("====>ActsAccountOAuthToken_9200 getAuthenticatorCallback err:" + JSON.stringify(err)); console.debug("====>ActsAccountOAuthToken_9200 getAuthenticatorCallback err:" + JSON.stringify(err));
expect(err.code!=0).assertEqual(true); expect(err.code!=0).assertEqual(true);
expect(databack).assertEqual(null);
done(); done();
}); })
}); });
it('ActsAccountOAuthToken_9300', 0, async function (done) { it('ActsAccountOAuthToken_9300', 0, async function (done) {
...@@ -2564,33 +2567,33 @@ export default function ActsAccountOAuthToken() { ...@@ -2564,33 +2567,33 @@ export default function ActsAccountOAuthToken() {
it('ActsAccountOAuthToken_9900', 0, async function (done) { it('ActsAccountOAuthToken_9900', 0, async function (done) {
console.debug("====>ActsAccountOAuthToken_9900 start===="); console.debug("====>ActsAccountOAuthToken_9900 start====");
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err,)=>{ appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err,)=>{
console.debug("====>ActsAccountOAuthToken_9900 addAccount err:" + JSON.stringify(err)); console.debug("====>ActsAccountOAuthToken_9900 addAccount err:" + JSON.stringify(err));
expect(err).assertEqual(null); expect(err).assertEqual(null);
appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName",true,(err)=>{ appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName",true).then(()=>{
console.debug("====>ActsAccountOAuthToken_9900 setOAuthTokenVisibility err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getOAuthToken("account_setOAuthTokenVisibility_name",OWNERSELF,"authType",(err,data)=>{ appAccountManager.getOAuthToken("account_setOAuthTokenVisibility_name",OWNERSELF,"authType",(err,data)=>{
console.debug("====>ActsAccountOAuthToken_9900 getOAuthToken err:" + JSON.stringify(err)); console.debug("====>ActsAccountOAuthToken_9900 getOAuthToken err:" + JSON.stringify(err));
console.debug("====>ActsAccountOAuthToken_9900 getOAuthToken data:" + data); console.debug("====>ActsAccountOAuthToken_9900 getOAuthToken data:" + data);
expect(err.code!=0).assertEqual(true); expect(err.code!=0).assertEqual(true);
expect(data).assertEqual(null);
appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{ appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
console.debug("====>ActsAccountOAuthToken_9900 getOAuthList err:" + JSON.stringify(err)); console.debug("====>ActsAccountOAuthToken_9900 getOAuthList err:" + JSON.stringify(err));
expect(err).assertEqual(null); expect(err).assertEqual(null);
console.debug("====>ActsAccountOAuthToken_9900 getOAuthList dataArray:" + JSON.stringify(dataArray)); console.debug("====>ActsAccountOAuthToken_9900 getOAuthList dataArray:" + JSON.stringify(dataArray));
expect(dataArray.length).assertEqual(1); expect(dataArray.length).assertEqual(1);
expect(dataArray[0]).assertEqual("test_BundleName"); expect(dataArray[0]).assertEqual("test_BundleName");
appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{ appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
console.debug("====>ActsAccountOAuthToken_9900 deleteAccount err:" + JSON.stringify(err)); console.debug("====>ActsAccountOAuthToken_9900 deleteAccount err:" + JSON.stringify(err));
expect(err).assertEqual(null); expect(err).assertEqual(null);
console.debug("====>ActsAccountOAuthToken_9900 end===="); console.debug("====>ActsAccountOAuthToken_9900 end====");
done(); done();
}); });
}); });
}); });
}); }).catch((err)=>{
expect(err).assertEqual(null);
done();
})
}); });
}); });
...@@ -3257,13 +3260,14 @@ export default function ActsAccountOAuthToken() { ...@@ -3257,13 +3260,14 @@ export default function ActsAccountOAuthToken() {
it('ActsAccountOAuthToken_12700', 0, async function (done) { it('ActsAccountOAuthToken_12700', 0, async function (done) {
console.debug("====>ActsAccountOAuthToken_12700 start===="); console.debug("====>ActsAccountOAuthToken_12700 start====");
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
appAccountManager.getOAuthList("","authType",(err,dataArray)=>{ appAccountManager.getOAuthList("","authType").then((dataArray)=>{
console.debug("====>ActsAccountOAuthToken_12700 getOAuthList err:" + JSON.stringify(err)); console.debug("====>ActsAccountOAuthToken_12700 getOAuthList dataArray:" + JSON.stringify(dataArray));
console.debug("====>ActsAccountOAuthToken_12700 getOAuthList dataArray:" + JSON.stringify(dataArray)); expect(dataArray.length).assertEqual(0);
done();
}).catch((err)=>{
expect(err.code!=0).assertEqual(true); expect(err.code!=0).assertEqual(true);
expect(dataArray).assertEqual(null);
done(); done();
}); })
}); });
it('ActsAccountOAuthToken_12800', 0, async function (done) { it('ActsAccountOAuthToken_12800', 0, async function (done) {
......
...@@ -326,7 +326,7 @@ export default function ActsAccountChangeOnOff() { ...@@ -326,7 +326,7 @@ export default function ActsAccountChangeOnOff() {
await appAccountManager.enableAppAccess("onoff_delete", "com.example.actsaccountsceneonoff"); await appAccountManager.enableAppAccess("onoff_delete", "com.example.actsaccountsceneonoff");
function unSubscriberCallback(err){ function unSubscriberCallback(err){
console.debug("====>unsubscribe 0500 err:" + JSON.stringify(err)); console.debug("====>unsubscribe 0500 err:" + JSON.stringify(err));
expect(err.code).assertEqual(0); expect(err).assertEqual(null);
done(); done();
} }
function subscriberCallback(err, data){ function subscriberCallback(err, data){
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import account_appAccount from '@ohos.account.appAccount'; import account_appAccount from '@ohos.account.appAccount';
import rpc from '@ohos.rpc'; import rpc from '@ohos.rpc';
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default { export default {
onCreate() { onCreate() {
console.info("Application onCreate"); console.info("Application onCreate");
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default { export default {
data: { data: {
title: "Hello World" title: "Hello World"
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import account_appAccount from '@ohos.account.appAccount'; import account_appAccount from '@ohos.account.appAccount';
import {MyAuthenticator} from '../Common/utils' import {MyAuthenticator} from '../Common/utils'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册