diff options
author | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 06:34:52 +0000 |
---|---|---|
committer | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 06:34:52 +0000 |
commit | e097b93086bf7be065d7400aece5edad6aca1bd6 (patch) | |
tree | a7cb6a09bd23cc4be97952689147fed2892a713e /ipc/ipc_perftests.cc | |
parent | 5408dd86637ca2a5d90b65d32d5bd3bc54c8bbbd (diff) | |
download | chromium_src-e097b93086bf7be065d7400aece5edad6aca1bd6.zip chromium_src-e097b93086bf7be065d7400aece5edad6aca1bd6.tar.gz chromium_src-e097b93086bf7be065d7400aece5edad6aca1bd6.tar.bz2 |
IPC: Make ipc_perftests run on Android.
There was several minor issues:
- Base perf logging file location was off-limits on Android
- Printf needs to be flushed to be visible on Android.
- Android needs to reset the 'PipeMap' manually since we can't 'exec' after
forking a test process. If we don't do this the Channel thinks we are in a single-
process test and tries to open an FD which was closed during forking.
- Android's base file descriptor needs to be increased to prevent stomping
the android native logging file-descriptor with the default pipe.
- The test took too long, so the 'exponent' is reduced from 5 to 3
- We need an APK
With this patch the test runs like on other platforms, and lots of testing code is
fixed such that it works the same way on all platforms.
BUG=345471
Review URL: https://codereview.chromium.org/196343019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257877 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_perftests.cc')
-rw-r--r-- | ipc/ipc_perftests.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ipc/ipc_perftests.cc b/ipc/ipc_perftests.cc index e7eeab9..d0d7e0d 100644 --- a/ipc/ipc_perftests.cc +++ b/ipc/ipc_perftests.cc @@ -230,12 +230,13 @@ TEST_F(IPCChannelPerfTest, Performance) { ASSERT_TRUE(ConnectChannel()); ASSERT_TRUE(StartClient()); - const size_t kMsgSizeBase = 12; - const int kMsgSizeMaxExp = 5; - int msg_count = 100000; - size_t msg_size = kMsgSizeBase; - for (int i = 1; i <= kMsgSizeMaxExp; i++) { - listener.SetTestParams(msg_count, msg_size); + // Test several sizes. We use 12^N for message size, and limit the message + // count to keep the test duration reasonable. + const size_t kMsgSize[5] = {12, 144, 1728, 20736, 248832}; + const size_t kMessageCount[5] = {50000, 50000, 50000, 12000, 1000}; + + for (size_t i = 0; i < 5; i++) { + listener.SetTestParams(kMessageCount[i], kMsgSize[i]); // This initial message will kick-start the ping-pong of messages. IPC::Message* message = @@ -247,8 +248,6 @@ TEST_F(IPCChannelPerfTest, Performance) { // Run message loop. base::MessageLoop::current()->Run(); - - msg_size *= kMsgSizeBase; } // Send quit message. |