提交 1d0a11a0 编写于 作者: G gaoxi785

Add xts case to query distributed id

Signed-off-by: Ngaoxi785 <gaoxi785@huawei.com>
上级 5b8e55d0
......@@ -23,6 +23,19 @@
"moduleName": "entry",
"moduleType": "entry"
},
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS"
}
],
"reqPermissions": [
{
"name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS",
"reason": "ceshi"
}
],
"abilities": [
{
"visible": true,
......
......@@ -22,6 +22,34 @@ describe('AccountTest', function () {
})
afterEach(function () {
})
/**
* @tc.number ActsDistributedAccountDeviceId_0100
* @tc.name Test query the distribruted id by callback.
* @tc.desc Test distributedAccount.queryOsAccountDistributedInfo API functionality by callback.
*/
it('ActsDistributedAccountDeviceId_0100', 0, async function(done){
console.log("test query distribtued id start");
const distributedId = '169C610CEF7F8310D78763C7DD8D28F0668D9FB8B1A3659CEF8F6BC3D9B39E17';
const accountAbility = account.getDistributedAccountAbility();
accountAbility.updateOsAccountDistributedInfo(
{
name: 'ZhangSan',
id: '12345',
event: "Ohos.account.event.LOGIN"
}, (err)=>{
console.log("update distributedInfo err:" + JSON.stringify(err));
accountAbility.queryOsAccountDistributedInfo((err, distributedInfo)=>{
console.log("query distributedInfo err:" + JSON.stringify(err));
console.log("query distributedInfo:" + JSON.stringify(distributedInfo));
expect(distributedInfo.name).assertEqual('ZhangSan');
expect(distributedInfo.id).assertEqual(distributedId);
console.log("test query distribtued id end");
done();
})
})
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0100
* @tc.name Test distributedAccount.getDistributedAccountAbility.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册