Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
83305085
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看板
未验证
提交
83305085
编写于
7月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4459 【xts_acts】【rpc用例新增asObject接口用例】
Merge pull request !4459 from 杨启博/OpenHarmony-3.1-Release
上级
64e2dbcc
4864d327
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
71 addition
and
12 deletion
+71
-12
communication/dsoftbus/rpc/src/main/js/default/test/RpcClientJsunit.test.js
...tbus/rpc/src/main/js/default/test/RpcClientJsunit.test.js
+71
-12
未找到文件。
communication/dsoftbus/rpc/src/main/js/default/test/RpcClientJsunit.test.js
浏览文件 @
83305085
...
...
@@ -99,6 +99,9 @@ describe('ActsRpcClientJsTest', function(){
constructor
(
descriptor
)
{
super
(
descriptor
);
}
asObject
(){
return
this
;
}
}
class
MyDeathRecipient
{
...
...
@@ -117,9 +120,15 @@ describe('ActsRpcClientJsTest', function(){
}
}
class
TestAbility
extends
rpc
.
RemoteObject
{
class
TestProxy
{
remote
=
rpc
.
RemoteObject
;
constructor
(
remote
)
{
this
.
remote
=
remote
;
console
.
info
(
"
test remote
"
)
}
asObject
()
{
return
this
;
console
.
info
(
"
server remote
"
)
return
this
.
remote
;
}
}
...
...
@@ -2721,6 +2730,44 @@ describe('ActsRpcClientJsTest', function(){
console
.
log
(
"
---------------------end SUB_Softbus_IPC_MessageParcel_9500---------------------------
"
);
})
/*
* @tc.number SUB_Softbus_IPC_MessageParcel_9600
* @tc.name Test messageparcel delivery file descriptor object
* @tc.desc Function test
* @tc.level 0
*/
it
(
"
SUB_Softbus_IPC_MessageParcel_9600
"
,
0
,
async
function
(){
console
.
info
(
"
---------------------start SUB_Softbus_IPC_MessageParcel_9600---------------------------
"
);
try
{
let
testab
=
new
TestProxy
(
gIRemoteObject
).
asObject
();
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9600: asObject is
"
+
testab
);
expect
(
testab
!=
null
).
assertTrue
();
}
catch
(
error
)
{
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9600:error =
"
+
error
);
}
console
.
info
(
"
---------------------end SUB_Softbus_IPC_MessageParcel_9600---------------------------
"
);
});
/*
* @tc.number SUB_Softbus_IPC_MessageParcel_9700
* @tc.name Test that the asObject interface is called by a RemoteObject and returns itself
* @tc.desc Function test
* @tc.level 0
*/
it
(
"
SUB_Softbus_IPC_MessageParcel_9700
"
,
0
,
async
function
(){
console
.
info
(
"
---------------------start SUB_Softbus_IPC_MessageParcel_9700---------------------------
"
);
try
{
let
testRemoteObject
=
new
TestRemoteObject
(
"
testObject
"
);
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9700: asObject is
"
+
testRemoteObject
);
let
testab
=
testRemoteObject
.
asObject
();
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9700: asObject is
"
+
testab
);
expect
(
testab
!=
null
).
assertTrue
();
}
catch
(
error
)
{
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9700:error =
"
+
error
);
}
console
.
info
(
"
---------------------end SUB_Softbus_IPC_MessageParcel_9700---------------------------
"
);
});
/*
* @tc.number SUB_Softbus_IPC_MessageOption_0100
* @tc.name Basic method of testing messageoption
...
...
@@ -3829,26 +3876,38 @@ describe('ActsRpcClientJsTest', function(){
it
(
"
SUB_Softbus_IPC_RemoteProxy_0200
"
,
0
,
async
function
(){
console
.
log
(
"
---------------------start SUB_Softbus_IPC_RemoteProxy_0200---------------------------
"
);
try
{
let
recipient
=
new
MyDeathRecipient
(
proxy
,
null
)
var
resultAdd1
=
proxy
.
addDeathRecipient
(
recipient
,
0
)
let
recipient
=
new
MyDeathRecipient
(
gIRemoteObject
,
null
)
var
isDead
=
gIRemoteObject
.
isObjectDead
();
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200: run isObjectDead result is
"
+
isDead
);
expect
(
isDead
==
false
).
assertTrue
();
var
resultAdd1
=
gIRemoteObject
.
addDeathRecipient
(
recipient
,
0
)
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200:run addDeathRecipient first result is
"
+
resultAdd1
);
expect
(
resultAdd1
==
true
).
assertTrue
();
var
isDead1
=
proxy
.
isObjectDead
();
var
isDead1
=
gIRemoteObject
.
isObjectDead
();
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200: run isObjectDead result is
"
+
isDead1
);
expect
(
isDead1
==
true
).
assertTrue
();
expect
(
isDead1
==
false
).
assertTrue
();
var
resultRemove1
=
gIRemoteObject
.
removeDeathRecipient
(
recipient
,
0
)
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200:run removeDeathRecipient result is
"
+
resultRemove1
);
expect
(
resultRemove1
==
true
).
assertTrue
();
var
resultAdd2
=
proxy
.
addDeathRecipient
(
recipient
,
0
)
var
resultAdd2
=
gIRemoteObject
.
addDeathRecipient
(
recipient
,
0
)
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200:run addDeathRecipient second result is
"
+
resultAdd2
);
expect
(
resultAdd2
==
true
).
assertTrue
();
var
resultRemove
1
=
proxy
.
removeDeathRecipient
(
recipient
,
0
)
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200:run removeDeathRecipient1 result is
"
+
resultRemove
1
);
expect
(
resultRemove
1
==
true
).
assertTrue
();
var
resultRemove
2
=
gIRemoteObject
.
removeDeathRecipient
(
recipient
,
0
)
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200:run removeDeathRecipient1 result is
"
+
resultRemove
2
);
expect
(
resultRemove
2
==
true
).
assertTrue
();
var
isDead2
=
proxy
.
isObjectDead
();
var
resultRemove3
=
gIRemoteObject
.
removeDeathRecipient
(
recipient
,
0
)
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200:run removeDeathRecipient3 result is
"
+
resultRemove3
);
expect
(
resultRemove3
==
false
).
assertTrue
();
var
isDead2
=
gIRemoteObject
.
isObjectDead
();
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200: run isObjectDead2 result is
"
+
isDead2
);
expect
(
isDead
1
==
false
).
assertTrue
();
expect
(
isDead
2
==
false
).
assertTrue
();
}
catch
(
error
)
{
console
.
log
(
"
SUB_Softbus_IPC_RemoteProxy_0200:error =
"
+
error
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录