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

Side by Side Diff: ipc/ipc_send_fds_test.cc

Issue 11865015: Move IPC tests into anonymous namespaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 11 months 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 | « ipc/ipc_perftests.cc ('k') | ipc/ipc_sync_channel_unittest.cc » ('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) 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_MACOSX) 7 #if defined(OS_MACOSX)
8 extern "C" { 8 extern "C" {
9 #include <sandbox.h> 9 #include <sandbox.h>
10 } 10 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // Run message loop so IPC Channel can handle message IO. 122 // Run message loop so IPC Channel can handle message IO.
123 MessageLoop::current()->Run(); 123 MessageLoop::current()->Run();
124 124
125 // Verify that the message loop was exited due to getting the correct 125 // Verify that the message loop was exited due to getting the correct
126 // number of descriptors, and not because the channel closing unexpectedly. 126 // number of descriptors, and not because the channel closing unexpectedly.
127 CHECK(listener.GotExpectedNumberOfDescriptors()); 127 CHECK(listener.GotExpectedNumberOfDescriptors());
128 128
129 return 0; 129 return 0;
130 } 130 }
131 131
132 } // namespace
133
134 class IPCSendFdsTest : public IPCTestBase { 132 class IPCSendFdsTest : public IPCTestBase {
135 }; 133 };
136 134
137 #if defined(OS_MACOSX) 135 #if defined(OS_MACOSX)
138 // TODO(port): Make this test cross-platform. 136 // TODO(port): Make this test cross-platform.
139 MULTIPROCESS_IPC_TEST_MAIN(RunTestDescriptorClientSandboxed) { 137 MULTIPROCESS_IPC_TEST_MAIN(RunTestDescriptorClientSandboxed) {
140 struct stat st; 138 struct stat st;
141 const int fd = open(kDevZeroPath, O_RDONLY); 139 const int fd = open(kDevZeroPath, O_RDONLY);
142 fstat(fd, &st); 140 fstat(fd, &st);
143 if (HANDLE_EINTR(close(fd)) < 0) { 141 if (HANDLE_EINTR(close(fd)) < 0) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 194
197 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_SERVER, 195 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_SERVER,
198 &listener); 196 &listener);
199 ASSERT_TRUE(chan.Connect()); 197 ASSERT_TRUE(chan.Connect());
200 198
201 base::ProcessHandle process_handle = SpawnChild(TEST_DESCRIPTOR_CLIENT, 199 base::ProcessHandle process_handle = SpawnChild(TEST_DESCRIPTOR_CLIENT,
202 &chan); 200 &chan);
203 TestDescriptorServer(chan, process_handle); 201 TestDescriptorServer(chan, process_handle);
204 } 202 }
205 203
204 } // namespace
205
206 #endif // defined(OS_POSIX) 206 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « ipc/ipc_perftests.cc ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698