Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
97d8be53
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看板
提交
97d8be53
编写于
2月 08, 2022
作者:
G
gaoxi785
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add on off test case
Signed-off-by:
N
gaoxi785
<
gaoxi785@huawei.com
>
上级
827b6449
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
58 addition
and
0 deletion
+58
-0
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
...sosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
+58
-0
未找到文件。
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
浏览文件 @
97d8be53
...
...
@@ -25,6 +25,64 @@ describe('ActsOsAccountSystemTest', function () {
}
}
/*
* @tc.number : ActsOsAccountOnOff_0100
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : Verify that the activating type subscription can receive user switching
*/
it
(
'
ActsOsAccountOnOff_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountOnOff_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
localId
;
var
activatingSign
=
false
;
console
.
debug
(
"
====>get AccountManager finish====
"
);
function
onCallback
(
receiveLocalId
){
console
.
debug
(
"
====>receive localId:
"
+
receiveLocalId
);
if
(
receiveLocalId
==
localId
){
osAccountManager
.
off
(
"
activating
"
,
"
osAccountOnOffNameA
"
,
offCallback
);
}
}
function
onActivateCallback
(
receiveId
){
console
.
debug
(
"
====>onActivateCallback receive localId:
"
+
receiveId
);
if
(
receiveId
==
localId
){
osAccountManager
.
off
(
"
activate
"
,
"
osAccountactivateNameA
"
,
offActivateCallback
);
}
}
function
removeCallback
(
err
){
console
.
debug
(
"
====>remove localId:
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>the activating sign is:
"
+
activatingSign
);
expect
(
activatingSign
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountOnOff_0100 end====
"
);
done
();
}
function
offCallback
(){
console
.
debug
(
"
====>off enter
"
)
activatingSign
=
true
;
}
function
offActivateCallback
(){
console
.
debug
(
"
====>offActivateCallback enter
"
)
sleep
(
TIMEOUT
);
osAccountManager
.
removeOsAccount
(
localId
,
removeCallback
);
}
console
.
debug
(
"
====>on activating start====
"
);
osAccountManager
.
on
(
"
activating
"
,
"
osAccountOnOffNameA
"
,
onCallback
);
console
.
debug
(
"
====>on activate start====
"
);
osAccountManager
.
on
(
"
activate
"
,
"
osAccountactivateNameA
"
,
onActivateCallback
);
sleep
(
TIMEOUT
);
osAccountManager
.
createOsAccount
(
"
osAccountNameA
"
,
1
,
(
err
,
osAccountInfo
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount osAccountInfo:
"
+
JSON
.
stringify
(
osAccountInfo
));
localId
=
osAccountInfo
.
localId
;
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
osAccountInfo
.
localName
).
assertEqual
(
"
osAccountNameA
"
);
osAccountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
});
});
});
/*
* @tc.number : ActsOsAccountOnOff_0200
* @tc.name : Subscribe and unsubscribing local multi-user
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录