1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_TEST_RENDER_THREAD_IMPL_BROWSER_TEST_IPC_HELPER_H_
6 #define CONTENT_TEST_RENDER_THREAD_IMPL_BROWSER_TEST_IPC_HELPER_H_
8 #include "content/app/mojo/mojo_init.h"
9 #include "content/browser/mojo/mojo_application_host.h"
10 #include "content/common/mojo/mojo_messages.h"
11 #include "ipc/ipc_channel_proxy.h"
12 #include "ipc/mojo/ipc_channel_mojo.h"
15 class ChannelMojoHost
;
22 // Helper for RenderThreadImplBrowserTest which takes care of setting up an IPC
23 // server, capable of sending messages to the RenderThread.
24 class RenderThreadImplBrowserIPCTestHelper
{
26 RenderThreadImplBrowserIPCTestHelper();
27 ~RenderThreadImplBrowserIPCTestHelper();
29 IPC::Sender
* Sender() const { return channel_
.get(); }
31 base::MessageLoop
* GetMessageLoop() const { return message_loop_
.get(); }
33 const std::string
& GetChannelId() const { return channel_id_
; }
38 void SetupIpcThread();
41 scoped_ptr
<IPC::ChannelProxy
> channel_
;
42 scoped_ptr
<base::Thread
> ipc_thread_
;
43 scoped_ptr
<base::MessageLoopForIO
> message_loop_
;
44 scoped_ptr
<DummyListener
> dummy_listener_
;
45 scoped_ptr
<MojoApplicationHost
> mojo_application_host_
;
46 scoped_ptr
<IPC::ChannelMojoHost
> mojo_host_
;
47 std::string channel_id_
;
50 } // namespace content
52 #endif // CONTENT_TEST_RENDER_THREAD_IMPL_BROWSER_TEST_IPC_HELPER_H_