Skip to content

Commit

Permalink
fixup: make test compile
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneo committed Nov 9, 2023
1 parent 3c5721f commit cc0e32e
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions test/core/ext/xds/xds_transport_grpc_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,26 @@ namespace grpc_core {
namespace testing {
namespace {

using EventHandlerEvent = absl::variant<
bool, absl::Status,
std::pair<std::string, RefCountedPtr<XdsTransportFactory::XdsTransport::
StreamingCall::ReadDelayHandle>>>;
using EventHandlerEvent = absl::variant<bool, absl::Status, std::string>;

class TestEventHandler
: public XdsTransportFactory::XdsTransport::StreamingCall::EventHandler {
public:
explicit TestEventHandler(std::vector<EventHandler>* events)
explicit TestEventHandler(std::vector<EventHandlerEvent>* events)
: events_(events) {}

void OnRequestSent(bool ok) override { events_->emplace_back(ok); }

void OnRecvMessage(
absl::string_view payload,
RefCountedPtr<
XdsTransportFactory::XdsTransport::StreamingCall::ReadDelayHandle>
read_delay_handle) override {
events_->emplace_back(
std::make_pair(std::string(payload), std::move(read_delay_handle)));
void OnRecvMessage(absl::string_view payload) override {
events_->emplace_back(std::string(payload));
}

void OnStatusReceived(absl::Status status) override {
events_->emplace_back(std::move(status));
}

private:
std::vector<EventHandler>* events_;
std::vector<EventHandlerEvent>* events_;
};

class AdsServer {
Expand Down

0 comments on commit cc0e32e

Please sign in to comment.