Go to the documentation of this file.
23 namespace end2end_testing {
105 const std::vector<int8_t>& byte_array =
107 data->resize(byte_array.size());
108 for (
size_t i = 0;
i < byte_array.size(); ++
i) {
109 (*data)[
i] = byte_array[
i];
125 absl::make_unique<FakeBinderTunnel>());
131 return absl::make_unique<FakeTransactionReceiver>(wire_reader_ref,
cb);
139 return absl::make_unique<FakeBinder>(
146 std::unique_ptr<FakeBinderTunnel> tunnel)
147 : wire_reader_ref_(
std::
move(wire_reader_ref)),
151 recv_endpoint->
owner =
this;
173 if (!
terminated_.load(std::memory_order_seq_cst)) {
175 terminated_.store(
true, std::memory_order_seq_cst);
183 if (
now < deliver_time_) {
198 if (tx_queue_.empty()) {
205 if (!tx_queue_.empty()) {
211 auto parcel = absl::make_unique<FakeReadableParcel>(
std::move(
data));
212 tx_receiver->Receive(
tx_code, parcel.get()).IgnoreError();
217 while (!
terminated_.load(std::memory_order_seq_cst)) {
222 if (tx_queue_.empty()) {
229 if (!tx_queue_.empty()) {
235 auto parcel = absl::make_unique<FakeReadableParcel>(
std::move(
data));
236 tx_receiver->Receive(
tx_code, parcel.get()).IgnoreError();
252 if (tx_queue_.empty()) {
266 std::pair<std::unique_ptr<Binder>, std::unique_ptr<TransactionReceiver>>
268 auto tx_receiver = absl::make_unique<FakeTransactionReceiver>(
270 std::unique_ptr<Binder> sender = tx_receiver->GetSender();
std::unique_ptr< FakeBinderTunnel > tunnel_
FakeBinderTunnel * tunnel
absl::Status WriteString(absl::string_view s) override
absl::Status WriteInt64(int64_t data) override
int32_t GetDataSize() const override
absl::Status ReadString(std::string *str) override
absl::Duration GetRandomDelay()
constexpr Duration Nanoseconds(T n)
void * GetRawBinder() override
absl::Status Transact(BinderTransportTxCode tx_code) override
memory_internal::MakeUniqueResult< T >::scalar make_unique(Args &&... args)
Status InternalError(absl::string_view message)
void SleepFor(absl::Duration duration)
void EnQueueTransaction(FakeEndpoint *target, BinderTransportTxCode tx_code, FakeData data)
absl::Status WriteBinder(HasRawBinder *binder) override
absl::Status ReadBinder(std::unique_ptr< Binder > *data) override
std::unique_ptr< FakeEndpoint > send_endpoint_
void WaitForNextTransaction() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
void Lock() ABSL_EXCLUSIVE_LOCK_FUNCTION()
PersistentFakeTransactionReceiver & NewPersistentTxReceiver(grpc_core::RefCountedPtr< WireReader > wire_reader_ref, TransactionReceiver::OnTransactCb cb, std::unique_ptr< FakeBinderTunnel > tunnel)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
PersistentFakeTransactionReceiver * persistent_tx_receiver_
constexpr bool holds_alternative(const variant< Types... > &v) noexcept
grpc_core::Thread tx_thread_
std::pair< std::unique_ptr< Binder >, std::unique_ptr< TransactionReceiver > > NewBinderPair(TransactionReceiver::OnTransactCb transact_cb)
ABSL_NAMESPACE_BEGIN Time Now()
void Unlock() ABSL_UNLOCK_FUNCTION()
absl::Status ReadInt64(int64_t *data) override
absl::Status ReadInt32(int32_t *data) override
std::function< absl::Status(transaction_code_t, ReadableParcel *, int uid)> OnTransactCb
absl::Status ReadByteArray(std::string *data) override
std::atomic< bool > terminated_
grpc_core::ExecCtx exec_ctx
FakeTransactionReceiver(grpc_core::RefCountedPtr< WireReader > wire_reader_ref, TransactionReceiver::OnTransactCb cb)
void EnQueueTransaction(FakeEndpoint *target, BinderTransportTxCode tx_code, FakeData data)
TransactionProcessor(absl::Duration delay=absl::ZeroDuration())
virtual void * GetRawBinder()=0
std::vector< absl::variant< int32_t, int64_t, void *, std::string, std::vector< int8_t > >> FakeData
std::unique_ptr< TransactionReceiver > ConstructTxReceiver(grpc_core::RefCountedPtr< WireReader > wire_reader_ref, TransactionReceiver::OnTransactCb transact_cb) const override
absl::Status WriteInt32(int32_t data) override
PersistentFakeTransactionReceiver(grpc_core::RefCountedPtr< WireReader > wire_reader_ref, TransactionReceiver::OnTransactCb cb, std::unique_ptr< FakeBinderTunnel > tunnel)
absl::Status WriteByteArray(const int8_t *buffer, int32_t length) override
std::unique_ptr< FakeEndpoint > recv_endpoint_
std::unique_ptr< FakeWritableParcel > input_
TransactionProcessor * g_transaction_processor
OPENSSL_EXPORT pem_password_cb * cb
void SetDelay(absl::Duration delay)
int64_t ToInt64Nanoseconds(Duration d)
std::unique_ptr< Binder > GetSender() const
int32_t GetDataSize() const override
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:22