Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Side by Side Diff: mojo/edk/system/message_pipe_perftest.cc

Issue 728783003: Add infrastructure to run tests on android. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stdint.h> 5 #include <stdint.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 MOJO_RESULT_OK); 133 MOJO_RESULT_OK);
134 } 134 }
135 135
136 mp->Close(0); 136 mp->Close(0);
137 return rv; 137 return rv;
138 } 138 }
139 139
140 // Repeatedly sends messages as previous one got replied by the child. 140 // Repeatedly sends messages as previous one got replied by the child.
141 // Waits for the child to close its end before quitting once specified 141 // Waits for the child to close its end before quitting once specified
142 // number of messages has been sent. 142 // number of messages has been sent.
143 TEST_F(MultiprocessMessagePipePerfTest, PingPong) { 143 #if defined(OS_ANDROID)
144 // Android multi-process tests are not executing the new process. This is flaky.
viettrungluu 2014/11/25 16:45:09 "
145 #define MAYBE_PingPong DISABLED_PingPong
146 #else
147 #define MAYBE_PingPong PingPong
148 #endif // defined(OS_ANDROID)
149 TEST_F(MultiprocessMessagePipePerfTest, MAYBE_PingPong) {
144 helper()->StartChild("PingPongClient"); 150 helper()->StartChild("PingPongClient");
145 151
146 scoped_refptr<ChannelEndpoint> ep; 152 scoped_refptr<ChannelEndpoint> ep;
147 scoped_refptr<MessagePipe> mp(MessagePipe::CreateLocalProxy(&ep)); 153 scoped_refptr<MessagePipe> mp(MessagePipe::CreateLocalProxy(&ep));
148 Init(ep); 154 Init(ep);
149 155
150 // This values are set to align with one at ipc_pertests.cc for comparison. 156 // This values are set to align with one at ipc_pertests.cc for comparison.
151 const size_t kMsgSize[5] = {12, 144, 1728, 20736, 248832}; 157 const size_t kMsgSize[5] = {12, 144, 1728, 20736, 248832};
152 const int kMessageCount[5] = {50000, 50000, 50000, 12000, 1000}; 158 const int kMessageCount[5] = {50000, 50000, 50000, 12000, 1000};
153 159
154 for (size_t i = 0; i < 5; i++) { 160 for (size_t i = 0; i < 5; i++) {
155 SetUpMeasurement(kMessageCount[i], kMsgSize[i]); 161 SetUpMeasurement(kMessageCount[i], kMsgSize[i]);
156 Measure(mp); 162 Measure(mp);
157 } 163 }
158 164
159 SendQuitMessage(mp); 165 SendQuitMessage(mp);
160 mp->Close(0); 166 mp->Close(0);
161 EXPECT_EQ(0, helper()->WaitForChildShutdown()); 167 EXPECT_EQ(0, helper()->WaitForChildShutdown());
162 } 168 }
163 169
164 } // namespace 170 } // namespace
165 } // namespace system 171 } // namespace system
166 } // namespace mojo 172 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698