OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This test is POSIX only. | 5 // This test is POSIX only. |
6 | 6 |
7 #include "ipc/ipc_message_attachment_set.h" | 7 #include "ipc/ipc_message_attachment_set.h" |
8 | 8 |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <stddef.h> |
10 #include <unistd.h> | 11 #include <unistd.h> |
11 | 12 |
12 #include "base/posix/eintr_wrapper.h" | 13 #include "base/posix/eintr_wrapper.h" |
| 14 #include "build/build_config.h" |
13 #include "ipc/ipc_platform_file_attachment_posix.h" | 15 #include "ipc/ipc_platform_file_attachment_posix.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
15 | 17 |
16 namespace IPC { | 18 namespace IPC { |
17 namespace { | 19 namespace { |
18 | 20 |
19 // Get a safe file descriptor for test purposes. | 21 // Get a safe file descriptor for test purposes. |
20 int GetSafeFd() { | 22 int GetSafeFd() { |
21 return open("/dev/null", O_RDONLY); | 23 return open("/dev/null", O_RDONLY); |
22 } | 24 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 const int fd = GetSafeFd(); | 211 const int fd = GetSafeFd(); |
210 ASSERT_TRUE(set->AddAttachment( | 212 ASSERT_TRUE(set->AddAttachment( |
211 new internal::PlatformFileAttachment(base::ScopedFD(fd)))); | 213 new internal::PlatformFileAttachment(base::ScopedFD(fd)))); |
212 set->CommitAllDescriptors(); | 214 set->CommitAllDescriptors(); |
213 | 215 |
214 ASSERT_TRUE(VerifyClosed(fd)); | 216 ASSERT_TRUE(VerifyClosed(fd)); |
215 } | 217 } |
216 | 218 |
217 } // namespace | 219 } // namespace |
218 } // namespace IPC | 220 } // namespace IPC |
OLD | NEW |