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

!8425 【挑单】【应用账号】取消accountName空格字符限制,xts适配

Merge pull request !8425 from lichenchen/cherry-pick-1681265598
...@@ -339,13 +339,18 @@ export default function ActsAccountCreateAccount() { ...@@ -339,13 +339,18 @@ export default function ActsAccountCreateAccount() {
console.debug("====>ActsAccountCreateAccount_1500 start===="); console.debug("====>ActsAccountCreateAccount_1500 start====");
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
var specialStr = " "; var specialStr = " ";
try{ try {
appAccountManager.createAccount(specialStr, createAccountOptions, (err)=>{ appAccountManager.createAccount(specialStr, createAccountOptions, (err)=>{
expect(err.code == 12300002).assertEqual(true); console.error("====>createAccount ActsAccountCreateAccount_1500 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
console.debug("====>ActsAccountCreateAccount_1500 end===="); console.debug("====>ActsAccountCreateAccount_1500 end====");
done(); appAccountManager.removeAccount(" ", (err)=>{
console.error("====>removeAccount ActsAccountCreateAccount_1500 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
done();
});
}); });
}catch(err){ } catch (err) {
expect().assertFail(); expect().assertFail();
done(); done();
} }
...@@ -360,14 +365,13 @@ export default function ActsAccountCreateAccount() { ...@@ -360,14 +365,13 @@ export default function ActsAccountCreateAccount() {
console.debug("====>ActsAccountCreateAccount_1600 start===="); console.debug("====>ActsAccountCreateAccount_1600 start====");
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
var specialStr = " "; var specialStr = " ";
try{ try {
await appAccountManager.createAccount(specialStr, createAccountOptions); await appAccountManager.createAccount(specialStr, createAccountOptions);
expect().assertFail(); await appAccountManager.removeAccount(specialStr);
done(); done();
} } catch (err) {
catch(err){ console.debug("====>createAccount ActsAccountCreateAccount_1600 err:" + JSON.stringify(err));
console.debug("====>add Account ActsAccountCreateAccount_1600 err:" + JSON.stringify(err)); expect().assertFail();
expect(err.code == 12300002).assertEqual(true);
console.debug("====>ActsAccountCreateAccount_1600 end===="); console.debug("====>ActsAccountCreateAccount_1600 end====");
done(); done();
} }
......
...@@ -1087,18 +1087,21 @@ export default function ActsAccountCustomData() { ...@@ -1087,18 +1087,21 @@ export default function ActsAccountCustomData() {
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
console.debug("====>creat finish===="); console.debug("====>creat finish====");
appAccountManager.createAccount(" ", (err)=>{ appAccountManager.createAccount(" ", (err)=>{
console.debug("====>add account ActsAccountCustomData_2900 err:" + JSON.stringify(err)); console.debug("====>createAccount ActsAccountCustomData_2900 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true); expect(err).assertEqual(null);
appAccountManager.setCustomData(" ", "key29", "value29", (err)=>{ appAccountManager.setCustomData(" ", "key29", "value29", (err)=>{
console.debug("====>setCustomData ActsAccountCustomData_2900 err:" + JSON.stringify(err)); console.debug("====>setCustomData ActsAccountCustomData_2900 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true); expect(err).assertEqual(null);
appAccountManager.getCustomData(" ", "key29", (err, data)=>{ appAccountManager.getCustomData(" ", "key29", (err, data)=>{
console.debug("====>getCustomData 2900 err:" + JSON.stringify(err)); console.debug("====>getCustomData 2900 err:" + JSON.stringify(err));
console.debug("====>getCustomData 2900 data:" + JSON.stringify(data)); console.debug("====>getCustomData 2900 data:" + JSON.stringify(data));
expect(err.code != 0).assertEqual(true); expect(err).assertEqual(null);
expect(data).assertEqual(null); expect(data).assertEqual("value29");
console.debug("====>ActsAccountCustomData_2900 end===="); appAccountManager.removeAccount(" ", (err)=>{
done(); console.error("====>removeAccount ActsAccountCustomData_2900 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
done();
});
}); });
}); });
}); });
...@@ -1113,28 +1116,18 @@ export default function ActsAccountCustomData() { ...@@ -1113,28 +1116,18 @@ export default function ActsAccountCustomData() {
console.debug("====>ActsAccountCustomData_3000 start===="); console.debug("====>ActsAccountCustomData_3000 start====");
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
console.debug("====>creat finish===="); console.debug("====>creat finish====");
try{ try {
await appAccountManager.createAccount(" "); await appAccountManager.createAccount(" ");
} await appAccountManager.setCustomData(" ", "key30", "value30");
catch(err){ var data = await appAccountManager.getCustomData(" ", "key30");
console.debug("====>add account ActsAccountCustomData_3000 err:" + JSON.stringify(err)); console.error("====>getCustomData ActsAccountCustomData_3000 data:" + JSON.stringify(data));
expect(err.code != 0).assertEqual(true); expect(data).assertEqual("value30");
try{ await appAccountManager.removeAccount(" ");
await appAccountManager.setCustomData(" ", "key30", "value30"); done();
} } catch (err) {
catch(err){ console.error("====>ActsAccountCustomData_3000 fail err:" + JSON.stringify(err));
console.error("====>setCustomData ActsAccountCustomData_3000 err:" + JSON.stringify(err)); expect().assertFail();
expect(err.code != 0).assertEqual(true); done();
try{
await appAccountManager.getCustomData(" ", "key30");
}
catch(err){
console.error("====>getCustomData ActsAccountCustomData_3000 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
console.debug("====>ActsAccountCustomData_3000 end====");
done();
}
}
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册