17 #ifndef PAGESPEED_CONTROLLER_GRPC_SERVER_TEST_H_
18 #define PAGESPEED_CONTROLLER_GRPC_SERVER_TEST_H_
29 namespace net_instaweb {
39 void SetUp()
override;
55 : channel_(::grpc::CreateChannel(
56 address, ::grpc::InsecureChannelCredentials())) {
59 ::grpc::ClientContext client_ctx_;
60 std::shared_ptr<::grpc::Channel> channel_;
63 std::unique_ptr<ThreadSystem> thread_system_;
64 std::unique_ptr<::grpc::ServerCompletionQueue> queue_;
69 GrpcServerThread(::grpc::CompletionQueue* queue,
71 virtual ~GrpcServerThread();
77 ::grpc::CompletionQueue* queue_;
81 virtual void RegisterServices(::grpc::ServerBuilder*) = 0;
83 std::unique_ptr<GrpcServerThread> server_thread_;
84 std::unique_ptr<::grpc::Server> server_;
Definition: grpc_server_test.h:33
Holder for various pieces of a client connection.
Definition: grpc_server_test.h:52
Definition: function.h:47
void SetUp() override
Binds server_ to the address returned by ListenAddress().
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
void QueueFunctionForServerThread(Function *func)
void StopServer()
Blocks until server_ is stopped.
Definition: thread_system.h:40
Base class for client thread code.
Definition: thread.h:34