| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| 11 #include <unistd.h> | 11 #include <unistd.h> |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 TEST_F(IPCChannelTest, Performance) { | 429 TEST_F(IPCChannelTest, Performance) { |
| 430 // setup IPC channel | 430 // setup IPC channel |
| 431 IPC::Channel chan(kReflectorChannel, IPC::Channel::MODE_SERVER, NULL); | 431 IPC::Channel chan(kReflectorChannel, IPC::Channel::MODE_SERVER, NULL); |
| 432 ChannelPerfListener perf_listener(&chan, 10000, 100000); | 432 ChannelPerfListener perf_listener(&chan, 10000, 100000); |
| 433 chan.set_listener(&perf_listener); | 433 chan.set_listener(&perf_listener); |
| 434 chan.Connect(); | 434 chan.Connect(); |
| 435 | 435 |
| 436 HANDLE process = SpawnChild(TEST_REFLECTOR, &chan); | 436 HANDLE process = SpawnChild(TEST_REFLECTOR, &chan); |
| 437 ASSERT_TRUE(process); | 437 ASSERT_TRUE(process); |
| 438 | 438 |
| 439 Sleep(1000); | 439 PlatformThread::Sleep(1000); |
| 440 | 440 |
| 441 PerfTimeLogger logger("IPC_Perf"); | 441 PerfTimeLogger logger("IPC_Perf"); |
| 442 | 442 |
| 443 // this initial message will kick-start the ping-pong of messages | 443 // this initial message will kick-start the ping-pong of messages |
| 444 IPC::Message* message = new IPC::Message(0, | 444 IPC::Message* message = new IPC::Message(0, |
| 445 2, | 445 2, |
| 446 IPC::Message::PRIORITY_NORMAL); | 446 IPC::Message::PRIORITY_NORMAL); |
| 447 message->WriteInt(GetTickCount()); | 447 message->WriteInt(GetTickCount()); |
| 448 message->WriteInt(-1); | 448 message->WriteInt(-1); |
| 449 message->WriteString("Hello"); | 449 message->WriteString("Hello"); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 472 #endif // PERFORMANCE_TEST | 472 #endif // PERFORMANCE_TEST |
| 473 | 473 |
| 474 int main(int argc, char** argv) { | 474 int main(int argc, char** argv) { |
| 475 #ifdef PERFORMANCE_TEST | 475 #ifdef PERFORMANCE_TEST |
| 476 int retval = PerfTestSuite(argc, argv).Run(); | 476 int retval = PerfTestSuite(argc, argv).Run(); |
| 477 #else | 477 #else |
| 478 int retval = TestSuite(argc, argv).Run(); | 478 int retval = TestSuite(argc, argv).Run(); |
| 479 #endif | 479 #endif |
| 480 return retval; | 480 return retval; |
| 481 } | 481 } |
| OLD | NEW |