OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ipc/ipc_perftest_support.h" | 5 #include "ipc/ipc_perftest_support.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 std::vector<PingPongTestParams> | 223 std::vector<PingPongTestParams> |
224 IPCChannelPerfTestBase::GetDefaultTestParams() { | 224 IPCChannelPerfTestBase::GetDefaultTestParams() { |
225 // Test several sizes. We use 12^N for message size, and limit the message | 225 // Test several sizes. We use 12^N for message size, and limit the message |
226 // count to keep the test duration reasonable. | 226 // count to keep the test duration reasonable. |
227 std::vector<PingPongTestParams> list; | 227 std::vector<PingPongTestParams> list; |
228 list.push_back(PingPongTestParams(12, 50000)); | 228 list.push_back(PingPongTestParams(12, 50000)); |
229 list.push_back(PingPongTestParams(144, 50000)); | 229 list.push_back(PingPongTestParams(144, 50000)); |
230 list.push_back(PingPongTestParams(1728, 50000)); | 230 list.push_back(PingPongTestParams(1728, 50000)); |
231 list.push_back(PingPongTestParams(20736, 12000)); | 231 list.push_back(PingPongTestParams(20736, 12000)); |
232 list.push_back(PingPongTestParams(248832, 100)); | 232 list.push_back(PingPongTestParams(248832, 1000)); |
233 return list; | 233 return list; |
234 } | 234 } |
235 | 235 |
236 void IPCChannelPerfTestBase::RunTestChannelPingPong( | 236 void IPCChannelPerfTestBase::RunTestChannelPingPong( |
237 const std::vector<PingPongTestParams>& params) { | 237 const std::vector<PingPongTestParams>& params) { |
238 Init("PerformanceClient"); | 238 Init("PerformanceClient"); |
239 | 239 |
240 // Set up IPC channel and start client. | 240 // Set up IPC channel and start client. |
241 PerformanceChannelListener listener("Channel"); | 241 PerformanceChannelListener listener("Channel"); |
242 CreateChannel(&listener); | 242 CreateChannel(&listener); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 base::MessageLoop::current()->Run(); | 333 base::MessageLoop::current()->Run(); |
334 return 0; | 334 return 0; |
335 } | 335 } |
336 | 336 |
337 scoped_refptr<base::TaskRunner> PingPongTestClient::task_runner() { | 337 scoped_refptr<base::TaskRunner> PingPongTestClient::task_runner() { |
338 return main_message_loop_.message_loop_proxy(); | 338 return main_message_loop_.message_loop_proxy(); |
339 } | 339 } |
340 | 340 |
341 } // namespace test | 341 } // namespace test |
342 } // namespace IPC | 342 } // namespace IPC |
OLD | NEW |