Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
11ba2dbd
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
11ba2dbd
编写于
8月 26, 2021
作者:
J
jiyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
jiyong@huawei.com
Signed-off-by:
N
jiyong
<
jiyong@huawei.com
>
上级
ead6ddd2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
73 addition
and
4 deletion
+73
-4
account/OsAccountTest_js/project/entry/src/main/js/test/OsAccount.test.js
...tTest_js/project/entry/src/main/js/test/OsAccount.test.js
+67
-0
miscservices/TimeTest_js/project/entry/src/main/js/test/Time.test.js
...s/TimeTest_js/project/entry/src/main/js/test/Time.test.js
+6
-4
未找到文件。
account/OsAccountTest_js/project/entry/src/main/js/test/OsAccount.test.js
浏览文件 @
11ba2dbd
...
@@ -71,6 +71,9 @@ describe('AccountTest', function () {
...
@@ -71,6 +71,9 @@ describe('AccountTest', function () {
id
:
'
12345
'
,
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
event
:
'
Ohos.account.event.LOGIN
'
scalableData
=
{
testInfo
:
"
Test
"
}
};
};
accountAbility
.
updateOsAccountDistributedInfo
(
obj
).
then
(
function
(
result
)
{
accountAbility
.
updateOsAccountDistributedInfo
(
obj
).
then
(
function
(
result
)
{
expect
(
result
).
assertTrue
()
expect
(
result
).
assertTrue
()
...
@@ -87,6 +90,9 @@ describe('AccountTest', function () {
...
@@ -87,6 +90,9 @@ describe('AccountTest', function () {
});
});
});
});
});
});
accountAbility
.
queryOsAccountDistributedInfo
(
function
(
data
))
{
execpt
(
data
).
assertNull
()
}
})
})
/**
/**
...
@@ -100,6 +106,9 @@ describe('AccountTest', function () {
...
@@ -100,6 +106,9 @@ describe('AccountTest', function () {
id
:
'
12345
'
,
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
event
:
'
Ohos.account.event.LOGIN
'
scalableData
=
{
testInfo
:
"
Test
"
}
};
};
accountAbility
.
updateOsAccountDistributedInfo
(
obj
,
function
(
result
)
{
accountAbility
.
updateOsAccountDistributedInfo
(
obj
,
function
(
result
)
{
expect
(
result
).
assertTrue
()
expect
(
result
).
assertTrue
()
...
@@ -111,6 +120,7 @@ describe('AccountTest', function () {
...
@@ -111,6 +120,7 @@ describe('AccountTest', function () {
id
:
'
12345
'
,
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGOUT
'
event
:
'
Ohos.account.event.LOGOUT
'
};
};
accountAbility
.
updateOsAccountDistributedInfo
(
obj
).
then
(
function
(
result
)
{
accountAbility
.
updateOsAccountDistributedInfo
(
obj
).
then
(
function
(
result
)
{
expect
(
result
).
assertTrue
()
expect
(
result
).
assertTrue
()
...
@@ -118,4 +128,61 @@ describe('AccountTest', function () {
...
@@ -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
miscservices/TimeTest_js/project/entry/src/main/js/test/Time.test.js
浏览文件 @
11ba2dbd
...
@@ -29,13 +29,14 @@ describe('TimeTest', function() {
...
@@ -29,13 +29,14 @@ describe('TimeTest', function() {
*/
*/
it
(
'
systemTime_setTime_test1
'
,
0
,
async
function
(
done
)
{
it
(
'
systemTime_setTime_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
SUB_systemTime_setTime_JS_API_0100 start
"
)
console
.
log
(
"
SUB_systemTime_setTime_JS_API_0100 start
"
)
expect
(
1
).
assertLarger
(
0
)
systemTime
.
setTime
(
1526003846000
)
systemTime
.
setTime
(
1526003846000
)
.
then
(
data
=>
{
.
then
(
data
=>
{
console
.
log
(
"
setTime ===data
"
+
data
)
console
.
log
(
"
setTime ===data
"
+
data
)
execpt
(
data
).
assertEqual
(
true
)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
setTime ===error
"
+
error
)
console
.
log
(
"
setTime ===error
"
+
error
)
console
.
log
(
"
setTime ===data
"
+
data
)
console
.
log
(
"
setTime ===data
"
+
data
)
execpt
(
0
).
assertLarger
(
1
)
});
});
console
.
log
(
'
SUB_systemTime_setTime_JS_API_0100 end
'
);
console
.
log
(
'
SUB_systemTime_setTime_JS_API_0100 end
'
);
...
@@ -52,13 +53,13 @@ describe('TimeTest', function() {
...
@@ -52,13 +53,13 @@ describe('TimeTest', function() {
*/
*/
it
(
'
systemTime_setTime_test2
'
,
0
,
async
function
(
done
)
{
it
(
'
systemTime_setTime_test2
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
SUB_systemTime_setTime_JS_API_0200 start
"
)
console
.
log
(
"
SUB_systemTime_setTime_JS_API_0200 start
"
)
expect
(
1
).
assertLarger
(
0
)
systemTime
.
setTime
(
-
1
)
systemTime
.
setTime
(
-
1
)
.
then
(
data
=>
{
.
then
(
data
=>
{
console
.
log
(
"
setTime ===data
"
+
data
)
console
.
log
(
"
setTime ===data
"
+
data
)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
setTime ===error
"
+
error
)
console
.
log
(
"
setTime ===error
"
+
error
)
execpt
(
0
).
assertLarger
(
1
)
});
});
console
.
log
(
'
SUB_systemTime_setTime_JS_API_0200 end
'
);
console
.
log
(
'
SUB_systemTime_setTime_JS_API_0200 end
'
);
...
@@ -75,7 +76,6 @@ describe('TimeTest', function() {
...
@@ -75,7 +76,6 @@ describe('TimeTest', function() {
*/
*/
it
(
'
systemTime_setTime_test3
'
,
0
,
async
function
(
done
)
{
it
(
'
systemTime_setTime_test3
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
SUB_systemTime_setTime_JS_API_0300 start
"
)
console
.
log
(
"
SUB_systemTime_setTime_JS_API_0300 start
"
)
expect
(
1
).
assertLarger
(
0
)
systemTime
.
setTime
(
1597156246000
,
(
error
,
data
)
=>
{
systemTime
.
setTime
(
1597156246000
,
(
error
,
data
)
=>
{
console
.
log
(
"
setTime ===data:
"
+
data
);
console
.
log
(
"
setTime ===data:
"
+
data
);
console
.
log
(
"
setTime ===error:
"
+
error
);
console
.
log
(
"
setTime ===error:
"
+
error
);
...
@@ -98,7 +98,9 @@ describe('TimeTest', function() {
...
@@ -98,7 +98,9 @@ describe('TimeTest', function() {
systemTime
.
setTime
(
-
1
,
(
error
,
data
)
=>
{
systemTime
.
setTime
(
-
1
,
(
error
,
data
)
=>
{
console
.
log
(
"
setTime ===data:
"
+
data
);
console
.
log
(
"
setTime ===data:
"
+
data
);
console
.
log
(
"
setTime ===error:
"
+
error
);
console
.
log
(
"
setTime ===error:
"
+
error
);
});
})
catch
(
error
=>
{
execpt
(
0
).
assertLarger
(
1
)
})
console
.
log
(
'
SUB_systemTime_setTime_JS_API_0400 end
'
);
console
.
log
(
'
SUB_systemTime_setTime_JS_API_0400 end
'
);
done
()
done
()
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录