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

!5560 【OpenHarmony3.2Beta3】【账号】Authenticator时序错误修正

Merge pull request !5560 from 何海涛/Beta3-0920-Update
......@@ -13,6 +13,7 @@
* limitations under the License.
*/
import account from '@ohos.account.appAccount'
import featureAbility from '@ohos.ability.featureAbility'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const NAMELIMIT = 512;
......@@ -541,19 +542,6 @@ export default function ActsAccountAppAccess() {
*/
it('ActsAccountSetAuthenticatorProperties_0200', 0, async function (done) {
await featureAbility.startAbility(
{
want:
{
deviceId: "",
bundleName: "com.example.accountauthenticator",
abilityName: "com.example.accountauthenticator.MainAbility",
parameters:
{},
},
},
);
await sleep(1000);
console.debug("====>ActsAccountSetAuthenticatorProperties_0200 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>start finish====");
......@@ -598,6 +586,7 @@ export default function ActsAccountAppAccess() {
deviceId: "",
bundleName: "com.example.accountauthenticator",
abilityName: "com.example.accountauthenticator.MainAbility",
action: "action1",
parameters:
{},
},
......@@ -616,7 +605,7 @@ export default function ActsAccountAppAccess() {
console.debug("====>ActsAccountSelectAccountByOptions_0100 data:" + JSON.stringify(data));
expect(data.length).assertEqual(1)
} catch(err) {
onsole.debug("====>ActsAccountSelectAccountByOptions_0100 err:" + JSON.stringify(err));
console.debug("====>ActsAccountSelectAccountByOptions_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
}
try{
......@@ -646,6 +635,7 @@ export default function ActsAccountAppAccess() {
deviceId: "",
bundleName: "com.example.accountauthenticator",
abilityName: "com.example.accountauthenticator.MainAbility",
action: "action1",
parameters:
{},
},
......@@ -662,9 +652,9 @@ export default function ActsAccountAppAccess() {
try {
var data = await appAccountManager.selectAccountsByOptions(select_options)
console.debug("====>ActsAccountSelectAccountByOptions_0200 data:" + JSON.stringify(data));
expect(data.length).assertEqual(1)
expect(data.length).assertEqual(3)
} catch(err) {
onsole.debug("====>ActsAccountSelectAccountByOptions_0200 err:" + JSON.stringify(err));
console.debug("====>ActsAccountSelectAccountByOptions_0200 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
}
try{
......@@ -688,6 +678,20 @@ export default function ActsAccountAppAccess() {
*/
it('ActsAccountSelectAccountByOptions_0300', 0, async function (done) {
await featureAbility.startAbility(
{
want:
{
deviceId: "",
bundleName: "com.example.accountauthenticator",
abilityName: "com.example.accountauthenticator.MainAbility",
action: "action1",
parameters:
{},
},
},
);
await sleep(1000);
console.debug("====>ActsAccountSelectAccountByOptions_0300 start====");
var appAccountManager = account.createAppAccountManager();
var options = {requiredLabels: ["male", "30-40"]}
......@@ -700,7 +704,7 @@ export default function ActsAccountAppAccess() {
console.debug("====>ActsAccountSelectAccountByOptions_0300 data:" + JSON.stringify(data));
expect(data.length).assertEqual(1)
} catch(err) {
onsole.debug("====>ActsAccountSelectAccountByOptions_0300 err:" + JSON.stringify(err));
console.debug("====>ActsAccountSelectAccountByOptions_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
}
try{
......
......@@ -33,7 +33,7 @@
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"name": "com.example.accountauthenticator.MainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
......
......@@ -12,9 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import featureAbility from '@ohos.ability.featureAbility'
import account_appAccount from '@ohos.account.appAccount';
import featureAbility from '@ohos.ability.featureAbility'
export default {
data: {
......@@ -24,26 +23,28 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
console.info('ServiceAbility onStart');
console.info('====>ServiceAbility onStart');
var accountMgr = account_appAccount.createAppAccountManager();
console.info('ServiceAbility lcc addAccount 01 onStart');
console.info('====>ServiceAbility addAccount 01 onStart');
accountMgr.addAccount("zhangsan", "",(data)=>{
console.info('ServiceAbility lcc enableAppAccess 01 onStart');
console.info('====>ServiceAbility enableAppAccess 01 onStart');
accountMgr.enableAppAccess("zhangsan", "com.example.actsaccounttest");
console.info('ServiceAbility lcc addAccount 02 onStart');
console.info('====>ServiceAbility addAccount 02 onStart');
accountMgr.addAccount("lisi", "",(err)=>{
console.info('ServiceAbility lcc enableAppAccess 02 onStart');
console.info('====>ServiceAbility enableAppAccess 02 onStart');
accountMgr.enableAppAccess("lisi", "com.example.actsaccounttest");
console.info('ServiceAbility lcc addAccount 03 onStart');
console.info('====>ServiceAbility addAccount 03 onStart');
accountMgr.addAccount("wangwu", "",(err)=>{
console.info('ServiceAbility lcc enableAppAccess 03 onStart');
console.info('====>ServiceAbility enableAppAccess 03 onStart');
accountMgr.enableAppAccess("wangwu", "com.example.actsaccounttest",(err)=>{
featureAbility.terminateSelf();
console.info('ServiceAbility add end');
console.info('====>ServiceAbility add end');
});
});
});
});
console.info('ServiceAbility onStart end');
}
},
onReady() {
},
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册