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

!7903 【account】【master】修改 权限和api终审接口名称修改

Merge pull request !7903 from 郭永强/master
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
{ {
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE", "name":"ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
"reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
} }
], ],
"abilities": [ "abilities": [
......
...@@ -46,11 +46,12 @@ export default function ActsAccountAppAccess() { ...@@ -46,11 +46,12 @@ export default function ActsAccountAppAccess() {
parameters: parameters:
{}, {},
}, },
}, }, (err, data) => {
) console.debug("====>accountauthenticatorfeatureAbility.startAbilityForResult err:" + JSON.stringify(err))
await sleep(1500); console.debug("====>accountauthenticatorfeatureAbility.startAbilityForResult data:" + JSON.stringify(data))
console.debug("====>ActsAccountAuthenticator beforeAll end====");
done(); done();
})
console.debug("====>ActsAccountAuthenticator beforeAll end====");
}); });
beforeEach(async (done)=>{ beforeEach(async (done)=>{
console.debug("====>afterEach start===="); console.debug("====>afterEach start====");
......
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
"name":"ohos.permission.REMOVE_CACHE_FILES", "name":"ohos.permission.REMOVE_CACHE_FILES",
"reason":"need use ohos.permission.REMOVE_CACHE_FILES" "reason":"need use ohos.permission.REMOVE_CACHE_FILES"
}, },
{
"name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
"reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
},
{ {
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE", "name":"ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
......
...@@ -33,6 +33,7 @@ export default function ActsAccountAppAccess() { ...@@ -33,6 +33,7 @@ export default function ActsAccountAppAccess() {
}) })
} }
beforeAll(async function (done) { beforeAll(async function (done) {
console.debug("====>accountauthenticatorbeforeAll start====");
await featureAbility.startAbility( await featureAbility.startAbility(
{ {
want: want:
...@@ -44,10 +45,12 @@ export default function ActsAccountAppAccess() { ...@@ -44,10 +45,12 @@ export default function ActsAccountAppAccess() {
parameters: parameters:
{}, {},
}, },
}, }, (err, data) => {
) console.debug("====>accountauthenticatorfeatureAbility.startAbility err:" + JSON.stringify(err))
await sleep(1000) console.debug("====>accountauthenticatorfeatureAbility.startAbility data:" + JSON.stringify(data))
done(); done();
})
console.debug("====>accountauthenticatorfeatureAbility.startAbility end")
}); });
beforeEach(async function (done) { beforeEach(async function (done) {
console.debug("====>afterEach start===="); console.debug("====>afterEach start====");
......
...@@ -261,7 +261,7 @@ class MyAuthenticator extends rpc.RemoteObject { ...@@ -261,7 +261,7 @@ class MyAuthenticator extends rpc.RemoteObject {
case 5 : case 5 :
name = readString8(data) name = readString8(data)
callback = new MyAuthenticatorCallback(data.readRemoteObject()) callback = new MyAuthenticatorCallback(data.readRemoteObject())
this.authenticatorImpl.isAccountRemovable(name, callback) this.authenticatorImpl.checkAccountRemovable(name, callback)
break break
} }
return true return true
...@@ -345,7 +345,7 @@ class MyAuthenticatorImpl { ...@@ -345,7 +345,7 @@ class MyAuthenticatorImpl {
callback.onResult(10016, {}) callback.onResult(10016, {})
} }
isAccountRemovable(name, callback) { checkAccountRemovable(name, callback) {
console.log(TAG + "name: " + name) console.log(TAG + "name: " + name)
var isRemovable = this.accountRemovability[name] var isRemovable = this.accountRemovability[name]
if (isRemovable == undefined || isRemovable == false) { if (isRemovable == undefined || isRemovable == false) {
......
...@@ -160,7 +160,7 @@ class MyAuthenticator extends account_appAccount.Authenticator { ...@@ -160,7 +160,7 @@ class MyAuthenticator extends account_appAccount.Authenticator {
callback.onResult(10016, {}) callback.onResult(10016, {})
} }
isAccountRemovable(name, callback) { checkAccountRemovable(name, callback) {
console.log(TAG + "name: " + name) console.log(TAG + "name: " + name)
var isRemovable = false; var isRemovable = false;
try { try {
......
...@@ -34,20 +34,20 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -34,20 +34,20 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
}) })
/* /*
* @tc.number : ActsOsAccountQueryIdFormUid_0100 * @tc.number : ActsOsAccountQueryIdFormUid_0100
* @tc.name : queryOsAccountLocalIdFromUid callback * @tc.name : getOsAccountLocalIdForUid callback
* @tc.desc : Verify that the user localId is obtained by uid * @tc.desc : Verify that the user localId is obtained by uid
*/ */
it('ActsOsAccountQueryIdFormUid_0100', 0, async function (done) { it('ActsOsAccountQueryIdFormUid_0100', 0, async function (done) {
console.debug("====>ActsOsAccountQueryIdFormUid_0100 start===="); console.debug("====>ActsOsAccountQueryIdFormUid_0100 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
var testLocalId = await osAccountManager.queryOsAccountLocalIdFromProcess(); var testLocalId = await osAccountManager.getOsAccountLocalId();
console.debug("====>testLocalId:" + testLocalId) console.debug("====>testLocalId:" + testLocalId)
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var bundleName = "com.example.actsosaccountthirdpartytest"; var bundleName = "com.example.actsosaccountthirdpartytest";
var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES); var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES);
var uid = bundleInfo.uid; var uid = bundleInfo.uid;
console.debug("====>obtained uid:" + uid); console.debug("====>obtained uid:" + uid);
osAccountManager.queryOsAccountLocalIdFromUid(uid, (err, localId)=>{ osAccountManager.getOsAccountLocalIdForUid(uid, (err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err)); console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId); console.debug("====>localId obtained by uid:" + localId);
expect(err).assertEqual(null); expect(err).assertEqual(null);
...@@ -59,19 +59,19 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -59,19 +59,19 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryIdFormUid_0200 * @tc.number : ActsOsAccountQueryIdFormUid_0200
* @tc.name : queryOsAccountLocalIdFromUid promise * @tc.name : getOsAccountLocalIdForUid promise
* @tc.desc : Verify that the user localId is obtained by uid * @tc.desc : Verify that the user localId is obtained by uid
*/ */
it('ActsOsAccountQueryIdFormUid_0200', 0, async function (done) { it('ActsOsAccountQueryIdFormUid_0200', 0, async function (done) {
console.debug("====>ActsOsAccountQueryIdFormUid_0200 start===="); console.debug("====>ActsOsAccountQueryIdFormUid_0200 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
var testLocalId = await osAccountManager.queryOsAccountLocalIdFromProcess(); var testLocalId = await osAccountManager.getOsAccountLocalId();
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var bundleName = "com.example.actsosaccountthirdpartytest"; var bundleName = "com.example.actsosaccountthirdpartytest";
var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES); var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES);
var uid = bundleInfo.uid; var uid = bundleInfo.uid;
console.debug("====>obtained uid:" + uid); console.debug("====>obtained uid:" + uid);
var localId = await osAccountManager.queryOsAccountLocalIdFromUid(uid); var localId = await osAccountManager.getOsAccountLocalIdForUid(uid);
console.debug("====>localId obtained by uid:" + localId); console.debug("====>localId obtained by uid:" + localId);
expect(localId).assertEqual(testLocalId); expect(localId).assertEqual(testLocalId);
console.debug("====>ActsOsAccountQueryIdFormUid_0200 end===="); console.debug("====>ActsOsAccountQueryIdFormUid_0200 end====");
...@@ -80,7 +80,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -80,7 +80,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryIdFormUid_0300 * @tc.number : ActsOsAccountQueryIdFormUid_0300
* @tc.name : queryOsAccountLocalIdFromUid callback * @tc.name : getOsAccountLocalIdForUid callback
* @tc.desc : Authentication failed to query user by uid -1 * @tc.desc : Authentication failed to query user by uid -1
*/ */
it('ActsOsAccountQueryIdFormUid_0300', 0, async function (done) { it('ActsOsAccountQueryIdFormUid_0300', 0, async function (done) {
...@@ -88,7 +88,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -88,7 +88,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var incorrectUid = -1; var incorrectUid = -1;
osAccountManager.queryOsAccountLocalIdFromUid(incorrectUid, (err, localId)=>{ osAccountManager.getOsAccountLocalIdForUid(incorrectUid, (err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err)); console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId); console.debug("====>localId obtained by uid:" + localId);
expect(err.code).assertEqual(ERR_INVALID_PARAMETER); expect(err.code).assertEqual(ERR_INVALID_PARAMETER);
...@@ -100,7 +100,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -100,7 +100,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryIdFormUid_0400 * @tc.number : ActsOsAccountQueryIdFormUid_0400
* @tc.name : queryOsAccountLocalIdFromUid promise * @tc.name : getOsAccountLocalIdForUid promise
* @tc.desc : Authentication failed to query user by uid -1 * @tc.desc : Authentication failed to query user by uid -1
*/ */
it('ActsOsAccountQueryIdFormUid_0400', 0, async function (done) { it('ActsOsAccountQueryIdFormUid_0400', 0, async function (done) {
...@@ -109,7 +109,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -109,7 +109,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var incorrectUid = -1; var incorrectUid = -1;
try{ try{
await osAccountManager.queryOsAccountLocalIdFromUid(incorrectUid); await osAccountManager.getOsAccountLocalIdForUid(incorrectUid);
}catch(err){ }catch(err){
console.debug("====>get localId by uid err:" +JSON.stringify(err)); console.debug("====>get localId by uid err:" +JSON.stringify(err));
expect(err.code).assertEqual(ERR_INVALID_PARAMETER); expect(err.code).assertEqual(ERR_INVALID_PARAMETER);
...@@ -120,7 +120,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -120,7 +120,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryIdFormUid_0500 * @tc.number : ActsOsAccountQueryIdFormUid_0500
* @tc.name : queryOsAccountLocalIdFromUid callback * @tc.name : getOsAccountLocalIdForUid callback
* @tc.desc : Authentication failed to query user by uid 2147483648 * @tc.desc : Authentication failed to query user by uid 2147483648
*/ */
it('ActsOsAccountQueryIdFormUid_0500', 0, async function (done) { it('ActsOsAccountQueryIdFormUid_0500', 0, async function (done) {
...@@ -128,7 +128,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -128,7 +128,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var incorrectUid = 2147483648; var incorrectUid = 2147483648;
osAccountManager.queryOsAccountLocalIdFromUid(incorrectUid, (err, localId)=>{ osAccountManager.getOsAccountLocalIdForUid(incorrectUid, (err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err)); console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by uid:" + localId); console.debug("====>localId obtained by uid:" + localId);
expect(err.code).assertEqual(ERR_INVALID_PARAMETER); expect(err.code).assertEqual(ERR_INVALID_PARAMETER);
...@@ -140,7 +140,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -140,7 +140,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryIdFormUid_0600 * @tc.number : ActsOsAccountQueryIdFormUid_0600
* @tc.name : queryOsAccountLocalIdFromUid promise * @tc.name : getOsAccountLocalIdForUid promise
* @tc.desc : Authentication failed to query user by uid 2147483648 * @tc.desc : Authentication failed to query user by uid 2147483648
*/ */
it('ActsOsAccountQueryIdFormUid_0600', 0, async function (done) { it('ActsOsAccountQueryIdFormUid_0600', 0, async function (done) {
...@@ -149,7 +149,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -149,7 +149,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var incorrectUid = 2147483648; var incorrectUid = 2147483648;
try{ try{
await osAccountManager.queryOsAccountLocalIdFromUid(incorrectUid); await osAccountManager.getOsAccountLocalIdForUid(incorrectUid);
}catch(err){ }catch(err){
console.debug("====>get localId by uid err:" +JSON.stringify(err)); console.debug("====>get localId by uid err:" +JSON.stringify(err));
expect(err.code).assertEqual(ERR_INVALID_PARAMETER); expect(err.code).assertEqual(ERR_INVALID_PARAMETER);
...@@ -160,7 +160,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -160,7 +160,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryIdFormProcess_0100 * @tc.number : ActsOsAccountQueryIdFormProcess_0100
* @tc.name : queryOsAccountLocalIdFromProcess callback * @tc.name : getOsAccountLocalId callback
* @tc.desc : Verify that the user localId obtained from the current process uid * @tc.desc : Verify that the user localId obtained from the current process uid
*/ */
it('ActsOsAccountQueryIdFormProcess_0100', 0, async function (done) { it('ActsOsAccountQueryIdFormProcess_0100', 0, async function (done) {
...@@ -169,9 +169,9 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -169,9 +169,9 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var bundleName = "com.example.actsosaccountthirdpartytest"; var bundleName = "com.example.actsosaccountthirdpartytest";
var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES); var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES);
var uid = bundleInfo.uid; var uid = bundleInfo.uid;
var testLocalId = await osAccountManager.queryOsAccountLocalIdFromUid(uid) var testLocalId = await osAccountManager.getOsAccountLocalIdForUid(uid)
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
osAccountManager.queryOsAccountLocalIdFromProcess((err, localId)=>{ osAccountManager.getOsAccountLocalId((err, localId)=>{
console.debug("====>get localId err: " + JSON.stringify(err)); console.debug("====>get localId err: " + JSON.stringify(err));
console.debug("====>localId obtained by process:" + localId); console.debug("====>localId obtained by process:" + localId);
expect(err).assertEqual(null); expect(err).assertEqual(null);
...@@ -183,7 +183,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -183,7 +183,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryIdFormProcess_0200 * @tc.number : ActsOsAccountQueryIdFormProcess_0200
* @tc.name : queryOsAccountLocalIdFromProcess promise * @tc.name : getOsAccountLocalId promise
* @tc.desc : Verify that the user localId obtained from the current process uid * @tc.desc : Verify that the user localId obtained from the current process uid
*/ */
it('ActsOsAccountQueryIdFormProcess_0200', 0, async function (done) { it('ActsOsAccountQueryIdFormProcess_0200', 0, async function (done) {
...@@ -192,10 +192,10 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -192,10 +192,10 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var bundleName = "com.example.actsosaccountthirdpartytest"; var bundleName = "com.example.actsosaccountthirdpartytest";
var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES); var bundleInfo = await bundle.getBundleInfo(bundleName, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES);
var uid = bundleInfo.uid; var uid = bundleInfo.uid;
var testLocalId = await osAccountManager.queryOsAccountLocalIdFromUid(uid) var testLocalId = await osAccountManager.getOsAccountLocalIdForUid(uid)
console.debug("====>testLocalId obtained by process:" + testLocalId) console.debug("====>testLocalId obtained by process:" + testLocalId)
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var localId = await osAccountManager.queryOsAccountLocalIdFromProcess(); var localId = await osAccountManager.getOsAccountLocalId();
console.debug("====>localId obtained by process:" + localId); console.debug("====>localId obtained by process:" + localId);
expect(localId).assertEqual(testLocalId); expect(localId).assertEqual(testLocalId);
console.debug("====>ActsOsAccountQueryIdFormProcess_0200 end===="); console.debug("====>ActsOsAccountQueryIdFormProcess_0200 end====");
...@@ -239,15 +239,15 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -239,15 +239,15 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0100 * @tc.number : ActsOsAccountQueryLocalIdSerial_0100
* @tc.name : querySerialNumberByOsAccountLocalId callback * @tc.name : getSerialNumberForOsAccountLocalId callback
* @tc.desc : Verify query serialNumber by 100 user and query 100 user by serialNumber * @tc.desc : Verify query serialNumber by 100 user and query 100 user by serialNumber
*/ */
it('ActsOsAccountQueryLocalIdSerial_0100', 0, async function (done) { it('ActsOsAccountQueryLocalIdSerial_0100', 0, async function (done) {
console.debug("====>ActsOsAccountQueryLocalIdSerial_0100 start===="); console.debug("====>ActsOsAccountQueryLocalIdSerial_0100 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
var testLocalId = await osAccountManager.queryOsAccountLocalIdFromProcess(); var testLocalId = await osAccountManager.getOsAccountLocalId();
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
osAccountManager.querySerialNumberByOsAccountLocalId(testLocalId, (err, serialNumber)=>{ osAccountManager.getSerialNumberForOsAccountLocalId(testLocalId, (err, serialNumber)=>{
console.debug("====>ger serialNumber err:" + JSON.stringify(err)); console.debug("====>ger serialNumber err:" + JSON.stringify(err));
console.debug("====>get serialNumber:" + serialNumber + " by localId: 100" ); console.debug("====>get serialNumber:" + serialNumber + " by localId: 100" );
expect(err).assertEqual(null); expect(err).assertEqual(null);
...@@ -255,7 +255,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -255,7 +255,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var serialIntercept = serialNumberStr.substring(8); var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept); console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000001"); expect(serialIntercept).assertEqual("00000001");
osAccountManager.queryOsAccountLocalIdBySerialNumber(serialNumber, (err, localId)=>{ osAccountManager.getOsAccountLocalIdForSerialNumber(serialNumber, (err, localId)=>{
console.debug("====>ger localId err:" + JSON.stringify(err)); console.debug("====>ger localId err:" + JSON.stringify(err));
console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber); console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber);
expect(err).assertEqual(null); expect(err).assertEqual(null);
...@@ -268,21 +268,21 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -268,21 +268,21 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0200 * @tc.number : ActsOsAccountQueryLocalIdSerial_0200
* @tc.name : querySerialNumberByOsAccountLocalId promise * @tc.name : getSerialNumberForOsAccountLocalId promise
* @tc.desc : Verify query serialNumber by 100 user and query 100 user by serialNumber * @tc.desc : Verify query serialNumber by 100 user and query 100 user by serialNumber
*/ */
it('ActsOsAccountQueryLocalIdSerial_0200', 0, async function (done) { it('ActsOsAccountQueryLocalIdSerial_0200', 0, async function (done) {
console.debug("====>ActsOsAccountQueryLocalIdSerial_0200 start===="); console.debug("====>ActsOsAccountQueryLocalIdSerial_0200 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
var testLocalId = await osAccountManager.queryOsAccountLocalIdFromProcess(); var testLocalId = await osAccountManager.getOsAccountLocalId();
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var serialNumber = await osAccountManager.querySerialNumberByOsAccountLocalId(testLocalId); var serialNumber = await osAccountManager.getSerialNumberForOsAccountLocalId(testLocalId);
console.debug("====>get serialNumber:" + serialNumber + " by localId: 100" ); console.debug("====>get serialNumber:" + serialNumber + " by localId: 100" );
var serialNumberStr = serialNumber.toString(); var serialNumberStr = serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8); var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept); console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000001"); expect(serialIntercept).assertEqual("00000001");
var localId = await osAccountManager.queryOsAccountLocalIdBySerialNumber(serialNumber); var localId = await osAccountManager.getOsAccountLocalIdForSerialNumber(serialNumber);
console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber); console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber);
expect(localId).assertEqual(testLocalId); expect(localId).assertEqual(testLocalId);
console.debug("====>ActsOsAccountQueryLocalIdSerial_0200 end===="); console.debug("====>ActsOsAccountQueryLocalIdSerial_0200 end====");
...@@ -291,14 +291,14 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -291,14 +291,14 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0300 * @tc.number : ActsOsAccountQueryLocalIdSerial_0300
* @tc.name : queryOsAccountLocalIdBySerialNumber callback * @tc.name : getOsAccountLocalIdForSerialNumber callback
* @tc.desc : Verify query serialNumber by 0 user and query 0 user by serialNumber * @tc.desc : Verify query serialNumber by 0 user and query 0 user by serialNumber
*/ */
it('ActsOsAccountQueryLocalIdSerial_0300', 0, async function (done) { it('ActsOsAccountQueryLocalIdSerial_0300', 0, async function (done) {
console.debug("====>ActsOsAccountQueryLocalIdSerial_0300 start===="); console.debug("====>ActsOsAccountQueryLocalIdSerial_0300 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
osAccountManager.querySerialNumberByOsAccountLocalId(0, (err, serialNumber)=>{ osAccountManager.getSerialNumberForOsAccountLocalId(0, (err, serialNumber)=>{
console.debug("====>ger serialNumber err:" + JSON.stringify(err)); console.debug("====>ger serialNumber err:" + JSON.stringify(err));
console.debug("====>get serialNumber:" + serialNumber + " by localId: 0" ); console.debug("====>get serialNumber:" + serialNumber + " by localId: 0" );
expect(err).assertEqual(null); expect(err).assertEqual(null);
...@@ -306,7 +306,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -306,7 +306,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var serialIntercept = serialNumberStr.substring(8); var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept); console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000000"); expect(serialIntercept).assertEqual("00000000");
osAccountManager.queryOsAccountLocalIdBySerialNumber(serialNumber, (err, localId)=>{ osAccountManager.getOsAccountLocalIdForSerialNumber(serialNumber, (err, localId)=>{
console.debug("====>ger localId err:" + JSON.stringify(err)); console.debug("====>ger localId err:" + JSON.stringify(err));
console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber); console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber);
expect(err).assertEqual(null); expect(err).assertEqual(null);
...@@ -319,20 +319,20 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -319,20 +319,20 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0400 * @tc.number : ActsOsAccountQueryLocalIdSerial_0400
* @tc.name : queryOsAccountLocalIdBySerialNumber promise * @tc.name : getOsAccountLocalIdForSerialNumber promise
* @tc.desc : Verify query serialNumber by 0 user and query 0 user by serialNumber * @tc.desc : Verify query serialNumber by 0 user and query 0 user by serialNumber
*/ */
it('ActsOsAccountQueryLocalIdSerial_0400', 0, async function (done) { it('ActsOsAccountQueryLocalIdSerial_0400', 0, async function (done) {
console.debug("====>ActsOsAccountQueryLocalIdSerial_0400 start===="); console.debug("====>ActsOsAccountQueryLocalIdSerial_0400 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
console.debug("====>get AccountManager finish===="); console.debug("====>get AccountManager finish====");
var serialNumber = await osAccountManager.querySerialNumberByOsAccountLocalId(0); var serialNumber = await osAccountManager.getSerialNumberForOsAccountLocalId(0);
console.debug("====>get serialNumber:" + serialNumber + " by localId: 0" ); console.debug("====>get serialNumber:" + serialNumber + " by localId: 0" );
var serialNumberStr = serialNumber.toString(); var serialNumberStr = serialNumber.toString();
var serialIntercept = serialNumberStr.substring(8); var serialIntercept = serialNumberStr.substring(8);
console.debug("====>truncate the last eight characters: " + serialIntercept); console.debug("====>truncate the last eight characters: " + serialIntercept);
expect(serialIntercept).assertEqual("00000000"); expect(serialIntercept).assertEqual("00000000");
var localId = await osAccountManager.queryOsAccountLocalIdBySerialNumber(serialNumber); var localId = await osAccountManager.getOsAccountLocalIdForSerialNumber(serialNumber);
console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber); console.debug("====>get localId:" + localId + " by serialNumber: " + serialNumber);
expect(localId).assertEqual(0); expect(localId).assertEqual(0);
console.debug("====>ActsOsAccountQueryLocalIdSerial_0400 end===="); console.debug("====>ActsOsAccountQueryLocalIdSerial_0400 end====");
...@@ -341,7 +341,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -341,7 +341,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0500 * @tc.number : ActsOsAccountQueryLocalIdSerial_0500
* @tc.name : querySerialNumberByOsAccountLocalId callback * @tc.name : getSerialNumberForOsAccountLocalId callback
* @tc.desc : Verify the query for the newly created user serialNumber and query the owning user through the * @tc.desc : Verify the query for the newly created user serialNumber and query the owning user through the
* serialNumber * serialNumber
*/ */
...@@ -368,11 +368,11 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -368,11 +368,11 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
expect(data.isActived).assertEqual(false); expect(data.isActived).assertEqual(false);
expect(data.isCreateCompleted).assertEqual(true) expect(data.isCreateCompleted).assertEqual(true)
localId = data.localId; localId = data.localId;
osAccountManager.querySerialNumberByOsAccountLocalId(localId, (err, serialNumber)=>{ osAccountManager.getSerialNumberForOsAccountLocalId(localId, (err, serialNumber)=>{
console.debug("====>queryOsAccountById err:" + JSON.stringify(err)); console.debug("====>queryOsAccountById err:" + JSON.stringify(err));
console.debug("====>get serialNumber:" + serialNumber + " by localId: " + localId); console.debug("====>get serialNumber:" + serialNumber + " by localId: " + localId);
expect(err).assertEqual(null); expect(err).assertEqual(null);
osAccountManager.queryOsAccountLocalIdBySerialNumber(serialNumber, (err, getlocalId)=>{ osAccountManager.getOsAccountLocalIdForSerialNumber(serialNumber, (err, getlocalId)=>{
console.debug("====>ger localId err:" + JSON.stringify(err)); console.debug("====>ger localId err:" + JSON.stringify(err));
console.debug("====>get localId:" + getlocalId + " by serialNumber: " + serialNumber); console.debug("====>get localId:" + getlocalId + " by serialNumber: " + serialNumber);
expect(err).assertEqual(null); expect(err).assertEqual(null);
...@@ -390,7 +390,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -390,7 +390,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountQueryLocalIdSerial_0600 * @tc.number : ActsOsAccountQueryLocalIdSerial_0600
* @tc.name : queryOsAccountLocalIdBySerialNumber promise * @tc.name : getOsAccountLocalIdForSerialNumber promise
* @tc.desc : Verify the query for the newly created user serialNumber and query the owning user through the * @tc.desc : Verify the query for the newly created user serialNumber and query the owning user through the
* serialNumber * serialNumber
*/ */
...@@ -403,9 +403,9 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -403,9 +403,9 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
console.debug("====>create os account OsAccountInfo: " + JSON.stringify(OsAccountInfo)); console.debug("====>create os account OsAccountInfo: " + JSON.stringify(OsAccountInfo));
expect(OsAccountInfo.localName).assertEqual("accountIdSerialB"); expect(OsAccountInfo.localName).assertEqual("accountIdSerialB");
localId = OsAccountInfo.localId; localId = OsAccountInfo.localId;
var serialNumber = await osAccountManager.querySerialNumberByOsAccountLocalId(localId); var serialNumber = await osAccountManager.getSerialNumberForOsAccountLocalId(localId);
console.debug("====>get serialNumber:" + serialNumber + " by localId: " + localId); console.debug("====>get serialNumber:" + serialNumber + " by localId: " + localId);
var getlocalId = await osAccountManager.queryOsAccountLocalIdBySerialNumber(serialNumber); var getlocalId = await osAccountManager.getOsAccountLocalIdForSerialNumber(serialNumber);
console.debug("====>get localId:" + getlocalId + " by serialNumber: " + serialNumber); console.debug("====>get localId:" + getlocalId + " by serialNumber: " + serialNumber);
expect(getlocalId).assertEqual(localId); expect(getlocalId).assertEqual(localId);
await osAccountManager.removeOsAccount(localId); await osAccountManager.removeOsAccount(localId);
...@@ -509,13 +509,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -509,13 +509,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountGetActivedOsAccountIds_0100 * @tc.number : ActsOsAccountGetActivedOsAccountIds_0100
* @tc.name : getActivatedOsAccountIds callback * @tc.name : getActivatedOsAccountLocalIds callback
* @tc.desc : query activated osAccount Ids * @tc.desc : query activated osAccount Ids
*/ */
it('ActsOsAccountGetActivedOsAccountIds_0100', 0, async function (done) { it('ActsOsAccountGetActivedOsAccountIds_0100', 0, async function (done) {
console.debug("====>ActsOsAccountGetActivedOsAccountIds_0100 start===="); console.debug("====>ActsOsAccountGetActivedOsAccountIds_0100 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
osAccountManager.getActivatedOsAccountIds((err,dataArray)=>{ osAccountManager.getActivatedOsAccountLocalIds((err,dataArray)=>{
console.info("====>ActsOsAccountGQueryActicedOsAccountIds_0100 err :" + JSON.stringify(err)); console.info("====>ActsOsAccountGQueryActicedOsAccountIds_0100 err :" + JSON.stringify(err));
expect(err).assertEqual(null) expect(err).assertEqual(null)
console.info("====>ActsOsAccountGQueryActicedOsAccountIds_0100 dataArray:" + dataArray); console.info("====>ActsOsAccountGQueryActicedOsAccountIds_0100 dataArray:" + dataArray);
...@@ -526,13 +526,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -526,13 +526,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountGetActivedOsAccountIds_0200 * @tc.number : ActsOsAccountGetActivedOsAccountIds_0200
* @tc.name : getActivatedOsAccountIds promise * @tc.name : getActivatedOsAccountLocalIds promise
* @tc.desc : query activated osAccount Ids * @tc.desc : query activated osAccount Ids
*/ */
it('ActsOsAccountGetActivedOsAccountIds_0200', 0, async function (done) { it('ActsOsAccountGetActivedOsAccountIds_0200', 0, async function (done) {
console.debug("====>ActsOsAccountGetActivedOsAccountIds_0200 start===="); console.debug("====>ActsOsAccountGetActivedOsAccountIds_0200 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
osAccountManager.getActivatedOsAccountIds().then((dataArray)=>{ osAccountManager.getActivatedOsAccountLocalIds().then((dataArray)=>{
console.debug("====>ActsOsAccountGetActivedOsAccountIds_0200 data" + JSON.stringify(dataArray)) console.debug("====>ActsOsAccountGetActivedOsAccountIds_0200 data" + JSON.stringify(dataArray))
expect(dataArray.length).assertEqual(1) expect(dataArray.length).assertEqual(1)
done(); done();
...@@ -584,13 +584,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -584,13 +584,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/** /**
* @tc.number ActsOsAccountQueryDomainTest_0300 * @tc.number ActsOsAccountQueryDomainTest_0300
* @tc.name Test createOsAccountForDomain queryOsAccountLocalIdFromDomain callback * @tc.name Test createOsAccountForDomain getOsAccountLocalIdForDomain callback
* @tc.desc Test createOsAccountForDomain queryOsAccountLocalIdFromDomain API functionality * @tc.desc Test createOsAccountForDomain getOsAccountLocalIdForDomain API functionality
*/ */
it('ActsOsAccountQueryDomainTest_0300', 0, async function (done) { it('ActsOsAccountQueryDomainTest_0300', 0, async function (done) {
console.debug("====>ActsOsAccountQueryDomainTest_0100 start===="); console.debug("====>ActsOsAccountQueryDomainTest_0100 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
osAccountManager.queryOsAccountLocalIdFromDomain({domain: "", accountName: ""}, (err)=>{ osAccountManager.getOsAccountLocalIdForDomain({domain: "", accountName: ""}, (err)=>{
console.debug("====>ActsOsAccountQueryDomainTest_0300 err:" + JSON.stringify(err)); console.debug("====>ActsOsAccountQueryDomainTest_0300 err:" + JSON.stringify(err));
expect(err.code != 0).assertEqual(true) expect(err.code != 0).assertEqual(true)
console.debug("====>ActsOsAccountQueryDomainTest_0300 end===="); console.debug("====>ActsOsAccountQueryDomainTest_0300 end====");
...@@ -600,13 +600,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -600,13 +600,13 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/** /**
* @tc.number ActsOsAccountQueryDomainTest_0400 * @tc.number ActsOsAccountQueryDomainTest_0400
* @tc.name Test createOsAccountForDomain queryOsAccountLocalIdFromDomain pormise * @tc.name Test createOsAccountForDomain getOsAccountLocalIdForDomain pormise
* @tc.desc Test createOsAccountForDomain queryOsAccountLocalIdFromDomain API functionality * @tc.desc Test createOsAccountForDomain getOsAccountLocalIdForDomain API functionality
*/ */
it('ActsOsAccountQueryDomainTest_0400', 0, async function (done) { it('ActsOsAccountQueryDomainTest_0400', 0, async function (done) {
console.debug("====>ActsOsAccountQueryDomainTest_0400 start===="); console.debug("====>ActsOsAccountQueryDomainTest_0400 start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
osAccountManager.queryOsAccountLocalIdFromDomain({domain: "", accountName: ""}).then((accountID)=>{ osAccountManager.getOsAccountLocalIdForDomain({domain: "", accountName: ""}).then((accountID)=>{
console.debug("ActsOsAccountQueryDomainTest_0400 accountID:" + JSON.stringify(accountID)) console.debug("ActsOsAccountQueryDomainTest_0400 accountID:" + JSON.stringify(accountID))
done(); done();
}).catch((err)=>{ }).catch((err)=>{
...@@ -659,15 +659,15 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -659,15 +659,15 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountCheckConstraints_3300 * @tc.number : ActsOsAccountCheckConstraints_3300
* @tc.name : checkConstraintEnabled callback * @tc.name : checkOsAccountConstraintEnabled callback
* @tc.desc : the application call interface does not meet the permissions * @tc.desc : the application call interface does not meet the permissions
*/ */
it('ActsOsAccountCheckConstraints_3300', 0, async function(done){ it('ActsOsAccountCheckConstraints_3300', 0, async function(done){
console.debug("====>ActsOsAccountCheckConstraints_3300 start===="); console.debug("====>ActsOsAccountCheckConstraints_3300 start====");
var AccountManager = osaccount.getAccountManager(); var AccountManager = osaccount.getAccountManager();
console.debug("====>get os AccountManager finish===="); console.debug("====>get os AccountManager finish====");
AccountManager.checkConstraintEnabled(100, "constraint.bluetooth", (err, result)=>{ AccountManager.checkOsAccountConstraintEnabled(100, "constraint.bluetooth", (err, result)=>{
console.debug("====>checkConstraintEnabled err:" + JSON.stringify(err)); console.debug("====>checkOsAccountConstraintEnabled err:" + JSON.stringify(err));
expect(err).assertEqual(null); expect(err).assertEqual(null);
expect(result).assertTrue(); expect(result).assertTrue();
console.debug("====>ActsOsAccountCheckConstraints_3300 end===="); console.debug("====>ActsOsAccountCheckConstraints_3300 end====");
...@@ -677,7 +677,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -677,7 +677,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
/* /*
* @tc.number : ActsOsAccountPermission_3400 * @tc.number : ActsOsAccountPermission_3400
* @tc.name : checkConstraintEnabled promise * @tc.name : checkOsAccountConstraintEnabled promise
* @tc.desc : the application call interface does not meet the permissions * @tc.desc : the application call interface does not meet the permissions
*/ */
it('ActsOsAccountCheckConstraints_3400', 0, async function(done){ it('ActsOsAccountCheckConstraints_3400', 0, async function(done){
...@@ -685,11 +685,11 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -685,11 +685,11 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
var AccountManager = osaccount.getAccountManager(); var AccountManager = osaccount.getAccountManager();
console.debug("====>get os AccountManager finish===="); console.debug("====>get os AccountManager finish====");
try{ try{
await AccountManager.checkConstraintEnabled(100, "constraint.bluetooth"); await AccountManager.checkOsAccountConstraintEnabled(100, "constraint.bluetooth");
done(); done();
} }
catch(err){ catch(err){
console.debug("====>checkConstraintEnabled err:" + JSON.stringify(err)); console.debug("====>checkOsAccountConstraintEnabled err:" + JSON.stringify(err));
expect(err).assertEqual(null); expect(err).assertEqual(null);
console.debug("====>ActsOsAccountCheckConstraints_3400 end===="); console.debug("====>ActsOsAccountCheckConstraints_3400 end====");
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册