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

Side by Side Diff: ipc/ipc_channel_posix_unittest.cc

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « content/common/sandbox_mac_fontloading_unittest.mm ('k') | net/base/file_stream_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 // These tests are POSIX only. 5 // These tests are POSIX only.
6 6
7 #include "ipc/ipc_channel_posix.h" 7 #include "ipc/ipc_channel_posix.h"
8 8
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <sys/socket.h> 10 #include <sys/socket.h>
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 IPCChannelPosixTestListener listener(false); 368 IPCChannelPosixTestListener listener(false);
369 IPC::ChannelHandle chan_handle(GetConnectionSocketName()); 369 IPC::ChannelHandle chan_handle(GetConnectionSocketName());
370 IPC::Channel channel(chan_handle, IPC::Channel::MODE_NONE, &listener); 370 IPC::Channel channel(chan_handle, IPC::Channel::MODE_NONE, &listener);
371 ASSERT_FALSE(channel.Connect()); 371 ASSERT_FALSE(channel.Connect());
372 } 372 }
373 373
374 TEST_F(IPCChannelPosixTest, IsNamedServerInitialized) { 374 TEST_F(IPCChannelPosixTest, IsNamedServerInitialized) {
375 const std::string& connection_socket_name = GetConnectionSocketName(); 375 const std::string& connection_socket_name = GetConnectionSocketName();
376 IPCChannelPosixTestListener listener(false); 376 IPCChannelPosixTestListener listener(false);
377 IPC::ChannelHandle chan_handle(connection_socket_name); 377 IPC::ChannelHandle chan_handle(connection_socket_name);
378 ASSERT_TRUE(file_util::Delete(base::FilePath(connection_socket_name), false)); 378 ASSERT_TRUE(base::Delete(base::FilePath(connection_socket_name), false));
379 ASSERT_FALSE(IPC::Channel::IsNamedServerInitialized( 379 ASSERT_FALSE(IPC::Channel::IsNamedServerInitialized(
380 connection_socket_name)); 380 connection_socket_name));
381 IPC::Channel channel(chan_handle, IPC::Channel::MODE_NAMED_SERVER, &listener); 381 IPC::Channel channel(chan_handle, IPC::Channel::MODE_NAMED_SERVER, &listener);
382 ASSERT_TRUE(IPC::Channel::IsNamedServerInitialized( 382 ASSERT_TRUE(IPC::Channel::IsNamedServerInitialized(
383 connection_socket_name)); 383 connection_socket_name));
384 channel.Close(); 384 channel.Close();
385 ASSERT_FALSE(IPC::Channel::IsNamedServerInitialized( 385 ASSERT_FALSE(IPC::Channel::IsNamedServerInitialized(
386 connection_socket_name)); 386 connection_socket_name));
387 } 387 }
388 388
(...skipping 27 matching lines...) Expand all
416 if (connected) { 416 if (connected) {
417 IPCChannelPosixTest::SpinRunLoop(TestTimeouts::action_max_timeout()); 417 IPCChannelPosixTest::SpinRunLoop(TestTimeouts::action_max_timeout());
418 EXPECT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status()); 418 EXPECT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status());
419 } else { 419 } else {
420 EXPECT_EQ(IPCChannelPosixTestListener::DISCONNECTED, listener.status()); 420 EXPECT_EQ(IPCChannelPosixTestListener::DISCONNECTED, listener.status());
421 } 421 }
422 return 0; 422 return 0;
423 } 423 }
424 424
425 } // namespace 425 } // namespace
OLDNEW
« no previous file with comments | « content/common/sandbox_mac_fontloading_unittest.mm ('k') | net/base/file_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698