Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6b8732e1
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看板
提交
6b8732e1
编写于
3月 22, 2022
作者:
Z
zhangpa2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
js用例整改
Signed-off-by:
N
zhangpa2021
<
zhangpan70@huawei.com
>
上级
27712bbc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
55 deletion
+35
-55
communication/dsoftbus/rpc/src/main/js/default/test/RpcClientJsunit.test.js
...tbus/rpc/src/main/js/default/test/RpcClientJsunit.test.js
+35
-55
未找到文件。
communication/dsoftbus/rpc/src/main/js/default/test/RpcClientJsunit.test.js
浏览文件 @
6b8732e1
...
...
@@ -1763,7 +1763,7 @@ describe('ActsRpcClientJsTest', function(){
var
Capacity
=
data
.
getRawDataCapacity
()
console
.
log
(
"
SUB_Softbus_IPC_MessageParcel_7300:run Capacity success, result is
"
+
Capacity
);
var
token
=
new
Int8Array
([
2
,
1
,
4
,
3
,
129
])
;
var
result
=
data
.
writeRawData
(
token
,
token
.
length
);
var
result
=
data
.
writeRawData
(
token
,
149000000
);
console
.
log
(
"
SUB_Softbus_IPC_MessageParcel_7300:run writeRawData success, result is
"
+
result
);
expect
(
result
==
false
).
assertTrue
();
data
.
reclaim
();
...
...
@@ -1792,7 +1792,7 @@ describe('ActsRpcClientJsTest', function(){
var
result
=
data
.
writeRemoteObject
(
testRemoteObject
);
console
.
log
(
"
SUB_Softbus_IPC_MessageParcel_7400: result is
"
+
result
);
expect
(
result
==
true
).
assertTrue
();
data
.
readRemoteObject
()
}
catch
(
error
)
{
console
.
log
(
"
SUB_Softbus_IPC_MessageParcel_7400:error =
"
+
error
);
}
...
...
@@ -2590,42 +2590,39 @@ describe('ActsRpcClientJsTest', function(){
* @tc.level 0
*/
it
(
'
SUB_Softbus_IPC_MessageParcel_9300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9300
"
)
console
.
log
(
"
---------------------start SUB_Softbus_IPC_MessageParcel_9300---------------------------
"
);
function
checkResult
(
num
,
str
)
{
expect
(
num
).
assertEqual
(
123
)
expect
(
str
).
assertEqual
(
"
rpcListenerTest
"
)
done
()
}
try
{
let
option
=
new
rpc
.
MessageOption
()
let
data
=
rpc
.
MessageParcel
.
create
()
let
reply
=
rpc
.
MessageParcel
.
create
()
expect
(
data
.
writeInterfaceToken
(
"
rpcTestAbility
"
)).
assertTrue
()
let
listener
=
new
TestListener
(
"
rpcListener
"
,
checkResult
)
let
result
=
data
.
writeRemoteObject
(
listener
)
expect
(
result
==
true
).
assertTrue
()
let
readresult
=
data
.
readRemoteObject
()
expect
(
readresult
==
null
).
assertFalse
()
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9300 result is:
"
+
result
)
expect
(
data
.
writeInt
(
123
)).
assertTrue
()
expect
(
data
.
writeString
(
"
rpcListenerTest
"
)).
assertTrue
()
await
gIRemoteObject
.
sendRequest
(
CODE_WRITE_REMOTEOBJECT
,
data
,
reply
,
option
)
.
then
(
function
(
result
)
{
.
then
(
(
result
)
=>
{
console
.
info
(
"
sendRequest done, error code:
"
+
result
.
errCode
)
expect
(
result
.
errCode
).
assertEqual
(
0
)
result
.
reply
.
readException
()
})
.
catch
(
function
(
e
)
{
console
.
error
(
"
send request got exception:
"
+
e
)
expect
(
0
).
assertEqual
(
1
)
})
.
finally
(()
=>
{
data
.
reclaim
()
reply
.
reclaim
()
console
.
log
(
"
test done
"
)
})
}
catch
(
error
)
{
console
.
log
(
"
SUB_Softbus_IPC_MessageParcel_9300: error =
"
+
error
);
}
console
.
log
(
"
---------------------end SUB_Softbus_IPC_MessageParcel_9300---------------------------
"
);
})
})
/*
* @tc.number SUB_Softbus_IPC_MessageParcel_9400
...
...
@@ -2651,35 +2648,27 @@ describe('ActsRpcClientJsTest', function(){
let
option
=
new
rpc
.
MessageOption
()
let
data
=
rpc
.
MessageParcel
.
create
()
let
reply
=
rpc
.
MessageParcel
.
create
()
expect
(
data
.
writeInterfaceToken
(
"
rpcTestAbility
"
)).
assertTrue
()
let
listeners
=
[
new
TestListener
(
"
rpcListener4
"
,
checkResult
),
new
TestListener
(
"
rpcListener5
"
,
checkResult
),
new
TestListener
(
"
rpcListener6
"
,
checkResult
)]
let
listeners
=
[
new
TestListener
(
"
rpcListener
"
,
checkResult
),
new
TestListener
(
"
rpcListener2
"
,
checkResult
),
new
TestListener
(
"
rpcListener3
"
,
checkResult
)]
let
result
=
data
.
writeRemoteObjectArray
(
listeners
)
expect
(
result
==
true
).
assertTrue
()
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9400 result is:
"
+
result
)
expect
(
data
.
writeInt
(
123
)).
assertTrue
()
expect
(
data
.
writeString
(
"
rpcListenerTest
"
)).
assertTrue
()
await
gIRemoteObject
.
sendRequest
(
CODE_WRITE_REMOTEOBJECTARRAY_1
,
data
,
reply
,
option
)
.
then
(
(
result
)
=>
{
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9500:
sendRequest done, error code:
"
+
result
.
errCode
)
.
then
(
(
result
)
=>
{
console
.
info
(
"
sendRequest done, error code:
"
+
result
.
errCode
)
expect
(
result
.
errCode
).
assertEqual
(
0
)
result
.
reply
.
readException
()
})
.
catch
(
function
(
e
)
{
console
.
error
(
"
SUB_Softbus_IPC_MessageParcel_9400: send request got exception:
"
+
e
)
expect
(
0
).
assertEqual
(
1
)
})
.
finally
(()
=>
{
data
.
reclaim
()
reply
.
reclaim
()
console
.
log
(
"
test done
"
)
})
done
();
data
.
reclaim
();
reply
.
reclaim
();
}
catch
(
error
){
}
catch
(
error
)
{
console
.
log
(
"
SUB_Softbus_IPC_MessageParcel_9400: error =
"
+
error
);
}
}
console
.
log
(
"
---------------------end SUB_Softbus_IPC_MessageParcel_9400---------------------------
"
);
})
...
...
@@ -2707,37 +2696,28 @@ describe('ActsRpcClientJsTest', function(){
let
option
=
new
rpc
.
MessageOption
()
let
data
=
rpc
.
MessageParcel
.
create
()
let
reply
=
rpc
.
MessageParcel
.
create
()
expect
(
data
.
writeInterfaceToken
(
"
rpcTestAbility
"
)).
assertTrue
()
let
listeners
=
[
new
TestListener
(
"
rpcListener4
"
,
checkResult
),
new
TestListener
(
"
rpcListener5
"
,
checkResult
),
new
TestListener
(
"
rpcListener6
"
,
checkResult
)]
let
listeners
=
[
new
TestListener
(
"
rpcListener
"
,
checkResult
),
new
TestListener
(
"
rpcListener2
"
,
checkResult
),
new
TestListener
(
"
rpcListener3
"
,
checkResult
)]
let
result
=
data
.
writeRemoteObjectArray
(
listeners
)
expect
(
result
==
true
).
assertTrue
()
let
readresult
=
data
.
readRemoteObjectArray
()
expect
(
readresult
==
null
).
assertFalse
()
data
.
readRemoteObjectArray
()
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9500 result is:
"
+
result
)
expect
(
data
.
writeInt
(
123
)).
assertTrue
()
expect
(
data
.
writeString
(
"
rpcListenerTest
"
)).
assertTrue
()
await
gIRemoteObject
.
sendRequest
(
CODE_WRITE_REMOTEOBJECTARRAY_2
,
data
,
reply
,
option
)
.
then
(
(
result
)
=>
{
console
.
info
(
"
SUB_Softbus_IPC_MessageParcel_9500:sendRequest done, error code:
"
+
result
.
errCode
)
expect
(
result
.
errCode
).
assertEqual
(
0
)
})
.
catch
(
function
(
e
)
{
console
.
error
(
"
SUB_Softbus_IPC_MessageParcel_9500: send request got exception:
"
+
e
)
expect
(
0
).
assertEqual
(
1
)
})
.
finally
(()
=>
{
data
.
reclaim
()
reply
.
reclaim
()
console
.
log
(
"
test done
"
)
})
done
();
data
.
reclaim
();
reply
.
reclaim
();
}
catch
(
error
){
.
then
((
result
)
=>
{
console
.
info
(
"
sendRequest done, error code:
"
+
result
.
errCode
)
expect
(
result
.
errCode
).
assertEqual
(
0
)
result
.
reply
.
readException
()
})
data
.
reclaim
()
reply
.
reclaim
()
console
.
log
(
"
test done
"
)
}
catch
(
error
)
{
console
.
log
(
"
SUB_Softbus_IPC_MessageParcel_9500: error =
"
+
error
);
}
}
console
.
log
(
"
---------------------end SUB_Softbus_IPC_MessageParcel_9500---------------------------
"
);
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录