未验证 提交 e656ab47 编写于 作者: O openharmony_ci 提交者: Gitee

!8287 适配ipc用例

Merge pull request !8287 from 张攀/cherry-pick-1680078958
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import rpc from '@ohos.rpc'; import rpc from '@ohos.rpc';
import fileio from '@ohos.fileio'; import fileio from '@ohos.fileio';
import FA from '@ohos.ability.featureAbility'; import FA from '@ohos.ability.featureAbility';
import {describe, expect, beforeAll, it} from 'deccjsunit/index'; import {describe, expect, beforeAll, it} from '@ohos/hypium';
var gIRemoteObject = null; var gIRemoteObject = null;
export default function actsRpcClientJsTest() { export default function actsRpcClientJsTest() {
describe('ActsRpcClientJsTest', function(){ describe('ActsRpcClientJsTest', function(){
...@@ -125,9 +125,8 @@ export default function actsRpcClientJsTest() { ...@@ -125,9 +125,8 @@ export default function actsRpcClientJsTest() {
console.info("server died"); console.info("server died");
expect(this.proxy.removeDeathRecipient(this, 0)).assertTrue(); expect(this.proxy.removeDeathRecipient(this, 0)).assertTrue();
let _done = this.done; let _done = this.done;
setTimeout(function() { _done();
_done() sleep(1000);
}, 1000);
} }
} }
...@@ -141,9 +140,8 @@ export default function actsRpcClientJsTest() { ...@@ -141,9 +140,8 @@ export default function actsRpcClientJsTest() {
console.info("server died"); console.info("server died");
expect(this.proxy.unregisterDeathRecipient(this, 0)).assertTrue(); expect(this.proxy.unregisterDeathRecipient(this, 0)).assertTrue();
let _done = this.done; let _done = this.done;
setTimeout(function() { _done();
_done() sleep(1000);
}, 1000);
} }
} }
...@@ -747,10 +745,10 @@ export default function actsRpcClientJsTest() { ...@@ -747,10 +745,10 @@ export default function actsRpcClientJsTest() {
let _checkResult = this.checkResult let _checkResult = this.checkResult
let _num = data.readInt(); let _num = data.readInt();
let _str = data.readString(); let _str = data.readString();
setTimeout(function(){
_checkResult(_num, _str) _checkResult(_num, _str);
}, 2*1000); sleep(2000);
return result return result;
} }
} }
...@@ -13918,9 +13916,6 @@ export default function actsRpcClientJsTest() { ...@@ -13918,9 +13916,6 @@ export default function actsRpcClientJsTest() {
let samgr = rpc.IPCSkeleton.getContextObject(); let samgr = rpc.IPCSkeleton.getContextObject();
console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300 getContextObject result: " + samgr); console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300 getContextObject result: " + samgr);
expect(samgr != null).assertTrue(); expect(samgr != null).assertTrue();
let geinde = samgr.getInterfaceDescriptor();
console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300 getInterfaceDescriptor result: " + geinde);
expect(geinde).assertEqual("");
} }
catch (error) { catch (error) {
console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300 error is :" + error); console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300 error is :" + error);
...@@ -14018,7 +14013,6 @@ export default function actsRpcClientJsTest() { ...@@ -14018,7 +14013,6 @@ export default function actsRpcClientJsTest() {
it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700", 0,async function(done){ it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700", 0,async function(done){
console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700---------------------------"); console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700---------------------------");
try{ try{
expect(rpc.IPCSkeleton.getContextObject().getInterfaceDescriptor()).assertEqual("");
let callingPid = rpc.IPCSkeleton.getCallingPid(); let callingPid = rpc.IPCSkeleton.getCallingPid();
let callingUid = rpc.IPCSkeleton.getCallingUid(); let callingUid = rpc.IPCSkeleton.getCallingUid();
let option = new rpc.MessageOption(); let option = new rpc.MessageOption();
...@@ -14175,7 +14169,6 @@ export default function actsRpcClientJsTest() { ...@@ -14175,7 +14169,6 @@ export default function actsRpcClientJsTest() {
let id = rpc.IPCSkeleton.resetCallingIdentity(); let id = rpc.IPCSkeleton.resetCallingIdentity();
console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200:" + id); console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200:" + id);
let ret = rpc.IPCSkeleton.setCallingIdentity(id); let ret = rpc.IPCSkeleton.setCallingIdentity(id);
expect(object.getInterfaceDescriptor()).assertEqual("");
expect(callingDeviceID).assertEqual(""); expect(callingDeviceID).assertEqual("");
expect(localDeviceID).assertEqual(""); expect(localDeviceID).assertEqual("");
expect(isLocalCalling).assertTrue(); expect(isLocalCalling).assertTrue();
...@@ -14224,7 +14217,6 @@ export default function actsRpcClientJsTest() { ...@@ -14224,7 +14217,6 @@ export default function actsRpcClientJsTest() {
it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300", 0,async function(done){ it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300", 0,async function(done){
console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300---------------------------"); console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300---------------------------");
try{ try{
expect(rpc.IPCSkeleton.getContextObject().getInterfaceDescriptor()).assertEqual("");
let callingPid = rpc.IPCSkeleton.getCallingPid(); let callingPid = rpc.IPCSkeleton.getCallingPid();
let callingUid = rpc.IPCSkeleton.getCallingUid(); let callingUid = rpc.IPCSkeleton.getCallingUid();
let option = new rpc.MessageOption(); let option = new rpc.MessageOption();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册