| 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 <unistd.h> | 10 #include <unistd.h> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | |
| 13 #include "base/posix/eintr_wrapper.h" | 12 #include "base/posix/eintr_wrapper.h" |
| 14 #include "ipc/ipc_platform_file_attachment_posix.h" | 13 #include "ipc/ipc_platform_file_attachment_posix.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 15 |
| 17 namespace IPC { | 16 namespace IPC { |
| 18 namespace { | 17 namespace { |
| 19 | 18 |
| 20 // Get a safe file descriptor for test purposes. | 19 // Get a safe file descriptor for test purposes. |
| 21 int GetSafeFd() { | 20 int GetSafeFd() { |
| 22 return open("/dev/null", O_RDONLY); | 21 return open("/dev/null", O_RDONLY); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 const int fd = GetSafeFd(); | 201 const int fd = GetSafeFd(); |
| 203 ASSERT_TRUE(set->AddAttachment( | 202 ASSERT_TRUE(set->AddAttachment( |
| 204 new internal::PlatformFileAttachment(base::ScopedFD(fd)))); | 203 new internal::PlatformFileAttachment(base::ScopedFD(fd)))); |
| 205 set->CommitAll(); | 204 set->CommitAll(); |
| 206 | 205 |
| 207 ASSERT_TRUE(VerifyClosed(fd)); | 206 ASSERT_TRUE(VerifyClosed(fd)); |
| 208 } | 207 } |
| 209 | 208 |
| 210 } // namespace | 209 } // namespace |
| 211 } // namespace IPC | 210 } // namespace IPC |
| OLD | NEW |