Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9028bffe authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "binderRpcTest: stronger check for synchronous cbs" am: b9a88146 am:...

Merge "binderRpcTest: stronger check for synchronous cbs" am: b9a88146 am: 637ef737 am: 18276414

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2098511



Change-Id: I224d0cf6ab11cfbf36033bc62233baece478d086
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2d3f029a 18276414
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -1248,9 +1248,14 @@ TEST_P(BinderRpc, Callbacks) {
                            proc.rootIface->doCallback(cb, callbackIsOneway, delayed, kTestString));
                            proc.rootIface->doCallback(cb, callbackIsOneway, delayed, kTestString));
                }
                }


                // if both transactions are synchronous and the response is sent back on the
                // same thread, everything should have happened in a nested call. Otherwise,
                // the callback will be processed on another thread.
                if (callIsOneway || callbackIsOneway || delayed) {
                    using std::literals::chrono_literals::operator""s;
                    using std::literals::chrono_literals::operator""s;
                    std::unique_lock<std::mutex> _l(cb->mMutex);
                    std::unique_lock<std::mutex> _l(cb->mMutex);
                    cb->mCv.wait_for(_l, 1s, [&] { return !cb->mValues.empty(); });
                    cb->mCv.wait_for(_l, 1s, [&] { return !cb->mValues.empty(); });
                }


                EXPECT_EQ(cb->mValues.size(), 1)
                EXPECT_EQ(cb->mValues.size(), 1)
                        << "callIsOneway: " << callIsOneway
                        << "callIsOneway: " << callIsOneway