未验证 提交 5675c987 编写于 作者: O openharmony_ci 提交者: Gitee

!9760 分布式账号用例修改

Merge pull request !9760 from liushuling/authenticationXTS
...@@ -41,7 +41,6 @@ export default function ActsDAGetSetTest() { ...@@ -41,7 +41,6 @@ export default function ActsDAGetSetTest() {
*/ */
it('ActsDADeviceId_0100', 0, async function(done){ it('ActsDADeviceId_0100', 0, async function(done){
console.log("====>ActsDADeviceId_0100 test query distribtued id start"); console.log("====>ActsDADeviceId_0100 test query distribtued id start");
const distributedId = '5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5'; //'12345'sha256的值
const accountAbility = account.getDistributedAccountAbility(); const accountAbility = account.getDistributedAccountAbility();
accountAbility.setOsAccountDistributedInfo(LOGININFO, (err)=>{ accountAbility.setOsAccountDistributedInfo(LOGININFO, (err)=>{
console.log("====>ActsDADeviceId_0100 set distributedInfo err:" + JSON.stringify(err)); console.log("====>ActsDADeviceId_0100 set distributedInfo err:" + JSON.stringify(err));
...@@ -49,12 +48,19 @@ export default function ActsDAGetSetTest() { ...@@ -49,12 +48,19 @@ export default function ActsDAGetSetTest() {
console.log("====>ActsDADeviceId_0100 get distributedInfo err:" + JSON.stringify(err)); console.log("====>ActsDADeviceId_0100 get distributedInfo err:" + JSON.stringify(err));
console.log("====>ActsDADeviceId_0100 get distributedInfo:" + JSON.stringify(distributedInfo)); console.log("====>ActsDADeviceId_0100 get distributedInfo:" + JSON.stringify(distributedInfo));
expect(distributedInfo.name).assertEqual('ZhangSan'); expect(distributedInfo.name).assertEqual('ZhangSan');
expect(distributedInfo.id).assertEqual(distributedId); expect(distributedInfo.id !== 'ohosAnonymousUid').assertTrue()
accountAbility.setOsAccountDistributedInfo(LOGOUTINFO, (err)=>{ let uid = distributedInfo.id
console.debug('====>ActsDADeviceId_0100 logout_result:'+ JSON.stringify(err)) accountAbility.getOsAccountDistributedInfo((err, distributedInfo)=>{
expect(err).assertEqual(null) console.log("====>ActsDADeviceId_0100 get distributedInfo err:" + JSON.stringify(err));
console.log("====>test query distribtued id end"); console.log("====>ActsDADeviceId_0100 get distributedInfo:" + JSON.stringify(distributedInfo));
done(); expect(distributedInfo.name).assertEqual('ZhangSan');
expect(distributedInfo.id).assertEqual(uid)
accountAbility.setOsAccountDistributedInfo(LOGOUTINFO, (err)=>{
console.debug('====>ActsDADeviceId_0100 logout_result:'+ JSON.stringify(err))
expect(err).assertEqual(null)
console.log("====>test query distribtued id end");
done();
})
}) })
}) })
}) })
...@@ -162,7 +168,7 @@ export default function ActsDAGetSetTest() { ...@@ -162,7 +168,7 @@ export default function ActsDAGetSetTest() {
console.debug('====>setOsAccountDistributedInfo_test001 ccerr:' + JSON.stringify(err)) console.debug('====>setOsAccountDistributedInfo_test001 ccerr:' + JSON.stringify(err))
console.debug('====>setOsAccountDistributedInfo_test001 data:' + JSON.stringify(data)) console.debug('====>setOsAccountDistributedInfo_test001 data:' + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -205,7 +211,7 @@ export default function ActsDAGetSetTest() { ...@@ -205,7 +211,7 @@ export default function ActsDAGetSetTest() {
console.debug('====>setOsAccountDistributedInfo_test002 get ccerr:' + JSON.stringify(err)) console.debug('====>setOsAccountDistributedInfo_test002 get ccerr:' + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test002 get data:" + JSON.stringify(data)) console.debug("====>setOsAccountDistributedInfo_test002 get data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -262,7 +268,7 @@ export default function ActsDAGetSetTest() { ...@@ -262,7 +268,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>setOsAccountDistributedInfo_test004 query_err:" + JSON.stringify(err)) console.debug("====>setOsAccountDistributedInfo_test004 query_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test004 query_data:" + JSON.stringify(data)) console.debug("====>setOsAccountDistributedInfo_test004 query_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -303,7 +309,7 @@ export default function ActsDAGetSetTest() { ...@@ -303,7 +309,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>updateOsAccountDistributedInfo_test005 get_err:" + JSON.stringify(err)) console.debug("====>updateOsAccountDistributedInfo_test005 get_err:" + JSON.stringify(err))
console.debug("====>updateOsAccountDistributedInfo_test005 get_data:" + JSON.stringify(data)) console.debug("====>updateOsAccountDistributedInfo_test005 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -344,7 +350,7 @@ export default function ActsDAGetSetTest() { ...@@ -344,7 +350,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>setOsAccountDistributedInfo_test006 get_err:" + JSON.stringify(err)) console.debug("====>setOsAccountDistributedInfo_test006 get_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test006 get_data:" + JSON.stringify(data)) console.debug("====>setOsAccountDistributedInfo_test006 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -386,7 +392,7 @@ export default function ActsDAGetSetTest() { ...@@ -386,7 +392,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>setOsAccountDistributedInfo_test007 get_err:" + JSON.stringify(err)) console.debug("====>setOsAccountDistributedInfo_test007 get_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test007 get_data:" + JSON.stringify(data)) console.debug("====>setOsAccountDistributedInfo_test007 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -427,7 +433,7 @@ export default function ActsDAGetSetTest() { ...@@ -427,7 +433,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>setOsAccountDistributedInfo_test008 get_err:" + JSON.stringify(err)) console.debug("====>setOsAccountDistributedInfo_test008 get_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfo_test008 get_data:" + JSON.stringify(data)) console.debug("====>setOsAccountDistributedInfo_test008 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -639,7 +645,7 @@ export default function ActsDAGetSetTest() { ...@@ -639,7 +645,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>setOsAccountDistributedInfoByLocalId_test0100 get_err:" + JSON.stringify(err)) console.debug("====>setOsAccountDistributedInfoByLocalId_test0100 get_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfoByLocalId_test0100 get_data:" + JSON.stringify(data)) console.debug("====>setOsAccountDistributedInfoByLocalId_test0100 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -680,7 +686,7 @@ export default function ActsDAGetSetTest() { ...@@ -680,7 +686,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>setOsAccountDistributedInfoByLocalId_test0200 get_err:" + JSON.stringify(err)) console.debug("====>setOsAccountDistributedInfoByLocalId_test0200 get_err:" + JSON.stringify(err))
console.debug("====>setOsAccountDistributedInfoByLocalId_test0200 get_data:" + JSON.stringify(data)) console.debug("====>setOsAccountDistributedInfoByLocalId_test0200 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -762,7 +768,7 @@ export default function ActsDAGetSetTest() { ...@@ -762,7 +768,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_0100 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_0100 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_0100 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_0100 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -805,7 +811,7 @@ export default function ActsDAGetSetTest() { ...@@ -805,7 +811,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_0200 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_0200 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_0200 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_0200 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -852,7 +858,7 @@ export default function ActsDAGetSetTest() { ...@@ -852,7 +858,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_0300 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_0300 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_0300 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_0300 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -895,7 +901,7 @@ export default function ActsDAGetSetTest() { ...@@ -895,7 +901,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_0400 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_0400 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_0400 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_0400 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -938,7 +944,7 @@ export default function ActsDAGetSetTest() { ...@@ -938,7 +944,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_0500 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_0500 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_0500 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_0500 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -977,7 +983,7 @@ export default function ActsDAGetSetTest() { ...@@ -977,7 +983,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_0600 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_0600 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_0600 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_0600 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -1024,7 +1030,7 @@ export default function ActsDAGetSetTest() { ...@@ -1024,7 +1030,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_0700 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_0700 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_0700 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_0700 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -1067,7 +1073,7 @@ export default function ActsDAGetSetTest() { ...@@ -1067,7 +1073,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_0800 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_0800 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_0800 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_0800 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -1114,7 +1120,7 @@ export default function ActsDAGetSetTest() { ...@@ -1114,7 +1120,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_0900 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_0900 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_0900 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_0900 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
...@@ -1157,7 +1163,7 @@ export default function ActsDAGetSetTest() { ...@@ -1157,7 +1163,7 @@ export default function ActsDAGetSetTest() {
console.debug("====>DistributedAccountOptionalParameter_1000 get_err:" + JSON.stringify(err)) console.debug("====>DistributedAccountOptionalParameter_1000 get_err:" + JSON.stringify(err))
console.debug("====>DistributedAccountOptionalParameter_1000 get_data:" + JSON.stringify(data)) console.debug("====>DistributedAccountOptionalParameter_1000 get_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
expect(data.status).assertEqual(1) expect(data.status).assertEqual(1)
let obj = { let obj = {
id: '12345', id: '12345',
......
...@@ -42,7 +42,6 @@ export default function AccountTest() { ...@@ -42,7 +42,6 @@ export default function AccountTest() {
console.debug('====>ActsDistributedAccountDeviceId_0100 start====') console.debug('====>ActsDistributedAccountDeviceId_0100 start====')
try { try {
console.log("====>test query distribtued id start"); console.log("====>test query distribtued id start");
const distributedId = '5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5'; //'12345'sha256的值
const accountAbility = account.getDistributedAccountAbility(); const accountAbility = account.getDistributedAccountAbility();
accountAbility.updateOsAccountDistributedInfo(LOGININFO, (err)=>{ accountAbility.updateOsAccountDistributedInfo(LOGININFO, (err)=>{
console.log("====>update distributedInfo err:" + JSON.stringify(err)); console.log("====>update distributedInfo err:" + JSON.stringify(err));
...@@ -50,13 +49,20 @@ export default function AccountTest() { ...@@ -50,13 +49,20 @@ export default function AccountTest() {
console.log("====>query distributedInfo err:" + JSON.stringify(err)); console.log("====>query distributedInfo err:" + JSON.stringify(err));
console.log("====>query distributedInfo:" + JSON.stringify(distributedInfo)); console.log("====>query distributedInfo:" + JSON.stringify(distributedInfo));
expect(distributedInfo.name).assertEqual('ZhangSan'); expect(distributedInfo.name).assertEqual('ZhangSan');
expect(distributedInfo.id).assertEqual(distributedId); expect(distributedInfo.id !== 'ohosAnonymousUid').assertTrue()
console.debug('success') let uid = distributedInfo.id
accountAbility.updateOsAccountDistributedInfo(LOGOUTINFO, (err)=>{ accountAbility.queryOsAccountDistributedInfo((err, distributedInfo)=>{
console.debug('====>ActsDistributedAccountDeviceId_0100 logout_result:'+ JSON.stringify(err)) console.log("====>query distributedInfo err:" + JSON.stringify(err));
expect(err).assertEqual(undefined) console.log("====>query distributedInfo:" + JSON.stringify(distributedInfo));
console.log("====>test query distribtued id end"); expect(distributedInfo.name).assertEqual('ZhangSan');
done(); expect(distributedInfo.id).assertEqual(uid)
console.debug('success')
accountAbility.updateOsAccountDistributedInfo(LOGOUTINFO, (err)=>{
console.debug('====>ActsDistributedAccountDeviceId_0100 logout_result:'+ JSON.stringify(err))
expect(err).assertEqual(undefined)
console.log("====>test query distribtued id end");
done();
})
}) })
}) })
}) })
...@@ -157,7 +163,7 @@ export default function AccountTest() { ...@@ -157,7 +163,7 @@ export default function AccountTest() {
accountAbility.queryOsAccountDistributedInfo(async function (err, data) { accountAbility.queryOsAccountDistributedInfo(async function (err, data) {
console.debug('====>account_updateOsAccountDistributedInfo_test001 data:' + JSON.stringify(data)) console.debug('====>account_updateOsAccountDistributedInfo_test001 data:' + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
let obj = { let obj = {
id: '12345', id: '12345',
name: 'ZhangSan', name: 'ZhangSan',
...@@ -195,7 +201,7 @@ export default function AccountTest() { ...@@ -195,7 +201,7 @@ export default function AccountTest() {
accountAbility.queryOsAccountDistributedInfo(async function (err, data) { accountAbility.queryOsAccountDistributedInfo(async function (err, data) {
console.debug("====>account_updateOsAccountDistributedInfo_test002 data:" + JSON.stringify(data)) console.debug("====>account_updateOsAccountDistributedInfo_test002 data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
let obj = { let obj = {
id: '12345', id: '12345',
name: 'ZhangSan', name: 'ZhangSan',
...@@ -266,7 +272,7 @@ export default function AccountTest() { ...@@ -266,7 +272,7 @@ export default function AccountTest() {
console.debug("====>account_updateOsAccountDistributedInfo_test004 query_err:" + JSON.stringify(err)) console.debug("====>account_updateOsAccountDistributedInfo_test004 query_err:" + JSON.stringify(err))
console.debug("====>account_updateOsAccountDistributedInfo_test004 query_data:" + JSON.stringify(data)) console.debug("====>account_updateOsAccountDistributedInfo_test004 query_data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
let obj = { let obj = {
id: '12345', id: '12345',
name: 'ZhangSan', name: 'ZhangSan',
...@@ -307,7 +313,7 @@ export default function AccountTest() { ...@@ -307,7 +313,7 @@ export default function AccountTest() {
accountAbility.queryOsAccountDistributedInfo(async function (err, data) { accountAbility.queryOsAccountDistributedInfo(async function (err, data) {
console.debug('====>account_updateOsAccountDistributedInfo_test005 data:' + JSON.stringify(data)) console.debug('====>account_updateOsAccountDistributedInfo_test005 data:' + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
let obj = { let obj = {
id: '12345', id: '12345',
name: 'ZhangSan', name: 'ZhangSan',
...@@ -352,7 +358,7 @@ export default function AccountTest() { ...@@ -352,7 +358,7 @@ export default function AccountTest() {
accountAbility.queryOsAccountDistributedInfo(async function (err, data) { accountAbility.queryOsAccountDistributedInfo(async function (err, data) {
console.debug("====>account_updateOsAccountDistributedInfo_test006 data:" + JSON.stringify(data)) console.debug("====>account_updateOsAccountDistributedInfo_test006 data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
let obj = { let obj = {
id: '12345', id: '12345',
name: 'ZhangSan', name: 'ZhangSan',
...@@ -393,7 +399,7 @@ export default function AccountTest() { ...@@ -393,7 +399,7 @@ export default function AccountTest() {
accountAbility.queryOsAccountDistributedInfo(async function (err, data) { accountAbility.queryOsAccountDistributedInfo(async function (err, data) {
console.debug('====>account_updateOsAccountDistributedInfo_test007 data:' + JSON.stringify(data)) console.debug('====>account_updateOsAccountDistributedInfo_test007 data:' + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
let obj = { let obj = {
id: '12345', id: '12345',
name: 'ZhangSan', name: 'ZhangSan',
...@@ -434,7 +440,7 @@ export default function AccountTest() { ...@@ -434,7 +440,7 @@ export default function AccountTest() {
accountAbility.queryOsAccountDistributedInfo(async function (err, data) { accountAbility.queryOsAccountDistributedInfo(async function (err, data) {
console.debug("====>account_updateOsAccountDistributedInfo_test008 data:" + JSON.stringify(data)) console.debug("====>account_updateOsAccountDistributedInfo_test008 data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
let obj = { let obj = {
id: '12345', id: '12345',
name: 'ZhangSan', name: 'ZhangSan',
...@@ -471,7 +477,7 @@ export default function AccountTest() { ...@@ -471,7 +477,7 @@ export default function AccountTest() {
accountAbility.queryOsAccountDistributedInfo(async function (err, data) { accountAbility.queryOsAccountDistributedInfo(async function (err, data) {
console.debug('====>account_updateOsAccountDistributedInfo_test009 data:' + JSON.stringify(data)) console.debug('====>account_updateOsAccountDistributedInfo_test009 data:' + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
let obj = { let obj = {
id: '12345', id: '12345',
name: 'ZhangSan', name: 'ZhangSan',
...@@ -508,7 +514,7 @@ export default function AccountTest() { ...@@ -508,7 +514,7 @@ export default function AccountTest() {
accountAbility.queryOsAccountDistributedInfo(async function (err, data) { accountAbility.queryOsAccountDistributedInfo(async function (err, data) {
console.debug("====>account_updateOsAccountDistributedInfo_test010 data:" + JSON.stringify(data)) console.debug("====>account_updateOsAccountDistributedInfo_test010 data:" + JSON.stringify(data))
expect(data.name).assertEqual('ZhangSan') expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') expect(data.id !== 'ohosAnonymousUid').assertTrue()
let obj = { let obj = {
id: '12345', id: '12345',
name: 'ZhangSan', name: 'ZhangSan',
......
...@@ -33,7 +33,6 @@ export default function ActsOsAccountThirdPartyTest_third_3() { ...@@ -33,7 +33,6 @@ export default function ActsOsAccountThirdPartyTest_third_3() {
console.debug("====>ActsOsAccountDeviceId_0100 start===="); console.debug("====>ActsOsAccountDeviceId_0100 start====");
var AccountManager = osAccount.getAccountManager(); var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish===="); console.debug("====>get os AccountManager finish====");
const deviceId = '5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5';
const accountAbility = distributedAccount.getDistributedAccountAbility(); const accountAbility = distributedAccount.getDistributedAccountAbility();
accountAbility.updateOsAccountDistributedInfo( accountAbility.updateOsAccountDistributedInfo(
{ {
...@@ -46,7 +45,7 @@ export default function ActsOsAccountThirdPartyTest_third_3() { ...@@ -46,7 +45,7 @@ export default function ActsOsAccountThirdPartyTest_third_3() {
console.debug("====>queryDistributedVirtualDeviceId err:" + JSON.stringify(err)); console.debug("====>queryDistributedVirtualDeviceId err:" + JSON.stringify(err));
console.debug("====>queryDistributedVirtualDeviceId deviceId:" + id); console.debug("====>queryDistributedVirtualDeviceId deviceId:" + id);
expect(err).assertEqual(null); expect(err).assertEqual(null);
expect(id).assertEqual(deviceId); expect(id !== 'ohosAnonymousUid').assertTrue()
console.debug("====>ActsOsAccountDeviceId_0100 end===="); console.debug("====>ActsOsAccountDeviceId_0100 end====");
done(); done();
}) })
...@@ -62,7 +61,6 @@ export default function ActsOsAccountThirdPartyTest_third_3() { ...@@ -62,7 +61,6 @@ export default function ActsOsAccountThirdPartyTest_third_3() {
console.debug("====>ActsOsAccountDeviceId_0200 start===="); console.debug("====>ActsOsAccountDeviceId_0200 start====");
var AccountManager = osAccount.getAccountManager(); var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish===="); console.debug("====>get os AccountManager finish====");
const deviceId = '5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5';
const accountAbility = distributedAccount.getDistributedAccountAbility(); const accountAbility = distributedAccount.getDistributedAccountAbility();
accountAbility.updateOsAccountDistributedInfo( accountAbility.updateOsAccountDistributedInfo(
{ {
...@@ -74,7 +72,7 @@ export default function ActsOsAccountThirdPartyTest_third_3() { ...@@ -74,7 +72,7 @@ export default function ActsOsAccountThirdPartyTest_third_3() {
console.debug("====>queryDistributedVirtualDeviceId start===="); console.debug("====>queryDistributedVirtualDeviceId start====");
var id = await AccountManager.queryDistributedVirtualDeviceId(); var id = await AccountManager.queryDistributedVirtualDeviceId();
console.debug("====>queryDistributedVirtualDeviceId:" + id); console.debug("====>queryDistributedVirtualDeviceId:" + id);
expect(id).assertEqual(deviceId); expect(id !== 'ohosAnonymousUid').assertTrue()
console.debug("====>ActsOsAccountDeviceId_0200 end===="); console.debug("====>ActsOsAccountDeviceId_0200 end====");
done(); done();
}) })
......
...@@ -29,7 +29,6 @@ export default function ActsOsAccountThirdPartyTest_third_1() { ...@@ -29,7 +29,6 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
console.debug("====>ActsOsAccountDeviceId_0100 start===="); console.debug("====>ActsOsAccountDeviceId_0100 start====");
var AccountManager = osAccount.getAccountManager(); var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish===="); console.debug("====>get os AccountManager finish====");
const deviceId = '5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5';
const accountAbility = distributedAccount.getDistributedAccountAbility(); const accountAbility = distributedAccount.getDistributedAccountAbility();
accountAbility.updateOsAccountDistributedInfo( accountAbility.updateOsAccountDistributedInfo(
{ {
...@@ -42,7 +41,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() { ...@@ -42,7 +41,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
console.debug("====>getDistributedVirtualDeviceId err:" + JSON.stringify(err)); console.debug("====>getDistributedVirtualDeviceId err:" + JSON.stringify(err));
console.debug("====>getDistributedVirtualDeviceId deviceId:" + id); console.debug("====>getDistributedVirtualDeviceId deviceId:" + id);
expect(err).assertEqual(null); expect(err).assertEqual(null);
expect(id).assertEqual(deviceId); expect(id !== 'ohosAnonymousUid').assertTrue()
console.debug("====>ActsOsAccountDeviceId_0100 end===="); console.debug("====>ActsOsAccountDeviceId_0100 end====");
done(); done();
}) })
...@@ -58,7 +57,6 @@ export default function ActsOsAccountThirdPartyTest_third_1() { ...@@ -58,7 +57,6 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
console.debug("====>ActsOsAccountDeviceId_0200 start===="); console.debug("====>ActsOsAccountDeviceId_0200 start====");
var AccountManager = osAccount.getAccountManager(); var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish===="); console.debug("====>get os AccountManager finish====");
const deviceId = '5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5';
const accountAbility = distributedAccount.getDistributedAccountAbility(); const accountAbility = distributedAccount.getDistributedAccountAbility();
accountAbility.updateOsAccountDistributedInfo( accountAbility.updateOsAccountDistributedInfo(
{ {
...@@ -70,7 +68,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() { ...@@ -70,7 +68,7 @@ export default function ActsOsAccountThirdPartyTest_third_1() {
console.debug("====>getDistributedVirtualDeviceId start===="); console.debug("====>getDistributedVirtualDeviceId start====");
var id = await AccountManager.getDistributedVirtualDeviceId(); var id = await AccountManager.getDistributedVirtualDeviceId();
console.debug("====>getDistributedVirtualDeviceId:" + id); console.debug("====>getDistributedVirtualDeviceId:" + id);
expect(id).assertEqual(deviceId); expect(id !== 'ohosAnonymousUid').assertTrue()
console.debug("====>ActsOsAccountDeviceId_0200 end===="); console.debug("====>ActsOsAccountDeviceId_0200 end====");
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册