提交 11ba2dbd 编写于 作者: J jiyong

jiyong@huawei.com

Signed-off-by: Njiyong <jiyong@huawei.com>
上级 ead6ddd2
......@@ -71,6 +71,9 @@ describe('AccountTest', function () {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN'
scalableData={
testInfo:"Test"
}
};
accountAbility.updateOsAccountDistributedInfo(obj).then(function (result) {
expect(result).assertTrue()
......@@ -87,6 +90,9 @@ describe('AccountTest', function () {
});
});
});
accountAbility.queryOsAccountDistributedInfo(function (data)) {
execpt(data).assertNull()
}
})
/**
......@@ -100,6 +106,9 @@ describe('AccountTest', function () {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN'
scalableData={
testInfo:"Test"
}
};
accountAbility.updateOsAccountDistributedInfo(obj, function (result) {
expect(result).assertTrue()
......@@ -111,6 +120,7 @@ describe('AccountTest', function () {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGOUT'
};
accountAbility.updateOsAccountDistributedInfo(obj).then(function (result) {
expect(result).assertTrue()
......@@ -118,4 +128,61 @@ describe('AccountTest', function () {
});
});
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0300
* @tc.name Test distributedAccount.updateOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.updateOsAccountDistributedInfo API functionality by callback.
*/
it('account_updateOsAccountDistributedInfo_test003', 0, function () {
const accountAbility = account.getDistributedAccountAbility()
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.TOKEN_INVALID'
scalableData={
testInfo:"Test"
}
};
accountAbility.updateOsAccountDistributedInfo(obj, function (result) {
expect(result).assertTrue()
accountAbility.queryOsAccountDistributedInfo(obj).then(function (data)) {
except(data.name).assertNull()
}
});
})
/**
* @tc.number SUB_Account_distributedAccount_JS_API_0500
* @tc.name Test distributedAccount.updateOsAccountDistributedInfo by callback.
* @tc.desc Test distributedAccount.updateOsAccountDistributedInfo API functionality by callback.
*/
it('account_updateOsAccountDistributedInfo_test004', 0, function () {
const accountAbility = account.getDistributedAccountAbility()
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGIN'
scalableData={
testInfo:"Test"
}
};
accountAbility.updateOsAccountDistributedInfo(obj, function (result) {
expect(result).assertTrue()
accountAbility.queryOsAccountDistributedInfo(function (data) {
expect(data.name).assertEqual('ZhangSan')
expect(data.id).assertEqual('12345')
const accountAbility = account.getDistributedAccountAbility()
let obj = {
id: '12345',
name: 'ZhangSan',
event: 'Ohos.account.event.LOGOFF'
};
accountAbility.updateOsAccountDistributedInfo(obj).then(function (result) {
expect(result).assertNull()
});
});
});
})
})
\ No newline at end of file
......@@ -29,13 +29,14 @@ describe('TimeTest', function() {
*/
it('systemTime_setTime_test1', 0, async function (done) {
console.log("SUB_systemTime_setTime_JS_API_0100 start")
expect(1).assertLarger(0)
systemTime.setTime(1526003846000)
.then(data =>{
console.log("setTime ===data " + data)
execpt(data).assertEqual(true)
}).catch(error => {
console.log("setTime ===error " + error)
console.log("setTime ===data " + data)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTime_JS_API_0100 end');
......@@ -52,13 +53,13 @@ describe('TimeTest', function() {
*/
it('systemTime_setTime_test2', 0, async function (done) {
console.log("SUB_systemTime_setTime_JS_API_0200 start")
expect(1).assertLarger(0)
systemTime.setTime(-1)
.then(data => {
console.log("setTime ===data " + data)
}).catch(error => {
console.log("setTime ===error " + error)
execpt(0).assertLarger(1)
});
console.log('SUB_systemTime_setTime_JS_API_0200 end');
......@@ -75,7 +76,6 @@ describe('TimeTest', function() {
*/
it('systemTime_setTime_test3', 0, async function (done) {
console.log("SUB_systemTime_setTime_JS_API_0300 start")
expect(1).assertLarger(0)
systemTime.setTime(1597156246000, (error, data) => {
console.log("setTime ===data: " + data);
console.log("setTime ===error: " + error);
......@@ -98,7 +98,9 @@ describe('TimeTest', function() {
systemTime.setTime(-1, (error, data) => {
console.log("setTime ===data: " + data);
console.log("setTime ===error: " + error);
});
})catch(error=> {
execpt(0).assertLarger(1)
})
console.log('SUB_systemTime_setTime_JS_API_0400 end');
done()
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册