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

!2444 增加case timeout的时间限制

Merge pull request !2444 from 高曦/master_0315_1
......@@ -35,7 +35,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
this.timeout = 40000;
this.timeout = 60000;
configService.setConfig(this)
require('../../../test/List.test')
......
......@@ -13,6 +13,7 @@
* limitations under the License.
*/
import osAccount from '@ohos.account.osAccount'
import distributedAccount from '@ohos.account.distributedAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000;
......@@ -29,15 +30,25 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>ActsOsAccountDeviceId_0100 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
AccountManager.getDistributedVirtualDeviceId((err, deviceId)=>{
const deviceId = '169C610CEF7F8310D78763C7DD8D28F0668D9FB8B1A3659CEF8F6BC3D9B39E17';
const accountAbility = distributedAccount.getDistributedAccountAbility();
accountAbility.updateOsAccountDistributedInfo(
{
name: 'ZhangSan',
id: '12345',
event: "Ohos.account.event.LOGIN"
}, (err)=>{
console.debug("====>update distributedInfo err:" + JSON.stringify(err));
AccountManager.getDistributedVirtualDeviceId((err, id)=>{
console.debug("====>getDistributedVirtualDeviceId err:" + JSON.stringify(err));
console.debug("====>getDistributedVirtualDeviceId deviceId:" + deviceId);
console.debug("====>getDistributedVirtualDeviceId deviceId:" + id);
expect(err.code).assertEqual(0);
expect(deviceId).assertEqual("");
expect(id).assertEqual(deviceId);
console.debug("====>ActsOsAccountDeviceId_0100 end====");
done();
})
})
})
/*
* @tc.number : ActsOsAccountDeviceId_0200
......@@ -48,19 +59,23 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>ActsOsAccountDeviceId_0200 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
try{
var deviceId = await AccountManager.getDistributedVirtualDeviceId();
}
catch(err){
console.error("====>catch getDistributedVirtualDeviceId err:" + JSON.stringify(err));
expect().assertFail();
done();
}
console.debug("====>getDistributedVirtualDeviceId:" + deviceId);
expect(deviceId).assertEqual("");
const deviceId = '169C610CEF7F8310D78763C7DD8D28F0668D9FB8B1A3659CEF8F6BC3D9B39E17';
const accountAbility = distributedAccount.getDistributedAccountAbility();
accountAbility.updateOsAccountDistributedInfo(
{
name: 'ZhangSan',
id: '12345',
event: "Ohos.account.event.LOGIN"
}, async (err)=>{
console.debug("====>update distributedInfo err:" + JSON.stringify(err));
console.debug("====>getDistributedVirtualDeviceId start====");
var id = await AccountManager.getDistributedVirtualDeviceId();
console.debug("====>getDistributedVirtualDeviceId:" + id);
expect(id).assertEqual(deviceId);
console.debug("====>ActsOsAccountDeviceId_0200 end====");
done();
})
})
/*
* @tc.number : ActsOsAccountIsActived_0100
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册