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

Unified Diff: ipc/ipc_channel_posix_unittest.cc

Issue 862823003: Use PathService to get temp dir name for IPC unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ipc/unix_domain_socket_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix_unittest.cc
diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc
index 93fc13cc0cd2ba4a6674c932cb94e218fb591e20..7280e450fc73aa1471fe597e9bd5a191f810188e 100644
--- a/ipc/ipc_channel_posix_unittest.cc
+++ b/ipc/ipc_channel_posix_unittest.cc
@@ -117,13 +117,9 @@ class IPCChannelPosixTest : public base::MultiProcessTest {
};
const std::string IPCChannelPosixTest::GetChannelDirName() {
-#if defined(OS_ANDROID)
base::FilePath tmp_dir;
- PathService::Get(base::DIR_CACHE, &tmp_dir);
+ PathService::Get(base::DIR_TEMP, &tmp_dir);
return tmp_dir.value();
-#else
- return "/var/tmp";
-#endif
}
const std::string IPCChannelPosixTest::GetConnectionSocketName() {
@@ -211,6 +207,7 @@ TEST_F(IPCChannelPosixTest, BasicListen) {
ASSERT_FALSE(channel->HasAcceptedConnection());
channel->ResetToAcceptingConnectionState();
ASSERT_FALSE(channel->HasAcceptedConnection());
+ unlink(handle.name.c_str());
}
TEST_F(IPCChannelPosixTest, BasicConnected) {
@@ -308,6 +305,7 @@ TEST_F(IPCChannelPosixTest, AdvancedConnected) {
EXPECT_EQ(0, exit_code);
ASSERT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status());
ASSERT_FALSE(channel->HasAcceptedConnection());
+ unlink(chan_handle.name.c_str());
}
TEST_F(IPCChannelPosixTest, ResetState) {
@@ -347,6 +345,7 @@ TEST_F(IPCChannelPosixTest, ResetState) {
EXPECT_EQ(0, exit_code);
ASSERT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status());
ASSERT_FALSE(channel->HasAcceptedConnection());
+ unlink(chan_handle.name.c_str());
}
TEST_F(IPCChannelPosixTest, BadChannelName) {
@@ -405,6 +404,7 @@ TEST_F(IPCChannelPosixTest, MultiConnection) {
EXPECT_EQ(exit_code, 0);
ASSERT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status());
ASSERT_FALSE(channel->HasAcceptedConnection());
+ unlink(chan_handle.name.c_str());
}
TEST_F(IPCChannelPosixTest, DoubleServer) {
@@ -443,6 +443,7 @@ TEST_F(IPCChannelPosixTest, IsNamedServerInitialized) {
channel->Close();
ASSERT_FALSE(IPC::Channel::IsNamedServerInitialized(
connection_socket_name));
+ unlink(chan_handle.name.c_str());
}
// A long running process that connects to us
« no previous file with comments | « no previous file | ipc/unix_domain_socket_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698