1 // Copyright (c) 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 IPC_IPC_PERFTEST_SUPPORT_H_
6 #define IPC_IPC_PERFTEST_SUPPORT_H_
10 #include "ipc/ipc_test_base.h"
15 class ChannelReflectorListener
;
17 class PingPongTestParams
{
19 PingPongTestParams(size_t size
, int count
)
20 : message_size_(size
), message_count_(count
) {
23 size_t message_size() const { return message_size_
; }
24 int message_count() const { return message_count_
; }
31 class IPCChannelPerfTestBase
: public IPCTestBase
{
33 static std::vector
<PingPongTestParams
> GetDefaultTestParams();
35 void RunTestChannelPingPong(
36 const std::vector
<PingPongTestParams
>& params_list
);
37 void RunTestChannelProxyPingPong(
38 const std::vector
<PingPongTestParams
>& params_list
);
41 class PingPongTestClient
{
44 virtual ~PingPongTestClient();
46 virtual scoped_ptr
<Channel
> CreateChannel(Listener
* listener
);
48 scoped_refptr
<base::TaskRunner
> task_runner();
51 base::MessageLoopForIO main_message_loop_
;
52 scoped_ptr
<ChannelReflectorListener
> listener_
;
53 scoped_ptr
<Channel
> channel_
;
59 #endif // IPC_IPC_PERFTEST_SUPPORT_H_