Revert "Revert "Testing AIDL delegator class with RPC""
This reverts commit 2fcd479e87ce8b1251ab64943250f0e36e9f8ac3.
The original commit was submitted with the system/tools/aidl commit that
broke the build.
That commit is fixed with the revert of the revert.
So this revert is being reverted..
Test: atest binderRpcTest
Bug: 198785815
Change-Id: I6f3fc85c9398801f7db0c81c8874d4c27dc36055
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp
index 8267702..f132ff7 100644
--- a/libs/binder/tests/binderRpcTest.cpp
+++ b/libs/binder/tests/binderRpcTest.cpp
@@ -1307,6 +1307,16 @@
ASSERT_EQ(beforeFds, countFds()) << (system("ls -l /proc/self/fd/"), "fd leak?");
}
+TEST_P(BinderRpc, AidlDelegatorTest) {
+ auto proc = createRpcTestSocketServerProcess({});
+ auto myDelegator = sp<IBinderRpcTestDelegator>::make(proc.rootIface);
+ ASSERT_NE(nullptr, myDelegator);
+
+ std::string doubled;
+ EXPECT_OK(myDelegator->doubleString("cool ", &doubled));
+ EXPECT_EQ("cool cool ", doubled);
+}
+
static bool testSupportVsockLoopback() {
// We don't need to enable TLS to know if vsock is supported.
unsigned int vsockPort = allocateVsockPort();