summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_test_base.h
diff options
context:
space:
mode:
authormorrita <morrita@chromium.org>2014-09-23 14:16:00 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-23 21:16:28 +0000
commit54f6f80c3623a6fb9d3049b6f5e0e23b1d76c34d (patch)
treed5188994206cd43ae680f6e7325ec5c45075b9da /ipc/ipc_test_base.h
parentde9555146d87d2daf5e2e1da425d46b8efc06415 (diff)
downloadchromium_src-54f6f80c3623a6fb9d3049b6f5e0e23b1d76c34d.zip
chromium_src-54f6f80c3623a6fb9d3049b6f5e0e23b1d76c34d.tar.gz
chromium_src-54f6f80c3623a6fb9d3049b6f5e0e23b1d76c34d.tar.bz2
IPC::ChannelMojo: Introduce IPC::MojoBootstrap for Windows
ChannelMojo doesn't work on Windows with existing implementaion and this CL fixes it. On Windows, ChannelHandle isn't immediately usable: The handle has to be activated through ConnectNamedPipe() windows API, which is done in its own Connect() handlshaking phase. ChannelMojo didn't Connect() underlying channel and took the ChannelHandle over so the handle wasn't activated. Instead of hijacking underlying ChannelHandle, this CL actually Connect()s underlying channel, creates a pipe on the server side, send one side of the pipe to the client process, and use the pipe for the MessagePipe initialization. These initialization task is encapsulated behind new MojoBootstrap class. ChannelMojo creates MojoBootstrap class to get the PlatformHandle which is already activated and usable. BUG=377980 TEST=ipc_mojo_bootstrap_unittest.cc, ipc_channel_mojo_unittest.cc R=viettrungluu@chromium.org, darin@chromium.org, yzshen@chromium.org Review URL: https://codereview.chromium.org/553283002 Cr-Commit-Position: refs/heads/master@{#296248}
Diffstat (limited to 'ipc/ipc_test_base.h')
-rw-r--r--ipc/ipc_test_base.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/ipc/ipc_test_base.h b/ipc/ipc_test_base.h
index 8fdcbb0..65af35e 100644
--- a/ipc/ipc_test_base.h
+++ b/ipc/ipc_test_base.h
@@ -77,12 +77,19 @@ class IPCTestBase : public base::MultiProcessTest {
// done after connecting to the channel.
bool StartClient();
+#if defined(OS_POSIX)
+ // A StartClient() variant that allows caller to pass the FD of IPC pipe
+ bool StartClientWithFD(int ipcfd);
+#endif
+
// Waits for the client to shut down, returning true if successful. Note that
// this does not initiate client shutdown; that must be done by the test
// (somehow). This must be called before the end of the test whenever
// StartClient() was called successfully.
bool WaitForClientShutdown();
+ IPC::ChannelHandle GetTestChannelHandle();
+
// Use this to send IPC messages (when you don't care if you're using a
// channel or a proxy).
IPC::Sender* sender() {
@@ -99,7 +106,11 @@ class IPCTestBase : public base::MultiProcessTest {
virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory(
const IPC::ChannelHandle& handle, base::TaskRunner* runner);
+ virtual bool DidStartClient();
+
private:
+ std::string GetTestMainName() const;
+
std::string test_client_name_;
scoped_ptr<base::MessageLoop> message_loop_;