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

!2445 增加case timeout的时间限制

Merge pull request !2445 from 高曦/release_0315_2
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
core.init() core.init()
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
this.timeout = 40000; this.timeout = 60000;
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../../test/List.test')
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import osAccount from '@ohos.account.osAccount' import osAccount from '@ohos.account.osAccount'
import distributedAccount from '@ohos.account.distributedAccount'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const TIMEOUT = 1000; const TIMEOUT = 1000;
...@@ -29,13 +30,23 @@ describe('ActsOsAccountThirdPartyTest', function () { ...@@ -29,13 +30,23 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>ActsOsAccountDeviceId_0100 start===="); console.debug("====>ActsOsAccountDeviceId_0100 start====");
var AccountManager = osAccount.getAccountManager(); var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish===="); console.debug("====>get os AccountManager finish====");
AccountManager.getDistributedVirtualDeviceId((err, deviceId)=>{ const deviceId = '169C610CEF7F8310D78763C7DD8D28F0668D9FB8B1A3659CEF8F6BC3D9B39E17';
console.debug("====>getDistributedVirtualDeviceId err:" + JSON.stringify(err)); const accountAbility = distributedAccount.getDistributedAccountAbility();
console.debug("====>getDistributedVirtualDeviceId deviceId:" + deviceId); accountAbility.updateOsAccountDistributedInfo(
expect(err.code).assertEqual(0); {
expect(deviceId).assertEqual(""); name: 'ZhangSan',
console.debug("====>ActsOsAccountDeviceId_0100 end===="); id: '12345',
done(); 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 () { ...@@ -48,18 +59,22 @@ describe('ActsOsAccountThirdPartyTest', function () {
console.debug("====>ActsOsAccountDeviceId_0200 start===="); console.debug("====>ActsOsAccountDeviceId_0200 start====");
var AccountManager = osAccount.getAccountManager(); var AccountManager = osAccount.getAccountManager();
console.debug("====>get os AccountManager finish===="); console.debug("====>get os AccountManager finish====");
try{ const deviceId = '169C610CEF7F8310D78763C7DD8D28F0668D9FB8B1A3659CEF8F6BC3D9B39E17';
var deviceId = await AccountManager.getDistributedVirtualDeviceId(); const accountAbility = distributedAccount.getDistributedAccountAbility();
} accountAbility.updateOsAccountDistributedInfo(
catch(err){ {
console.error("====>catch getDistributedVirtualDeviceId err:" + JSON.stringify(err)); name: 'ZhangSan',
expect().assertFail(); 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(); 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.
先完成此消息的编辑!
想要评论请 注册