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

【账号】头协议补充

Signed-off-by: N15829070344 <hehaitao5@huawei.com>
上级 8eeb1b8d
......@@ -204,6 +204,7 @@ export default function ActsAccountAppAccess() {
console.debug("====>enableAppAccess 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.disableAppAccess("AppAccess_callback_account", enableBundle, (err)=>{
console.debug("====>disableAppAccess 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
appAccountManager.deleteAccount("AppAccess_callback_account", (err)=>{
console.debug("====>delete Account ActsAccountAppAccess_0700 err:" + JSON.stringify(err));
......
......@@ -376,7 +376,7 @@ export default function ActsAccountAppAccess() {
appAccountManager.getAccountCredential(name, "PIN").then((data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 getAccountCredential_data:" + JSON.stringify(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{
appAccountManager.deleteAccount(name)
console.debug('====>ActsAccountDeleteAccountCredential_0200 deleteAccount_success')
......
......@@ -511,14 +511,15 @@ export default function ActsAccountOAuthToken() {
console.debug("====>ActsAccountOAuthToken_8100 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens start====");
appAccountManager.getAllOAuthTokens(limitName, OWNERSELF,(err,ArrayData)=>{
console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens err:" + JSON.stringify(err));
appAccountManager.getAllOAuthTokens(limitName, OWNERSELF).then((ArrayData)=>{
console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
expect(err.code!=0).assertEqual(true);
expect(ArrayData).assertEqual(null);
expect(ArrayData.length).assertEqual(0);
console.debug("====>ActsAccountOAuthToken_8100 ====");
done();
});
}).catch((err)=>{
expect(err.code!=0).assertEqual(true);
done();
})
});
it('ActsAccountOAuthToken_8200', 0, async function (done) {
......@@ -529,7 +530,6 @@ export default function ActsAccountOAuthToken() {
console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens err:" + JSON.stringify(err));
console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
expect(err.code!=0).assertEqual(true);
expect(ArrayData).assertEqual(null);
console.debug("====>ActsAccountOAuthToken_8200 ====");
done();
});
......@@ -1053,13 +1053,13 @@ export default function ActsAccountOAuthToken() {
await appAccountManager.setOAuthToken("account_promise_setDeleteGet","new_authType","promise_setDeleteGet_token");
console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
var data1_beforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType");
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_beforeDel:" + data1_beforeDel);
var data1BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType");
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1BeforeDel:" + data1BeforeDel);
expect(data1_beforeDel).assertEqual("promise_setDeleteGet_token");
console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
var data2_beforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType");
console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 data2_beforeDel:" + data2_beforeDel);
expect(data2_beforeDel).assertEqual("promise_setDeleteGet_token");
var data2BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType");
console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 data2BeforeDel:" + data2BeforeDel);
expect(data2beforeDel).assertEqual("promise_setDeleteGet_token");
console.debug("====>deleteOAuthToken deleteOld ActsAccountOAuthToken_1200 start====");
try{
......@@ -1072,8 +1072,8 @@ export default function ActsAccountOAuthToken() {
console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
try{
var data1_AfterDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AfterDel:" + data1_AfterDel);
var data1AfterDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AfterDel:" + data1AfterDel);
expect().assertFail();
}
catch(err){
......@@ -1083,8 +1083,8 @@ export default function ActsAccountOAuthToken() {
console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
try{
var data2_AfterDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AfterDel:" + data2_AfterDel);
expect(data2_AfterDel).assertEqual("promise_setDeleteGet_token");
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AfterDel:" + data2AfterDel);
expect(data2AfterDel).assertEqual("promise_setDeleteGet_token");
}
catch(err){
console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 err:" + JSON.stringify(err));
......@@ -1101,8 +1101,8 @@ export default function ActsAccountOAuthToken() {
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 start====");
try{
var data1_AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AgainDel:" + data1_AgainDel);
var data1AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AgainDel:" + data1AgainDel);
expect().assertFail();
}
catch(err){
......@@ -1111,8 +1111,8 @@ export default function ActsAccountOAuthToken() {
}
console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 start====");
try{
var data2_AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AgainDel:" + data2_AgainDel);
var data2AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",);
console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AgainDel:" + data2AgainDel);
expect().assertFail();
}
catch(err){
......@@ -2458,12 +2458,15 @@ export default function ActsAccountOAuthToken() {
it('ActsAccountOAuthToken_9200', 0, async function (done) {
console.debug("====>ActsAccountOAuthToken_9200 start====");
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));
expect(err.code!=0).assertEqual(true);
expect(databack).assertEqual(null);
done();
});
})
});
it('ActsAccountOAuthToken_9300', 0, async function (done) {
......@@ -2568,14 +2571,11 @@ export default function ActsAccountOAuthToken() {
appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err,)=>{
console.debug("====>ActsAccountOAuthToken_9900 addAccount err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName",true,(err)=>{
console.debug("====>ActsAccountOAuthToken_9900 setOAuthTokenVisibility err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName",true).then(()=>{
appAccountManager.getOAuthToken("account_setOAuthTokenVisibility_name",OWNERSELF,"authType",(err,data)=>{
console.debug("====>ActsAccountOAuthToken_9900 getOAuthToken err:" + JSON.stringify(err));
console.debug("====>ActsAccountOAuthToken_9900 getOAuthToken data:" + data);
expect(err.code!=0).assertEqual(true);
expect(data).assertEqual(null);
appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
console.debug("====>ActsAccountOAuthToken_9900 getOAuthList err:" + JSON.stringify(err));
expect(err).assertEqual(null);
......@@ -2590,7 +2590,10 @@ export default function ActsAccountOAuthToken() {
});
});
});
});
}).catch((err)=>{
expect(err).assertEqual(null);
done();
})
});
});
......@@ -3257,13 +3260,14 @@ export default function ActsAccountOAuthToken() {
it('ActsAccountOAuthToken_12700', 0, async function (done) {
console.debug("====>ActsAccountOAuthToken_12700 start====");
var appAccountManager = account.createAppAccountManager();
appAccountManager.getOAuthList("","authType",(err,dataArray)=>{
console.debug("====>ActsAccountOAuthToken_12700 getOAuthList err:" + JSON.stringify(err));
appAccountManager.getOAuthList("","authType").then((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(dataArray).assertEqual(null);
done();
});
})
});
it('ActsAccountOAuthToken_12800', 0, async function (done) {
......
......@@ -326,7 +326,7 @@ export default function ActsAccountChangeOnOff() {
await appAccountManager.enableAppAccess("onoff_delete", "com.example.actsaccountsceneonoff");
function unSubscriberCallback(err){
console.debug("====>unsubscribe 0500 err:" + JSON.stringify(err));
expect(err.code).assertEqual(0);
expect(err).assertEqual(null);
done();
}
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 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 {
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 {
data: {
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 {MyAuthenticator} from '../Common/utils'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册