OLD | NEW |
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 "ipc/mojo/ipc_channel_mojo.h" | 5 #include "ipc/mojo/ipc_channel_mojo.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 } | 232 } |
233 | 233 |
234 TEST_F(IPCChannelMojoErrorTest, SendFailWithPendingMessages) { | 234 TEST_F(IPCChannelMojoErrorTest, SendFailWithPendingMessages) { |
235 Init("IPCChannelMojoErraticTestClient"); | 235 Init("IPCChannelMojoErraticTestClient"); |
236 | 236 |
237 // Set up IPC channel and start client. | 237 // Set up IPC channel and start client. |
238 ListenerExpectingErrors listener; | 238 ListenerExpectingErrors listener; |
239 CreateChannel(&listener); | 239 CreateChannel(&listener); |
240 ASSERT_TRUE(ConnectChannel()); | 240 ASSERT_TRUE(ConnectChannel()); |
241 | 241 |
242 // This matches a value in mojo/edk/system/constants.h | 242 // This matches a value in mojo/system/constants.h |
243 const int kMaxMessageNumBytes = 4 * 1024 * 1024; | 243 const int kMaxMessageNumBytes = 4 * 1024 * 1024; |
244 std::string overly_large_data(kMaxMessageNumBytes, '*'); | 244 std::string overly_large_data(kMaxMessageNumBytes, '*'); |
245 // This messages are queued as pending. | 245 // This messages are queued as pending. |
246 for (size_t i = 0; i < 10; ++i) { | 246 for (size_t i = 0; i < 10; ++i) { |
247 IPC::TestChannelListener::SendOneMessage( | 247 IPC::TestChannelListener::SendOneMessage( |
248 sender(), overly_large_data.c_str()); | 248 sender(), overly_large_data.c_str()); |
249 } | 249 } |
250 | 250 |
251 ASSERT_TRUE(StartClient()); | 251 ASSERT_TRUE(StartClient()); |
252 base::MessageLoop::current()->Run(); | 252 base::MessageLoop::current()->Run(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 client.Connect(); | 341 client.Connect(); |
342 listener.set_sender(client.channel()); | 342 listener.set_sender(client.channel()); |
343 | 343 |
344 base::MessageLoop::current()->Run(); | 344 base::MessageLoop::current()->Run(); |
345 | 345 |
346 return 0; | 346 return 0; |
347 } | 347 } |
348 #endif | 348 #endif |
349 | 349 |
350 } // namespace | 350 } // namespace |
OLD | NEW |