| Index: ipc/ipc_test_base.h
|
| diff --git a/ipc/ipc_test_base.h b/ipc/ipc_test_base.h
|
| index 8a84fb672786daf12173017fac8e8d799be87e0e..3cce91053154fdc1ec5574e9bdcd786569842e02 100644
|
| --- a/ipc/ipc_test_base.h
|
| +++ b/ipc/ipc_test_base.h
|
| @@ -137,6 +137,30 @@ class IPCTestBase : public base::MultiProcessTest {
|
|
|
| class IPCChannelMojoTestBase : public testing::Test {
|
| public:
|
| + class ClientHandle {
|
| + public:
|
| + ClientHandle();
|
| + ~ClientHandle();
|
| +
|
| + void Init(const std::string& test_client_name);
|
| + void CreateChannel(IPC::Listener* listener);
|
| + bool ConnectChannel();
|
| + void DestroyChannel();
|
| + bool WaitForShutdown();
|
| +
|
| + mojo::ScopedMessagePipeHandle TakeHandle();
|
| +
|
| + IPC::Channel* channel() { return channel_.get(); }
|
| + const base::Process& process() const { return helper_.test_child(); }
|
| +
|
| + private:
|
| + mojo::ScopedMessagePipeHandle pipe_;
|
| + mojo::edk::test::MultiprocessTestHelper helper_;
|
| + std::unique_ptr<IPC::Channel> channel_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ClientHandle);
|
| + };
|
| +
|
| IPCChannelMojoTestBase();
|
| ~IPCChannelMojoTestBase() override;
|
|
|
| @@ -153,19 +177,17 @@ class IPCChannelMojoTestBase : public testing::Test {
|
| void DestroyChannel();
|
|
|
| IPC::Sender* sender() { return channel(); }
|
| - IPC::Channel* channel() { return channel_.get(); }
|
| - const base::Process& client_process() const { return helper_.test_child(); }
|
| + IPC::Channel* channel() { return primary_client_.channel(); }
|
| + const base::Process& client_process() const {
|
| + return primary_client_.process();
|
| + }
|
|
|
| protected:
|
| mojo::ScopedMessagePipeHandle TakeHandle();
|
|
|
| private:
|
| base::MessageLoop message_loop_;
|
| -
|
| - mojo::ScopedMessagePipeHandle handle_;
|
| - mojo::edk::test::MultiprocessTestHelper helper_;
|
| -
|
| - std::unique_ptr<IPC::Channel> channel_;
|
| + ClientHandle primary_client_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(IPCChannelMojoTestBase);
|
| };
|
|
|