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

!4994 【OpenHarmony3.1Release】【账号】错误返回值undefined改为null,硬编码问题整改

Merge pull request !4994 from 何海涛/0816UndefinedToNull
......@@ -30,10 +30,10 @@ describe('ActsAccountAddAccount', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_callback_first", (err)=>{
console.debug("====>add account ActsAccountAddAccount_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("account_name_callback_first", (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_0100 end====");
done();
});
......@@ -75,10 +75,10 @@ describe('ActsAccountAddAccount', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_callback_second", "account_extraInfo_callback_second", (err)=>{
console.debug("====>add account ActsAccountAddAccount_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("account_name_callback_second", (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_0300 end====");
done();
});
......@@ -120,13 +120,13 @@ describe('ActsAccountAddAccount', function () {
var appAccountManager = account.createAppAccountManager();
appAccountManager.addAccount("account_name_callback_third", "account_extraInfo_callback_third", (err)=>{
console.debug("====>add account first time ActsAccountAddAccount_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.addAccount("account_name_callback_third", "account_extraInfo_callback_third", (err)=>{
console.debug("====>add account second time ActsAccountAddAccount_0500 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("account_name_callback_third", (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_0500 end====");
done();
});
......@@ -291,10 +291,10 @@ describe('ActsAccountAddAccount', function () {
var appAccountManager = account.createAppAccountManager();
appAccountManager.addAccount("account_name_callback_seventh", "", (err)=>{
console.debug("====>add account ActsAccountAddAccount_1300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("account_name_callback_seventh", (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_1300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_1300 end====");
done();
});
......@@ -372,10 +372,10 @@ describe('ActsAccountAddAccount', function () {
var specialStr = "#@$%^&*()_+!<>~?,./[]abcdefgABCDEFG1234567890";
appAccountManager.addAccount(specialStr, "account_extraInfo_callback_ninth", (err)=>{
console.debug("====>add account ActsAccountAddAccount_1700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount(specialStr, (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_1700 err" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_1700 end====");
done();
});
......@@ -417,10 +417,10 @@ describe('ActsAccountAddAccount', function () {
var specialStr = " ";
appAccountManager.addAccount("account_name_callback_tenth", specialStr, (err)=>{
console.debug("====>add account ActsAccountAddAccount_1900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("account_name_callback_tenth", (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_1900 err" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_1900 end====");
done();
});
......@@ -462,10 +462,10 @@ describe('ActsAccountAddAccount', function () {
var specialStr = "#@$%^&*()_+!<>~?,./[]abcdefgABCDEFG1234567890";
appAccountManager.addAccount("account_extraInfo_callback_eleventh", specialStr, (err)=>{
console.debug("====>add account ActsAccountAddAccount_2100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("account_extraInfo_callback_eleventh", (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_2100 err" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_2100 end====");
done();
});
......@@ -506,13 +506,13 @@ describe('ActsAccountAddAccount', function () {
var appAccountManager = account.createAppAccountManager();
appAccountManager.addAccount("account_name_callback_same", "account_extraInfo_callback", (err)=>{
console.debug("====>add account first time ActsAccountAddAccount_2300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.addAccount("account_name_callback_same", "account_extraInfo_callback_different", (err)=>{
console.debug("====>add account second time ActsAccountAddAccount_2300 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("account_name_callback_same", (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_2300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_2300 end====");
done();
});
......@@ -557,10 +557,10 @@ describe('ActsAccountAddAccount', function () {
var appAccountManager = account.createAppAccountManager();
appAccountManager.addAccount(limitName, "account_extraInfo_callback", (err)=>{
console.debug("====>add account ActsAccountAddAccount_2500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount(limitName, (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_2500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_2500 end====");
done();
});
......@@ -608,10 +608,10 @@ describe('ActsAccountAddAccount', function () {
var appAccountManager = account.createAppAccountManager();
appAccountManager.addAccount("account_extra_callback_limit", limitExtra, (err)=>{
console.debug("====>add account ActsAccountAddAccount_2700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("account_extra_callback_limit", (err)=>{
console.debug("====>delete Account ActsAccountAddAccount_2700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAddAccount_2700 end====");
done();
});
......
......@@ -53,13 +53,13 @@ describe('ActsAccountAppAccess', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("AppAccess_callback_itself", "extrainfo_callback_itself", (err)=>{
console.debug("====>add account ActsAccountAppAccess_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.enableAppAccess("AppAccess_callback_itself", "com.example.actsaccountappaccess", (err)=>{
console.debug("====>enableAppAccess err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("AppAccess_callback_itself", (err)=>{
console.debug("====>delete Account ActsAccountAppAccess_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAppAccess_0100 end====");
done();
});
......@@ -104,13 +104,13 @@ describe('ActsAccountAppAccess', function () {
var nonExistBundle = "com.example.NonExistentBundleCallback";
appAccountManager.addAccount("AppAccess_callback_NotExistBundle", "extrainfo_callback_NotExistBundle", (err)=>{
console.debug("====>add account ActsAccountAppAccess_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.enableAppAccess("AppAccess_callback_NotExistBundle", nonExistBundle, (err)=>{
console.debug("====>enableAppAccess 0300 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("AppAccess_callback_NotExistBundle", (err)=>{
console.debug("====>delete Account ActsAccountAppAccess_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAppAccess_0300 end====");
done();
});
......@@ -198,16 +198,16 @@ describe('ActsAccountAppAccess', function () {
var enableBundle = "com.example.actsaccountsceneappaccess";
appAccountManager.addAccount("AppAccess_callback_account", (err)=>{
console.debug("====>add account ActsAccountAppAccess_0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.enableAppAccess("AppAccess_callback_account", enableBundle, (err)=>{
console.debug("====>enableAppAccess 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.disableAppAccess("AppAccess_callback_account", enableBundle, (err)=>{
console.debug("====>disableAppAccess 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined)
expect(err).assertEqual(null)
appAccountManager.deleteAccount("AppAccess_callback_account", (err)=>{
console.debug("====>delete Account ActsAccountAppAccess_0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAppAccess_0700 end====");
done();
});
......@@ -315,13 +315,13 @@ describe('ActsAccountAppAccess', function () {
}
appAccountManager.addAccount("AppAccess_callback_bigBundleName", (err)=>{
console.debug("====>add account ActsAccountAppAccess_1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.enableAppAccess("AppAccess_callback_bigBundleName", bigBundleName, (err)=>{
console.debug("====>enableAppAccess 1100 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("AppAccess_callback_bigBundleName", (err)=>{
console.debug("====>delete Account ActsAccountAppAccess_1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAppAccess_1100 end====");
done();
});
......@@ -370,13 +370,13 @@ describe('ActsAccountAppAccess', function () {
var emptyBundleName = '';
appAccountManager.addAccount("AppAccess_callback_emptyBundleName", (err)=>{
console.debug("====>add account ActsAccountAppAccess_1300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.enableAppAccess("AppAccess_callback_emptyBundleName", emptyBundleName, (err)=>{
console.debug("====>enableAppAccess 1300 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("AppAccess_callback_emptyBundleName", (err)=>{
console.debug("====>delete Account ActsAccountAppAccess_1300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAppAccess_1300 end====");
done();
});
......@@ -422,12 +422,12 @@ describe('ActsAccountAppAccess', function () {
var enableBundle = "com.example.actsaccountsceneappaccess";
appAccountManager.addAccount("AppAccess_callback_account", (err)=>{
console.debug("====>add account ActsAccountAppAccess_1500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.disableAppAccess("AppAccess_callback_account", enableBundle, (err)=>{
expect(err.code != 0).assertEqual(true)
appAccountManager.deleteAccount("AppAccess_callback_account", (err)=>{
console.debug("====>delete Account ActsAccountAppAccess_1500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAppAccess_1500 end====");
done();
});
......@@ -479,12 +479,12 @@ describe('ActsAccountAppAccess', function () {
var notExistBundle = "com.example.actsaccountnotexistbundle";
appAccountManager.addAccount("AppAccess_callback_notExistBundle", (err)=>{
console.debug("====>add account ActsAccountAppAccess_1700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.disableAppAccess("AppAccess_callback_notExistBundle", notExistBundle, (err)=>{
expect(err.code != 0).assertEqual(true)
appAccountManager.deleteAccount("AppAccess_callback_notExistBundle", (err)=>{
console.debug("====>delete Account ActsAccountAppAccess_1700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountAppAccess_1700 end====");
done();
});
......
......@@ -47,10 +47,10 @@ describe('ActsCreatAppAccountManager', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("creatappaccount_name_first", (err)=>{
console.debug("====>add account ActsCreatAppAccountManager_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManagerTwo.deleteAccount("creatappaccount_name_first", (err)=>{
console.debug("====>delete Account ActsCreatAppAccountManager_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsCreatAppAccountManager_0100 end====");
done();
});
......@@ -71,18 +71,18 @@ describe('ActsCreatAppAccountManager', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("creatappaccount_name_second", (err)=>{
console.debug("====>add account ActsCreatAppAccountManager_0200 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManagerTwo.setAccountExtraInfo("creatappaccount_name_second", "creatappaccount_extra", (err)=>{
console.debug("====>setAccountExtraInfo err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountExtraInfo("creatappaccount_name_second", (err, data)=>{
console.debug("====>getAccountExtraInfo err:" + JSON.stringify(err));
console.debug("====>getAccountExtraInfo data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual("creatappaccount_extra");
appAccountManagerTwo.deleteAccount("creatappaccount_name_second", (err)=>{
console.debug("====>delete Account err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsCreatAppAccountManager_0200 end====");
done();
});
......
......@@ -75,18 +75,18 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_0100", (err)=>{
console.debug("====>add account ActsAccountCredential_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential("account_name_0100", "credentialType1", "credential1",(err)=>{
console.debug("====>ActsAccountCredential_0100 setAccountCredential:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountCredential("account_name_0100", "credentialType1", (err,data)=>{
console.debug("====>getAccountCredential 0100 err:" + JSON.stringify(err));
console.debug("====>getAccountCredential 0100 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual("credential1");
appAccountManager.deleteAccount("account_name_0100", (err)=>{
console.debug("====>delete Account 0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_0100 end====");
done();
});
......@@ -146,21 +146,21 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_0300",(err)=>{
console.debug("====>add account ActsAccountCredential_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential("account_name_0300", "credentialType3", "credential3",(err)=>{
console.debug("====>setAccountCredential first time 0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential("account_name_0300", "credentialType3", "newcredential3",(err)=>{
console.debug("====>setAccountCredential second time 0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountCredential("account_name_0300", "credentialType3", (err, data)=>{
console.debug("====>getAccountCredential 0300 err:" + JSON.stringify(err));
console.debug("====>getAccountCredential 0300 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual("newcredential3");
appAccountManager.deleteAccount("account_name_0300", (err)=>{
console.debug("====>delete Account 0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_0300 end====");
done();
});
......@@ -219,18 +219,18 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_0500",(err)=>{
console.debug("====>add account ActsAccountCredential_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential("account_name_0500", "credentialType5", "", (err)=>{
console.debug("====>setAccountCredential ActsAccountCredential_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountCredential("account_name_0500", "credentialType5", (err,data)=>{
console.debug("====>getAccountCredential ActsAccountCredential_0500 err:" + JSON.stringify(err));
console.debug("====>getAccountCredential ActsAccountCredential_0500 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual("");
appAccountManager.deleteAccount("account_name_0500", (err)=>{
console.debug("====>delete Account ActsAccountCredential_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_0500 end====");
done();
});
......@@ -273,13 +273,13 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_0700", (err)=>{
console.debug("====>add account ActsAccountCredential_0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential("account_name_0700", "", "credential7", (err)=>{
console.debug("====>setAccountCredential ActsAccountCredential_0700 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("account_name_0700", (err)=>{
console.debug("====>delete Account ActsAccountCredential_0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_0700 end====");
done();
});
......@@ -322,13 +322,13 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_0900", (err)=>{
console.debug("====>add account ActsAccountCredential_0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountCredential("account_name_0900", "", (err)=>{
console.debug("====>getAccountCredential ActsAccountCredential_0900 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("account_name_0900", (err)=>{
console.debug("====>delete Account ActsAccountCredential_0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_0900 end====");
done();
});
......@@ -372,18 +372,18 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_1100",(err)=>{
console.debug("====>add account ActsAccountCredential_1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential("account_name_1100", " ", "credential11",(err)=>{
console.debug("====>setAccountCredential ActsAccountCredential_1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountCredential("account_name_1100", " ", (err, data)=>{
console.debug("====>getAccountCredential 1100 err:" + JSON.stringify(err));
console.debug("====>getAccountCredential 1100 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual("credential11");
appAccountManager.deleteAccount("account_name_1100", (err)=>{
console.debug("====>delete Account 1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_1100 end====");
done();
});
......@@ -427,13 +427,13 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_1300",(err)=>{
console.debug("====>add account ActsAccountCredential_1300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential("", "credentialType13", "credential13", (err)=>{
console.debug("====>setAccountCredential ActsAccountCredential_1300 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("account_name_1300", (err)=>{
console.debug("====>delete Account ActsAccountCredential_1300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_1300 end====");
done();
});
......@@ -476,13 +476,13 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_1500", (err)=>{
console.debug("====>add account ActsAccountCredential_1500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountCredential("account_name_1500", "credentialType15", (err)=>{
console.debug("====>getAccountCredential ActsAccountCredential_1500 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("account_name_1500", (err)=>{
console.debug("====>delete Account ActsAccountCredential_1500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_1500 end====");
done();
});
......@@ -528,7 +528,7 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_1700", (err)=>{
console.debug("====>add account ActsAccountCredential_1700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential("account_name_1700", "credentialType17", CREDENTIALOVERSIZE, (err)=>{
console.debug("====>CREDENTIALOVERSIZE.length:" + JSON.stringify(CREDENTIALOVERSIZE.length));
expect(CREDENTIALOVERSIZE.length).assertEqual(1025);
......@@ -536,7 +536,7 @@ describe('ActsAccountCredential', function () {
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("account_name_1700", (err)=>{
console.debug("====>delete Account ActsAccountCredential_1700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_1700 end====");
done();
});
......@@ -587,7 +587,7 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_1900", (err)=>{
console.debug("====>add account ActsAccountCredential_1900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential("account_name_1900", CREDENTIALTYPEOVERSIZE, "credential19", (err)=>{
console.debug("====>CREDENTIALTYPEOVERSIZE.length:" + JSON.stringify(CREDENTIALTYPEOVERSIZE.length));
expect(CREDENTIALTYPEOVERSIZE.length).assertEqual(1025);
......@@ -595,7 +595,7 @@ describe('ActsAccountCredential', function () {
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("account_name_1900", (err)=>{
console.debug("====>delete Account ActsAccountCredential_1900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountCredential_1900 end====");
done();
});
......@@ -646,14 +646,14 @@ describe('ActsAccountCredential', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_2100", (err)=>{
console.debug("====>add account ActsAccountCredential_2100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountCredential(NAMEOVERSIZE, "credentialType21", "credential21", (err)=>{
console.debug("====>setAccountCredential ActsAccountCredential_2100 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
appAccountManager.deleteAccount("account_name_2100", (err)=>{
console.debug("====>delete Account ActsAccountCredential_2100 err:" + JSON.stringify(err));
console.debug("====>ActsAccountCredential_2100 end====");
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
done();
});
});
......
......@@ -46,10 +46,10 @@ describe('ActsAccountDeleteAccount', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("deleteAccount_name_callback_first", "extraInfo_callback_first", (err)=>{
console.debug("====>add account ActsAccountDeleteAccount_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("deleteAccount_name_callback_first", (err)=>{
console.debug("====>delete Account ActsAccountDeleteAccount_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountDeleteAccount_0100 end====");
done();
});
......@@ -124,10 +124,10 @@ describe('ActsAccountDeleteAccount', function () {
var appAccountManager = account.createAppAccountManager();
appAccountManager.addAccount("deleteAccount_name_callback_third", "extraInfo_callback_third", (err)=>{
console.debug("====>add account ActsAccountDeleteAccount_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("deleteAccount_name_callback_third", (err)=>{
console.debug("====>delete account first time err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("deleteAccount_name_callback_third", (err)=>{
console.debug("====>delete Account second time err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true);
......
......@@ -53,15 +53,15 @@ describe('ActsAccountSetGetExtraInfo', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_callback_first", extraInfoStr, (err)=>{
console.debug("====>add account ActsAccountSetGetExtraInfo_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountExtraInfo("account_name_callback_first", (err, data)=>{
console.debug("====>getAccountExtraInfo 0100 err:" + JSON.stringify(err));
console.debug("====>getAccountExtraInfo 0100 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(extraInfoStr);
appAccountManager.deleteAccount("account_name_callback_first", (err)=>{
console.debug("====>delete Account 0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountSetGetExtraInfo_0100 end====");
done();
});
......@@ -150,10 +150,10 @@ describe('ActsAccountSetGetExtraInfo', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_callback_third", "account_extrainfo_callback_third", (err)=>{
console.debug("====>add account ActsAccountSetGetExtraInfo_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("account_name_callback_third", (err)=>{
console.debug("====>delete Account 0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountExtraInfo("account_name_callback_third", (err, data)=>{
console.debug("====>getAccountExtraInfo 0500 err:" + JSON.stringify(err));
console.debug("====>getAccountExtraInfo 0500 data:" + JSON.stringify(data));
......@@ -203,15 +203,15 @@ describe('ActsAccountSetGetExtraInfo', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_callback_fourth", (err)=>{
console.debug("====>add account ActsAccountSetGetExtraInfo_0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountExtraInfo("account_name_callback_fourth", (err, data)=>{
console.debug("====>getAccountExtraInfo 0700 err:" + JSON.stringify(err));
console.debug("====>getAccountExtraInfo 0700 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual("");
appAccountManager.deleteAccount("account_name_callback_fourth", (err)=>{
console.debug("====>delete Account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountSetGetExtraInfo_0700 end====");
done();
});
......@@ -300,18 +300,18 @@ describe('ActsAccountSetGetExtraInfo', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_callback_sixth", "account_extrainfo_callback_sixth",(err)=>{
console.debug("====>add account ActsAccountSetGetExtraInfo_1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountExtraInfo("account_name_callback_sixth", "account_extra_sixth_twice", (err)=>{
console.debug("====>setAccountExtraInfo 1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountExtraInfo("account_name_callback_sixth", (err, data)=>{
console.debug("====>getAccountExtraInfo 1100 err:" + JSON.stringify(err));
console.debug("====>getAccountExtraInfo 1100 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual("account_extra_sixth_twice");
appAccountManager.deleteAccount("account_name_callback_sixth", (err)=>{
console.debug("====>delete Account 1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountSetGetExtraInfo_1100 end====");
done();
});
......@@ -360,17 +360,17 @@ describe('ActsAccountSetGetExtraInfo', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_callback_seventh",(err)=>{
console.debug("====>add account ActsAccountSetGetExtraInfo_1300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountExtraInfo("account_name_callback_seventh", "callback_seventh", (err)=>{
console.debug("====>setAccountExtraInfo 1300 first time err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountExtraInfo("account_name_callback_seventh", "call_seventh_twice", (err)=>{
console.debug("====>setAccountExtraInfo 1300 second time err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountExtraInfo("account_name_callback_seventh", (err, data)=>{
console.debug("====>getAccountExtraInfo 1300 err:" + JSON.stringify(err));
console.debug("====>getAccountExtraInfo 1300 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual("call_seventh_twice");
appAccountManager.deleteAccount("account_name_callback_seventh", (err)=>{
console.debug("====>delete Account 1300 err:" + JSON.stringify(err));
......@@ -436,17 +436,17 @@ describe('ActsAccountSetGetExtraInfo', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("account_name_callback_eighth",(err)=>{
console.debug("====>add account ActsAccountSetGetExtraInfo_1500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountExtraInfo("account_name_callback_eighth", "extra_callback_eighth", (err)=>{
console.debug("====>setAccountExtraInfo second time err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAccountExtraInfo("account_name_callback_eighth", "extra_callback_eighth", (err)=>{
console.debug("====>setAccountExtraInfo 1500 first time err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAccountExtraInfo("account_name_callback_eighth", (err, data)=>{
console.debug("====>getAccountExtraInfo 1500 err:" + JSON.stringify(err));
console.debug("====>getAccountExtraInfo 1500 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual("extra_callback_eighth");
appAccountManager.deleteAccount("account_name_callback_eighth", (err)=>{
console.debug("====>delete Account 1500 err:" + JSON.stringify(err));
......
......@@ -45,13 +45,13 @@ describe('ActsAccountNoPermission', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("syncenable_callback_setnopermission", (err)=>{
console.debug("====>add account ActsAccountNoPermission_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAppAccountSyncEnable("syncenable_callback_setnopermission", true, (err)=>{
console.debug("====>setAppAccountSyncEnable 0100 err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED);
appAccountManager.deleteAccount("syncenable_callback_setnopermission", (err)=>{
console.debug("====>delete Account ActsAccountNoPermission_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountNoPermission_0100 end====");
done();
});
......@@ -95,13 +95,13 @@ describe('ActsAccountNoPermission', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("syncenable_callback_checknopermission", (err)=>{
console.debug("====>add account ActsAccountNoPermission_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.checkAppAccountSyncEnable("syncenable_callback_checknopermission", (err, data)=>{
console.debug("====>checkAppAccountSyncEnable 0300 err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED);
appAccountManager.deleteAccount("syncenable_callback_checknopermission", (err)=>{
console.debug("====>delete Account ActsAccountNoPermission_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountNoPermission_0300 end====");
done();
});
......@@ -144,13 +144,13 @@ describe('ActsAccountNoPermission', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("accessibleAccount_callback_nopermission", (err)=>{
console.debug("====> add account ActsAccountNoPermission_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccessibleAccounts((err, data)=>{
console.debug("====>getAllAccessibleAccounts 0500 err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED);
appAccountManager.deleteAccount("accessibleAccount_callback_nopermission", (err)=>{
console.debug("====>delete Account ActsAccountNoPermission_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountNoPermission_0500 end====");
done();
})
......@@ -194,13 +194,13 @@ describe('ActsAccountNoPermission', function () {
var selfBundle = "com.example.actsaccounttest";
appAccountManager.addAccount("getAll_callback_nopermission", (err)=>{
console.debug("====>add account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("====>getAllAccounts 0700 err:" + JSON.stringify(err));
expect(err.code).assertEqual(ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED);
appAccountManager.deleteAccount("getAll_callback_nopermission", (err)=>{
console.debug("====>delete account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountNoPermission_0700 end====");
done();
});
......
......@@ -67,12 +67,12 @@ describe('ActsAccountChangeOnOff', async function () {
}
function deleteAccountCallback(err){
console.debug("====>delete account 0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
done();
}
function disCallback(err){
console.debug("====>delete account 0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("changeonoff_extra", deleteAccountCallback);
}
function subscriberCallback(err, data){
......@@ -135,7 +135,7 @@ describe('ActsAccountChangeOnOff', async function () {
}
function deleteAccountCallback(err){
console.debug("====>delete account 0200 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
done();
}
function subscriberCallback(err, data){
......@@ -198,7 +198,7 @@ describe('ActsAccountChangeOnOff', async function () {
}
function deleteAccountCallback(err){
console.debug("====>delete account 0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
done();
}
function subscriberCallback(err, data){
......@@ -265,7 +265,7 @@ describe('ActsAccountChangeOnOff', async function () {
}
function deleteAccountCallback(err){
console.debug("====>delete account 0400 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
done();
}
function subscriberCallback(err, data){
......@@ -325,14 +325,13 @@ describe('ActsAccountChangeOnOff', async function () {
await appAccountManager.enableAppAccess("onoff_delete", "com.example.actsaccountsceneonoff");
function unSubscriberCallback(err){
console.debug("====>unsubscribe 0500 err:" + JSON.stringify(err));
expect(err.code==0).assertEqual(true);
done();
}
function subscriberCallback(err, data){
console.debug("====>subscriberCallback 0500 data:" + JSON.stringify(data));
expect(data.event).assertEqual("account_on_change_delete");
expect(data.data).assertEqual("SUCCESS");
commonevent.unsubscribe(subscriber, unSubscriberCallback);
done();
}
function publishCallback(err){
console.debug("====>publish call back err:" + JSON.stringify(err));
......@@ -391,10 +390,10 @@ describe('ActsAccountChangeOnOff', async function () {
}
function deleteAccountCallback(err){
console.debug("====>delete first account 0600 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("onoff_enableSec", (err)=>{
console.debug("====>delete second account 0600 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
done();
});
}
......@@ -458,7 +457,7 @@ describe('ActsAccountChangeOnOff', async function () {
}
function deleteAccountCallback(err){
console.debug("====>delete account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
done();
}
function subscriberCallback(err, data){
......@@ -531,7 +530,7 @@ describe('ActsAccountChangeOnOff', async function () {
console.debug("====>off ActsAccountChangeOnOff_0800 finish====");
appAccountManager.deleteAccount("onoff_self", (err)=>{
console.debug("====>delete account ActsAccountChangeOnOff_0800 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountChangeOnOff_0800 end====");
done();
});
......@@ -594,10 +593,10 @@ describe('ActsAccountChangeOnOff', async function () {
console.debug("====>off ActsAccountChangeOnOff_0900 finish====");
appAccountManager.deleteAccount("onoff_self_first", (err)=>{
console.debug("====>delete first account 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("onoff_self_second", (err)=>{
console.debug("====>delete second account 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountChangeOnOff_0900 end====");
done();
});
......@@ -671,7 +670,7 @@ describe('ActsAccountChangeOnOff', async function () {
console.debug("====>off ActsAccountChangeOnOff_1000 finish====");
appAccountManager.deleteAccount("onoff_twice", (err)=>{
console.debug("====>delete account ActsAccountChangeOnOff_1000 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(twiceSign).assertEqual(2);
console.debug("====>ActsAccountChangeOnOff_1000 end====");
done();
......@@ -752,7 +751,7 @@ describe('ActsAccountChangeOnOff', async function () {
console.debug("====>off ActsAccountChangeOnOff_1100 finish====");
appAccountManager.deleteAccount("onoff_same", (err)=>{
console.debug("====>delete account ActsAccountChangeOnOff_1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountChangeOnOff_1100 end====");
done();
});
......@@ -793,7 +792,7 @@ describe('ActsAccountChangeOnOff', async function () {
console.debug("====>delete account 1200 start====");
appAccountManager.deleteAccount("onoff_repeatoff", (err)=>{
console.debug("====>delete account ActsAccountChangeOnOff_1200 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountChangeOnOff_1200 end====");
done();
});
......@@ -860,7 +859,7 @@ describe('ActsAccountChangeOnOff', async function () {
console.debug("====>delete account 1300 start====");
appAccountManager.deleteAccount("onoff_same", (err)=>{
console.debug("====>delete account ActsAccountChangeOnOff_1300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountChangeOnOff_1300 end====");
done();
});
......@@ -907,7 +906,7 @@ describe('ActsAccountChangeOnOff', async function () {
console.debug("====>delete account 1400 start====");
appAccountManager.deleteAccount("onoff_same", (err)=>{
console.debug("====>delete account ActsAccountChangeOnOff_1400 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsAccountChangeOnOff_1400 end====");
done();
});
......
......@@ -32,11 +32,11 @@ describe('ActsGetAllAccounts', function () {
var selfBundle = "com.example.actsgetallaaccounts";
appAccountManager.addAccount("Account_this_application_callback", (err)=>{
console.debug("====>add account 0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("====>getAllAccounts 0100 err:" + JSON.stringify(err));
console.debug("====>getAllAccounts 0100 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
try{
expect(data[0].name).assertEqual("Account_this_application_callback");
expect(data[0].owner).assertEqual("com.example.actsgetallaaccounts");
......@@ -48,7 +48,7 @@ describe('ActsGetAllAccounts', function () {
}
appAccountManager.deleteAccount("Account_this_application_callback", (err)=>{
console.debug("====>delete account 0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsGetAllAccounts_0100 end====");
done();
});
......@@ -121,7 +121,7 @@ describe('ActsGetAllAccounts', function () {
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("====>getAllAccounts 0300 err:" + JSON.stringify(err));
console.debug("====>getAllAccounts 0300 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.length).assertEqual(0);
console.debug("====>ActsGetAllAccounts_0300 end====");
done();
......@@ -275,12 +275,12 @@ describe('ActsGetAllAccounts', function () {
function getAllCallback(err, data){
console.debug("====>getAllAccounts 0900 err:" + JSON.stringify(err));
console.debug("====>getAllAccounts 0900 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data[0].name).assertEqual("Account_application_callback");
expect(data[0].owner).assertEqual("com.example.actsgetallaaccounts");
appAccountManager.deleteAccount("Account_application_callback", (err)=>{
console.debug("====>delete account 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsGetAllAccounts_0900 end====");
done();
});
......@@ -373,7 +373,7 @@ describe('ActsGetAllAccounts', function () {
function getAllCallback(err, data){
console.debug("====>getAllAccounts 1100 err:" + JSON.stringify(err));
console.debug("====>getAllAccounts 1100 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data[0].name).assertEqual("account_name_scene_single");
expect(data[0].owner).assertEqual("com.example.actsscenegetallaccounts");
console.debug("====>ActsGetAllAccounts_1100 end====");
......@@ -479,20 +479,20 @@ describe('ActsGetAllAccounts', function () {
var selfBundle = "com.example.actsgetallaaccounts";
appAccountManager.addAccount("account_callback_delete", (err)=>{
console.debug("====>add account 1500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("====>getAllAccounts 1500 err:" + JSON.stringify(err));
console.debug("====>getAllAccounts 1500 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data[0].name).assertEqual("account_callback_delete");
expect(data[0].owner).assertEqual("com.example.actsgetallaaccounts");
appAccountManager.deleteAccount("account_callback_delete", (err)=>{
console.debug("====>delete account 1500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("====>getAllAccounts 1500 err:" + JSON.stringify(err));
console.debug("====>getAllAccounts 1500 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.length).assertEqual(0);
console.debug("====>ActsGetAllAccounts_1500 end====");
done();
......@@ -569,20 +569,20 @@ describe('ActsGetAllAccounts', function () {
var selfBundle = "com.example.actsgetallaaccounts";
appAccountManager.addAccount("account_callback_additional", "account_extrainfo", (err)=>{
console.debug("====>add account 1700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("====>getAllAccounts 1700 err:" + JSON.stringify(err));
console.debug("====>getAllAccounts 1700 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data[0].name).assertEqual("account_callback_additional");
expect(data[0].owner).assertEqual("com.example.actsgetallaaccounts");
appAccountManager.deleteAccount("account_callback_additional", (err)=>{
console.debug("====>delete account 1700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
console.debug("====>getAllAccounts 1700 err:" + JSON.stringify(err));
console.debug("====>getAllAccounts 1700 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.length).assertEqual(0);
console.debug("====>ActsGetAllAccounts_1700 end====");
done();
......
......@@ -53,15 +53,15 @@ describe('ActsSetCheckSyncEnable', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("syncenable_callback_notset", (err)=>{
console.debug("====>add account ActsSetCheckSyncEnable_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.checkAppAccountSyncEnable("syncenable_callback_notset", (err, data)=>{
console.debug("====>checkAppAccountSyncEnable 0100 err:" + JSON.stringify(err));
console.debug("====>checkAppAccountSyncEnable 0100 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(false);
appAccountManager.deleteAccount("syncenable_callback_notset", (err)=>{
console.debug("====>delete Account ActsSetCheckSyncEnable_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsSetCheckSyncEnable_0100 end====");
done();
});
......@@ -122,18 +122,18 @@ describe('ActsSetCheckSyncEnable', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("syncenable_callback_settrue", (err)=>{
console.debug("====>add account ActsSetCheckSyncEnable_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAppAccountSyncEnable("syncenable_callback_settrue", true, (err)=>{
console.debug("====>setAppAccountSyncEnable 0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.checkAppAccountSyncEnable("syncenable_callback_settrue", (err, data)=>{
console.debug("====>checkAppAccountSyncEnable 0300 err:" + JSON.stringify(err));
console.debug("====>checkAppAccountSyncEnable 0300 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(true);
appAccountManager.deleteAccount("syncenable_callback_settrue", (err)=>{
console.debug("====>delete Account ActsSetCheckSyncEnable_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsSetCheckSyncEnable_0300 end====");
done();
});
......@@ -197,18 +197,18 @@ describe('ActsSetCheckSyncEnable', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("syncenable_callback_setfalse", (err)=>{
console.debug("====>add account ActsSetCheckSyncEnable_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAppAccountSyncEnable("syncenable_callback_setfalse", false, (err)=>{
console.debug("====>setAppAccountSyncEnable 0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.checkAppAccountSyncEnable("syncenable_callback_setfalse", (err, data)=>{
console.debug("====>checkAppAccountSyncEnable 0500 err:" + JSON.stringify(err));
console.debug("====>checkAppAccountSyncEnable 0500 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(false);
appAccountManager.deleteAccount("syncenable_callback_setfalse", (err)=>{
console.debug("====>delete Account ActsSetCheckSyncEnable_0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsSetCheckSyncEnable_0500 end====");
done();
});
......@@ -273,21 +273,21 @@ describe('ActsSetCheckSyncEnable', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("syncenable_callback_falsetrue", (err)=>{
console.debug("====>add account ActsSetCheckSyncEnable_0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAppAccountSyncEnable("syncenable_callback_falsetrue", false, (err)=>{
console.debug("====>setAppAccountSyncEnable first time 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAppAccountSyncEnable("syncenable_callback_falsetrue", true, (err)=>{
console.debug("====>setAppAccountSyncEnable second time 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.checkAppAccountSyncEnable("syncenable_callback_falsetrue", (err, data)=>{
console.debug("====>checkAppAccountSyncEnable 0700 err:" + JSON.stringify(err));
console.debug("====>checkAppAccountSyncEnable 0700 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(true);
appAccountManager.deleteAccount("syncenable_callback_falsetrue", (err)=>{
console.debug("====>delete Account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsSetCheckSyncEnable_0700 end====");
done();
});
......@@ -349,21 +349,21 @@ describe('ActsSetCheckSyncEnable', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("syncenable_callback_falsetrue", (err)=>{
console.debug("====>add account ActsSetCheckSyncEnable_0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAppAccountSyncEnable("syncenable_callback_falsetrue", true, (err)=>{
console.debug("====>setAppAccountSyncEnable first time 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAppAccountSyncEnable("syncenable_callback_falsetrue", false, (err)=>{
console.debug("====>setAppAccountSyncEnable second time 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.checkAppAccountSyncEnable("syncenable_callback_falsetrue", (err, data)=>{
console.debug("====>checkAppAccountSyncEnable 0900 err:" + JSON.stringify(err));
console.debug("====>checkAppAccountSyncEnable 0900 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(false);
appAccountManager.deleteAccount("syncenable_callback_falsetrue", (err)=>{
console.debug("====>delete Account 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsSetCheckSyncEnable_0900 end====");
done();
});
......@@ -425,21 +425,21 @@ describe('ActsSetCheckSyncEnable', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("syncenable_callback_truetrue", (err)=>{
console.debug("====>add account ActsSetCheckSyncEnable_1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAppAccountSyncEnable("syncenable_callback_truetrue", true, (err)=>{
console.debug("====>setAppAccountSyncEnable first time 1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.setAppAccountSyncEnable("syncenable_callback_truetrue", true, (err)=>{
console.debug("====>setAppAccountSyncEnable second time 1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.checkAppAccountSyncEnable("syncenable_callback_truetrue", (err, data)=>{
console.debug("====>checkAppAccountSyncEnable 1100 err:" + JSON.stringify(err));
console.debug("====>checkAppAccountSyncEnable 1100 data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(true);
appAccountManager.deleteAccount("syncenable_callback_truetrue", (err)=>{
console.debug("====>delete Account 1100 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsSetCheckSyncEnable_1100 end====");
done();
});
......
......@@ -33,7 +33,7 @@ describe('ActsGetAllAccessibleAccounts', function () {
console.debug("====>getAllAccessibleAccounts 0100 err:" + JSON.stringify(err));
console.debug("====>getAllAccessibleAccounts 0100 data:" + JSON.stringify(data));
console.debug("====>getAllAccessibleAccounts 0100 data.length:" + data.length);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.length).assertEqual(0);
console.debug("====>ActsGetAllAccessibleAccounts_0100 end====");
done();
......@@ -77,12 +77,12 @@ describe('ActsGetAllAccessibleAccounts', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("accessibleAccount_callback_single", (err)=>{
console.debug("====> add account ActsGetAllAccessibleAccounts_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccessibleAccounts((err, data)=>{
console.debug("====>getAllAccessibleAccounts 0300 err:" + JSON.stringify(err));
console.debug("====>getAllAccessibleAccounts 0300 data:" + JSON.stringify(data));
console.debug("====>getAllAccessibleAccounts 0300 data.length:" + data.length);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.length).assertEqual(1);
try{
expect(data[0].name).assertEqual("accessibleAccount_callback_single");
......@@ -95,7 +95,7 @@ describe('ActsGetAllAccessibleAccounts', function () {
}
appAccountManager.deleteAccount("accessibleAccount_callback_single", (err)=>{
console.debug("====>delete Account ActsGetAllAccessibleAccounts_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsGetAllAccessibleAccounts_0300 end====");
done();
})
......@@ -166,18 +166,18 @@ describe('ActsGetAllAccessibleAccounts', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("accessibleAccount_callback_first", (err)=>{
console.debug("====>add account first time 0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.addAccount("accessibleAccount_callback_second", (err)=>{
console.debug("====>add account second time 0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.addAccount("accessibleAccount_callback_third", (err)=>{
console.debug("====>add account third time 0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccessibleAccounts((err, data)=>{
console.debug("====>getAllAccessibleAccounts 0500 err:" + JSON.stringify(err));
console.debug("====>getAllAccessibleAccounts 0500 data:" + JSON.stringify(data));
console.debug("====>getAllAccessibleAccounts 0500 data.length:" + data.length);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.length).assertEqual(3);
try{
expect(data[0].name).assertEqual("accessibleAccount_callback_first");
......@@ -194,13 +194,13 @@ describe('ActsGetAllAccessibleAccounts', function () {
}
appAccountManager.deleteAccount("accessibleAccount_callback_first", (err)=>{
console.debug("====>delete Account first 0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("accessibleAccount_callback_second", (err)=>{
console.debug("====>delete Account second 0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("accessibleAccount_callback_third", (err)=>{
console.debug("====>delete Account third 0500 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsGetAllAccessibleAccounts_0500 end====");
done();
})
......@@ -288,21 +288,21 @@ describe('ActsGetAllAccessibleAccounts', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("accessibleAccount_callback_delete_first", (err)=>{
console.debug("====>add first account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.addAccount("accessibleAccount_callback_delete_second", (err)=>{
console.debug("====>add second account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.addAccount("accessibleAccount_callback_delete_third", (err)=>{
console.debug("====>add third account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("accessibleAccount_callback_delete_second", (err)=>{
console.debug("====>delete second account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccessibleAccounts((err, data)=>{
console.debug("====>getAllAccessibleAccounts 0700 err:" + JSON.stringify(err));
console.debug("====>getAllAccessibleAccounts 0700 data:" + JSON.stringify(data));
console.debug("====>getAllAccessibleAccounts 0700 data.length:" + data.length);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.length).assertEqual(2);
try{
expect(data[0].name).assertEqual("accessibleAccount_callback_delete_first");
......@@ -317,10 +317,10 @@ describe('ActsGetAllAccessibleAccounts', function () {
}
appAccountManager.deleteAccount("accessibleAccount_callback_delete_first", (err)=>{
console.debug("====>delete first account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("accessibleAccount_callback_delete_third", (err)=>{
console.debug("====>delete third account 0700 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsGetAllAccessibleAccounts_0700 end====");
done();
})
......@@ -407,15 +407,15 @@ describe('ActsGetAllAccessibleAccounts', function () {
console.debug("====>creat finish====");
appAccountManager.addAccount("accessibleAccount_callback_multiple_first", (err)=>{
console.debug("====>add first account 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.addAccount("accessibleAccount_callback_multiple_second", (err)=>{
console.debug("====>add third account 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.getAllAccessibleAccounts((err, data)=>{
console.debug("====>getAllAccessibleAccounts first 0900 err:" + JSON.stringify(err));
console.debug("====>getAllAccessibleAccounts first 0900 data:" + JSON.stringify(data));
console.debug("====>getAllAccessibleAccounts first 0900 data.length:" + data.length);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.length).assertEqual(2);
try{
expect(data[0].name).assertEqual("accessibleAccount_callback_multiple_first");
......@@ -432,7 +432,7 @@ describe('ActsGetAllAccessibleAccounts', function () {
console.debug("====>getAllAccessibleAccounts second 0900 err:" + JSON.stringify(err));
console.debug("====>getAllAccessibleAccounts second 0900 data:" + JSON.stringify(data));
console.debug("====>getAllAccessibleAccounts second 0900 data.length:" + data.length);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.length).assertEqual(2);
try{
expect(data[0].name).assertEqual("accessibleAccount_callback_multiple_first");
......@@ -447,10 +447,10 @@ describe('ActsGetAllAccessibleAccounts', function () {
}
appAccountManager.deleteAccount("accessibleAccount_callback_multiple_first", (err)=>{
console.debug("====>delete first account 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
appAccountManager.deleteAccount("accessibleAccount_callback_multiple_second", (err)=>{
console.debug("====>delete second account 0900 err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsGetAllAccessibleAccounts_0900 end====");
done();
})
......
......@@ -27,6 +27,8 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
it('ActsOsAccountGetIdFormUid_0100', 0, async function (done) {
console.debug("====>ActsOsAccountGetIdFormUid_0100 start====");
var osAccountManager = osaccount.getAccountManager();
var testLocalId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.debug("====>testLocalId:" + testLocalId)
console.debug("====>get AccountManager finish====");
var bundleName = "com.example.actsosaccountthirdpartytest";
var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES);
......@@ -35,8 +37,8 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
osAccountManager.getOsAccountLocalIdFromUid(uid, (err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId);
expect(err).assertEqual(undefined);
expect(localId).assertEqual(100);
expect(err).assertEqual(null);
expect(localId).assertEqual(testLocalId);
console.debug("====>ActsOsAccountGetIdFormUid_0100 end====");
done();
});
......@@ -50,6 +52,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
it('ActsOsAccountGetIdFormUid_0200', 0, async function (done) {
console.debug("====>ActsOsAccountGetIdFormUid_0200 start====");
var osAccountManager = osaccount.getAccountManager();
var testLocalId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.debug("====>get AccountManager finish====");
var bundleName = "com.example.actsosaccountthirdpartytest";
var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES);
......@@ -57,7 +60,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
console.debug("====>obtained uid:" + uid);
var localId = await osAccountManager.getOsAccountLocalIdFromUid(uid);
console.debug("====>localId obtained by uid:" + localId);
expect(localId).assertEqual(100);
expect(localId).assertEqual(testLocalId);
console.debug("====>ActsOsAccountGetIdFormUid_0200 end====");
done();
});
......@@ -76,7 +79,6 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId);
expect(err.code).assertEqual(ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR);
expect(localId).assertEqual(undefined);
console.debug("====>ActsOsAccountGetIdFormUid_0300 end====");
done();
});
......@@ -116,7 +118,6 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId);
expect(err.code).assertEqual(ERR_OS_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR);
expect(localId).assertEqual(undefined);
console.debug("====>ActsOsAccountGetIdFormUid_0500 end====");
done();
});
......@@ -150,12 +151,16 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
it('ActsOsAccountGetIdFormProcess_0100', 0, async function (done) {
console.debug("====>ActsOsAccountGetIdFormProcess_0100 start====");
var osAccountManager = osaccount.getAccountManager();
var bundleName = "com.example.actsosaccountthirdpartytest";
var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES);
var uid = bundleInfo.uid;
var testLocalId = await osAccountManager.getOsAccountLocalIdFromUid(uid)
console.debug("====>get AccountManager finish====");
osAccountManager.getOsAccountLocalIdFromProcess((err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by process:" + localId);
expect(err).assertEqual(undefined);
expect(localId).assertEqual(100);
expect(err).assertEqual(null);
expect(localId).assertEqual(testLocalId);
console.debug("====>ActsOsAccountGetIdFormProcess_0100 end====");
done();
});
......@@ -169,10 +174,15 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
it('ActsOsAccountGetIdFormProcess_0200', 0, async function (done) {
console.debug("====>ActsOsAccountGetIdFormProcess_0200 start====");
var osAccountManager = osaccount.getAccountManager();
var bundleName = "com.example.actsosaccountthirdpartytest";
var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES);
var uid = bundleInfo.uid;
var testLocalId = await osAccountManager.getOsAccountLocalIdFromUid(uid)
console.debug("====>testLocalId obtained by process:" + testLocalId)
console.debug("====>get AccountManager finish====");
var localId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.debug("====>localId obtained by process:" + localId);
expect(localId).assertEqual(100);
expect(localId).assertEqual(testLocalId);
console.debug("====>ActsOsAccountGetIdFormProcess_0200 end====");
done();
});
......@@ -189,7 +199,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
osAccountManager.getOsAccountTypeFromProcess((err, accountType)=>{
console.debug("====>get type err: " + JSON.stringify(err));
console.debug("====>type obtained by process:" + JSON.stringify(accountType));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(accountType.ADMIN).assertEqual(0);
console.debug("====>ActsOsAccountGetTypeFormProcess_0100 end====");
done();
......@@ -220,11 +230,12 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
it('ActsOsAccountLocalIdSerial_0100', 0, async function (done) {
console.debug("====>ActsOsAccountLocalIdSerial_0100 start====");
var osAccountManager = osaccount.getAccountManager();
var testLocalId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.debug("====>get AccountManager finish====");
osAccountManager.getSerialNumberByOsAccountLocalId(100, (err, serialNumber)=>{
console.debug("====>ger serialNumber err:" + JSON.stringify(err));
console.debug("====>get serialNumber:" + serialNumber + " by localId: 100" );
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
var serialNumberStr = serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept);
......@@ -232,8 +243,8 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
osAccountManager.getOsAccountLocalIdBySerialNumber(serialNumber, (err, localId)=>{
console.debug("====>ger localId err:" + JSON.stringify(err));
console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber);
expect(err).assertEqual(undefined);
expect(localId).assertEqual(100);
expect(err).assertEqual(null);
expect(localId).assertEqual(testLocalId);
console.debug("====>ActsOsAccountLocalIdSerial_0100 end====");
done();
})
......@@ -248,8 +259,9 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
it('ActsOsAccountLocalIdSerial_0200', 0, async function (done) {
console.debug("====>ActsOsAccountLocalIdSerial_0200 start====");
var osAccountManager = osaccount.getAccountManager();
var testLocalId = await osAccountManager.getOsAccountLocalIdFromProcess();
console.debug("====>get AccountManager finish====");
var serialNumber = await osAccountManager.getSerialNumberByOsAccountLocalId(100);
var serialNumber = await osAccountManager.getSerialNumberByOsAccountLocalId(testLocalId);
console.debug("====>get serialNumber:" + serialNumber + " by localId: 100" );
var serialNumberStr = serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8);
......@@ -257,7 +269,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
expect(serialIntercept).assertEqual("00000001");
var localId = await osAccountManager.getOsAccountLocalIdBySerialNumber(serialNumber);
console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber);
expect(localId).assertEqual(100);
expect(localId).assertEqual(testLocalId);
console.debug("====>ActsOsAccountLocalIdSerial_0200 end====");
done();
});
......@@ -274,7 +286,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
osAccountManager.getSerialNumberByOsAccountLocalId(0, (err, serialNumber)=>{
console.debug("====>ger serialNumber err:" + JSON.stringify(err));
console.debug("====>get serialNumber:" + serialNumber + " by localId: 0" );
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
var serialNumberStr = serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept);
......@@ -282,7 +294,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
osAccountManager.getOsAccountLocalIdBySerialNumber(serialNumber, (err, localId)=>{
console.debug("====>ger localId err:" + JSON.stringify(err));
console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(localId).assertEqual(0);
console.debug("====>ActsOsAccountLocalIdSerial_0300 end====");
done();
......@@ -326,7 +338,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
osAccountManager.createOsAccount("osAccountNameIdSerialA", osaccount.OsAccountType.NORMAL, (err, data)=>{
console.debug("====>create os account err: " + JSON.stringify(err));
console.debug("====>create os account OsAccountInfo: " + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.localName).assertEqual("osAccountNameIdSerialA");
expect(data.domainInfo.accountName == "").assertEqual(true)
expect(data.type.NORMAL).assertEqual(1);
......@@ -334,19 +346,25 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
expect(data.isVerified).assertEqual(false);
expect(data.distributedInfo.name != null).assertEqual(true);
expect(data.domainInfo.domain == "").assertEqual(true);
expect(data.photo == "").assertEqual(true);
expect(data.createTime != "").assertEqual(true);
expect(data.lastLoginTime>=0).assertEqual(true);
expect(JSON.stringify(data.serialNumber).length == 16).assertEqual(true);
expect(data.isActived).assertEqual(false);
expect(data.isCreateCompleted).assertEqual(true)
localId = data.localId;
osAccountManager.getSerialNumberByOsAccountLocalId(localId, (err, serialNumber)=>{
console.debug("====>queryOsAccountById err:" + JSON.stringify(err));
console.debug("====>get serialNumber:" + serialNumber + " by localId: " + localId);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
osAccountManager.getOsAccountLocalIdBySerialNumber(serialNumber, (err, getlocalId)=>{
console.debug("====>ger localId err:" + JSON.stringify(err));
console.debug("====>get localId:" + getlocalId + " by serialNumber: " + serialNumber);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(getlocalId).assertEqual(localId);
osAccountManager.removeOsAccount(localId, (err)=>{
console.debug("====>remove localId: " + localId + " err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsOsAccountLocalIdSerial_0500 end====");
done();
})
......@@ -366,7 +384,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish====");
var localId;
var OsAccountInfo = await osAccountManager.createOsAccount("accountIdSerialB", osaccount.OsAccountType.NORMAL);
var OsAccountInfo = await osAccountManager.createOsAccount("accountIdSerialB", osaccount.OsAccountType.Guest);
console.debug("====>create os account OsAccountInfo: " + JSON.stringify(OsAccountInfo));
expect(OsAccountInfo.localName).assertEqual("accountIdSerialB");
localId = OsAccountInfo.localId;
......@@ -395,38 +413,38 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
osAccountManager.getCreatedOsAccountsCount((err, data)=>{
console.debug("====>obtains the number of all os accounts created err:" + JSON.stringify(err));
console.debug("====>obtains the number of all os accounts created data:" + data);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
obtainCount = data;
osAccountManager.createOsAccount("osAccountNameIdSerialE", osaccount.OsAccountType.NORMAL, (err, data)=>{
console.debug("====>create first os account err: " + JSON.stringify(err));
console.debug("====>create first os account OsAccountInfo: " + JSON.stringify(data));
localIdFir = data.localId;
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.localName).assertEqual("osAccountNameIdSerialE");
osAccountManager.createOsAccount("osAccountIdSerialF", osaccount.OsAccountType.NORMAL, (err, data)=>{
console.debug("====>create second os account err: " + JSON.stringify(err));
console.debug("====>create second os account OsAccountInfo: " + JSON.stringify(data));
localIdSec = data.localId;
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data.localName).assertEqual("osAccountIdSerialF");
osAccountManager.getCreatedOsAccountsCount((err, count)=>{
console.debug("====>obtains the number of all os accounts created err:" + JSON.stringify(err));
console.debug("====>obtains the number of all os accounts created count:" + count);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
count = count - 2;
expect(count).assertEqual(obtainCount);
osAccountManager.removeOsAccount(localIdFir, (err)=>{
console.debug("====>remove localId: " + localIdFir + " err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
osAccountManager.getCreatedOsAccountsCount((err, data)=>{
console.debug("====>obtains the number accounts created err:" + JSON.stringify(err));
console.debug("====>obtains the number accounts created data:" + data);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
data = data - 1;
expect(data).assertEqual(obtainCount);
osAccountManager.removeOsAccount(localIdSec, (err)=>{
console.debug("====>remove localId: " + localIdSec + " err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsOsAccountGetCount_0100 end====");
done();
})
......@@ -479,7 +497,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
var osAccountManager = osaccount.getAccountManager();
osAccountManager.queryActivatedOsAccountIds((err,dataArray)=>{
console.info("====>ActsOsAccountGQueryActicedOsAccountIds_0100 err :" + JSON.stringify(err));
expect(err).assertEqual(undefined)
expect(err).assertEqual(null)
console.info("====>ActsOsAccountGQueryActicedOsAccountIds_0100 dataArray" + dataArray.length);
done();
})
......@@ -493,7 +511,7 @@ describe('ActsOsAccountThirdPartyTest_third1', function () {
done();
}).catch((err)=>{
console.info("====>ActsOsAccountQueryActivedOsAccountIds_0200 err " + JSON.stringify(err));
expect(err).assertEqual(undefined)
expect(err).assertEqual(null)
done();
});
})
......
......@@ -42,7 +42,7 @@ describe('ActsOsAccountThirdPartyTest_third2', function () {
AccountManager.getDistributedVirtualDeviceId((err, id)=>{
console.debug("====>getDistributedVirtualDeviceId err:" + JSON.stringify(err));
console.debug("====>getDistributedVirtualDeviceId deviceId:" + id);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(id).assertEqual(deviceId);
console.debug("====>ActsOsAccountDeviceId_0100 end====");
done();
......@@ -89,7 +89,7 @@ describe('ActsOsAccountThirdPartyTest_third2', function () {
AccountManager.isOsAccountActived(0, (err, isActived)=>{
console.debug("====>isOsAccountActived err:" + JSON.stringify(err));
console.debug("====>isOsAccountActived isActived:" + isActived);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(isActived).assertEqual(true);
console.debug("====>ActsOsAccountIsActived_0100 end");
done();
......@@ -245,7 +245,7 @@ describe('ActsOsAccountThirdPartyTest_third2', function () {
AccountManager.isMultiOsAccountEnable((err, data)=>{
console.debug("====>isMultiOsAccountEnable err:" + JSON.stringify(err));
console.debug("====>isMultiOsAccountEnable data:" + data);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(true);
console.debug("====>ActsOsAccountIsMulty_0100 end====");
done();
......@@ -287,7 +287,7 @@ describe('ActsOsAccountThirdPartyTest_third2', function () {
AccountManager.isOsAccountVerified((err, data)=>{
console.debug("====>isOsAccountVerified err:" + JSON.stringify(err));
console.debug("====>isOsAccountVerified data:" + data);
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(false);
console.debug("====>ActsOsAccountVerified_0100 end====");
done();
......@@ -321,7 +321,7 @@ describe('ActsOsAccountThirdPartyTest_third2', function () {
console.debug("====>get os AccountManager finish====");
AccountManager.isOsAccountVerified(0, (err, data)=>{
console.debug("====>isOsAccountVerified err:" + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertFalse();
console.debug("====>ActsOsAccountIsVerified_0300 end====");
done();
......@@ -356,7 +356,7 @@ describe('ActsOsAccountThirdPartyTest_third2', function () {
AccountManager.isOsAccountVerified(localIdStr, (err, data)=>{
console.debug("====>error received callback====");
console.debug("====>receive isOsAccountVerified err: " + JSON.stringify(err));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(false);
console.debug("====>receive isOsAccountVerified data: " + JSON.stringify(data));
done();
......@@ -396,7 +396,7 @@ describe('ActsOsAccountThirdPartyTest_third2', function () {
var localIdUndefined = undefined;
AccountManager.isOsAccountVerified(localIdUndefined, (err, data) =>{
console.debug("====>ActsOsAccountIsVerified_0700 isOsAccountVerified_err:" + JSON.stringify(err))
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
console.debug("====>ActsOsAccountIsVerified_0700 isOsAccountVerified_data:" + JSON.stringify(data))
expect(data).assertEqual(false)
console.debug("====>ActsOsAccountIsVerified_0700 end====");
......@@ -477,7 +477,7 @@ describe('ActsOsAccountThirdPartyTest_third2', function () {
AccountManager.isTestOsAccount((err, data)=>{
console.debug("====>isTestOsAccount err:" + JSON.stringify(err));
console.debug("====>isTestOsAccount data:" + JSON.stringify(data));
expect(err).assertEqual(undefined);
expect(err).assertEqual(null);
expect(data).assertEqual(false);
console.debug("====>ActsOsAccountIsTest_0100 end====");
done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册