// Copyright (c) 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef IPC_IPC_PERFTEST_SUPPORT_H_ #define IPC_IPC_PERFTEST_SUPPORT_H_ #include #include "ipc/ipc_test_base.h" namespace IPC { namespace test { class ChannelReflectorListener; class PingPongTestParams { public: PingPongTestParams(size_t size, int count) : message_size_(size), message_count_(count) { } size_t message_size() const { return message_size_; } int message_count() const { return message_count_; } private: size_t message_size_; int message_count_; }; class IPCChannelPerfTestBase : public IPCTestBase { public: static std::vector GetDefaultTestParams(); void RunTestChannelPingPong( const std::vector& params_list); void RunTestChannelProxyPingPong( const std::vector& params_list); }; class PingPongTestClient { public: PingPongTestClient(); virtual ~PingPongTestClient(); virtual scoped_ptr CreateChannel(Listener* listener); int RunMain(); scoped_refptr task_runner(); private: base::MessageLoopForIO main_message_loop_; scoped_ptr listener_; scoped_ptr channel_; }; } } #endif // IPC_IPC_PERFTEST_SUPPORT_H_