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

Unified Diff: net/socket/unix_domain_server_socket_posix_unittest.cc

Issue 515653003: Set the internal listen socket only when it opens to socket successfully. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a unittest listening again after failure. Created 6 years, 4 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 | « net/socket/unix_domain_server_socket_posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/unix_domain_server_socket_posix_unittest.cc
diff --git a/net/socket/unix_domain_server_socket_posix_unittest.cc b/net/socket/unix_domain_server_socket_posix_unittest.cc
index a78377d9a7cb3e175ff0609f5356cebd9066d53d..bdf1efa29c4f6538b9208600ac415e01a0aeaf6e 100644
--- a/net/socket/unix_domain_server_socket_posix_unittest.cc
+++ b/net/socket/unix_domain_server_socket_posix_unittest.cc
@@ -71,6 +71,15 @@ TEST_F(UnixDomainServerSocketTest, ListenWithInvalidPathWithAbstractNamespace) {
#endif
}
+TEST_F(UnixDomainServerSocketTest, ListenAgainAfterFailureWithInvalidPath) {
+ const bool kUseAbstractNamespace = false;
+ UnixDomainServerSocket server_socket(CreateAuthCallback(true),
+ kUseAbstractNamespace);
+ EXPECT_EQ(ERR_FILE_NOT_FOUND,
+ server_socket.ListenWithAddressAndPort(kInvalidSocketPath, 0, 1));
+ EXPECT_EQ(OK, server_socket.ListenWithAddressAndPort(socket_path_, 0, 1));
+}
+
TEST_F(UnixDomainServerSocketTest, AcceptWithForbiddenUser) {
const bool kUseAbstractNamespace = false;
« no previous file with comments | « net/socket/unix_domain_server_socket_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698