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

!2445 增加case timeout的时间限制

Merge pull request !2445 from 高曦/release_0315_2
......@@ -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,13 +30,23 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>ActsOsAccountDeviceId_0100 start====");
var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish====");
AccountManager.getDistributedVirtualDeviceId((err, deviceId)=>{
console.debug("====>getDistributedVirtualDeviceId err:" + JSON.stringify(err));
console.debug("====>getDistributedVirtualDeviceId deviceId:" + deviceId);
expect(err.code).assertEqual(0);
expect(deviceId).assertEqual("");
console.debug("====>ActsOsAccountDeviceId_0100 end====");
done();
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:" + id);
expect(err.code).assertEqual(0);
expect(id).assertEqual(deviceId);
console.debug("====>ActsOsAccountDeviceId_0100 end====");
done();
})
})
})
......@@ -48,18 +59,22 @@ 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();
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();
}
console.debug("====>getDistributedVirtualDeviceId:" + deviceId);
expect(deviceId).assertEqual("");
console.debug("====>ActsOsAccountDeviceId_0200 end====");
done();
})
})
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册