| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #if defined(OS_MACOSX) | 8 #if defined(OS_MACOSX) |
| 9 extern "C" { | 9 extern "C" { |
| 10 #include <sandbox.h> | 10 #include <sandbox.h> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "ipc/ipc_message_attachment_set.h" | 26 #include "ipc/ipc_message_attachment_set.h" |
| 27 #include "ipc/ipc_message_utils.h" | 27 #include "ipc/ipc_message_utils.h" |
| 28 #include "ipc/ipc_test_base.h" | 28 #include "ipc/ipc_test_base.h" |
| 29 | 29 |
| 30 #if defined(OS_POSIX) | 30 #if defined(OS_POSIX) |
| 31 #include "base/macros.h" | 31 #include "base/macros.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 const unsigned kNumFDsToSend = 128; // per message | 36 const unsigned kNumFDsToSend = 7; // per message |
| 37 const unsigned kNumMessages = 3; | 37 const unsigned kNumMessages = 20; |
| 38 const char* kDevZeroPath = "/dev/zero"; | 38 const char* kDevZeroPath = "/dev/zero"; |
| 39 | 39 |
| 40 #if defined(OS_POSIX) | 40 #if defined(OS_POSIX) |
| 41 static_assert(kNumFDsToSend == | 41 static_assert(kNumFDsToSend == |
| 42 IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage, | 42 IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage, |
| 43 "The number of FDs to send must be kMaxDescriptorsPerMessage."); | 43 "The number of FDs to send must be kMaxDescriptorsPerMessage."); |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 class MyChannelDescriptorListenerBase : public IPC::Listener { | 46 class MyChannelDescriptorListenerBase : public IPC::Listener { |
| 47 public: | 47 public: |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 base::WaitableEvent received_; | 378 base::WaitableEvent received_; |
| 379 }; | 379 }; |
| 380 | 380 |
| 381 TEST_F(IPCMultiSendingFdsTest, StressTest) { | 381 TEST_F(IPCMultiSendingFdsTest, StressTest) { |
| 382 Run(); | 382 Run(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace | 385 } // namespace |
| 386 | 386 |
| 387 #endif // defined(OS_POSIX) | 387 #endif // defined(OS_POSIX) |
| OLD | NEW |