diff options
author | morrita <morrita@chromium.org> | 2014-08-28 17:20:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-29 00:22:30 +0000 |
commit | d36736cd2b6763bc9eb4e089b07fff0e8d1c534c (patch) | |
tree | 77ce2700c24701694238728535e50d0ef9c09957 /ipc/ipc_test_base.h | |
parent | 398c37dd4d9cd995f195e0d95014bb3cf6fa3356 (diff) | |
download | chromium_src-d36736cd2b6763bc9eb4e089b07fff0e8d1c534c.zip chromium_src-d36736cd2b6763bc9eb4e089b07fff0e8d1c534c.tar.gz chromium_src-d36736cd2b6763bc9eb4e089b07fff0e8d1c534c.tar.bz2 |
Add ChannelProxy benchmark to ipc_perftests.
This CL add a ChannelProxy equivalent of the Channel benchmark
to ipc_perftests.
To use it in the benchmark, TestIOThread is extracted from
mojo/system/ to base/test
TEST=IPChannelPerfTest.ChannelProxyPingPong
R=viettrungluu@chromium.org,brettw@chromium.org,darin@chromium.org
BUG=none
Review URL: https://codereview.chromium.org/488003003
Cr-Commit-Position: refs/heads/master@{#292518}
Diffstat (limited to 'ipc/ipc_test_base.h')
-rw-r--r-- | ipc/ipc_test_base.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ipc/ipc_test_base.h b/ipc/ipc_test_base.h index ce3328a..acad477 100644 --- a/ipc/ipc_test_base.h +++ b/ipc/ipc_test_base.h @@ -16,7 +16,7 @@ #include "ipc/ipc_multiprocess_test.h" namespace base { -class MessageLoopForIO; +class MessageLoop; } // A test fixture for multiprocess IPC tests. Such tests include a "client" side @@ -86,11 +86,21 @@ class IPCTestBase : public base::MultiProcessTest { IPC::ChannelProxy* channel_proxy() { return channel_proxy_.get(); } const base::ProcessHandle& client_process() const { return client_process_; } - scoped_refptr<base::TaskRunner> io_thread_task_runner(); + scoped_refptr<base::TaskRunner> task_runner(); + + // Some tests creates separate thread for IO message loop and Run + // non-IO message loop on the main thread. As IPCTestBase creates IO + // message loop by default, such tests might want to replace it with + // non-IO one using set_message_loop(). + // + // The replacement should be done at the beginning of the test. + // You should be careful not to replace "live" message loop that has + // started running. + void set_message_loop(scoped_ptr<base::MessageLoop> loop); private: std::string test_client_name_; - scoped_ptr<base::MessageLoopForIO> message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; scoped_ptr<IPC::Channel> channel_; scoped_ptr<IPC::ChannelProxy> channel_proxy_; |