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

Side by Side Diff: ipc/file_descriptor_set_posix_unittest.cc

Issue 5749001: Add support for sockets that can listen and accept a connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix up use of DCHECK which was causing release build failures Created 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ipc/ipc.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/file_descriptor_set_posix.h"
8
7 #include <unistd.h> 9 #include <unistd.h>
8 #include <fcntl.h> 10 #include <fcntl.h>
9 11
10 #include "base/basictypes.h" 12 #include "base/basictypes.h"
11 #include "base/eintr_wrapper.h" 13 #include "base/eintr_wrapper.h"
12 #include "ipc/file_descriptor_set_posix.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 namespace { 16 namespace {
16 17
17 // Get a safe file descriptor for test purposes. 18 // Get a safe file descriptor for test purposes.
18 int GetSafeFd() { 19 int GetSafeFd() {
19 return open("/dev/null", O_RDONLY); 20 return open("/dev/null", O_RDONLY);
20 } 21 }
21 22
22 // Returns true if fd was already closed. Closes fd if not closed. 23 // Returns true if fd was already closed. Closes fd if not closed.
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 scoped_refptr<FileDescriptorSet> set(new FileDescriptorSet); 170 scoped_refptr<FileDescriptorSet> set(new FileDescriptorSet);
170 171
171 const int fd = GetSafeFd(); 172 const int fd = GetSafeFd();
172 ASSERT_TRUE(set->AddAndAutoClose(fd)); 173 ASSERT_TRUE(set->AddAndAutoClose(fd));
173 set->CommitAll(); 174 set->CommitAll();
174 175
175 ASSERT_TRUE(VerifyClosed(fd)); 176 ASSERT_TRUE(VerifyClosed(fd));
176 } 177 }
177 178
178 } // namespace 179 } // namespace
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698