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

Unified Diff: mojo/shell/domain_socket/unix_domain_server_socket_posix_unittest.cc

Issue 736443002: SocketDescriptor should not be used as a boolean (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « mojo/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/domain_socket/unix_domain_server_socket_posix_unittest.cc
diff --git a/mojo/shell/domain_socket/unix_domain_server_socket_posix_unittest.cc b/mojo/shell/domain_socket/unix_domain_server_socket_posix_unittest.cc
index b5aaf1127350efda4df6e57cf27d2a36c4ad5679..fc08730e3a05436e9a400ad6dd366d0bc8158d0a 100644
--- a/mojo/shell/domain_socket/unix_domain_server_socket_posix_unittest.cc
+++ b/mojo/shell/domain_socket/unix_domain_server_socket_posix_unittest.cc
@@ -83,11 +83,11 @@ TEST_F(UnixDomainServerSocketTest, AcceptWithForbiddenUser) {
kUseAbstractNamespace);
EXPECT_EQ(net::OK, server_socket.ListenWithPath(socket_path_, 1));
- SocketDescriptor accepted_socket;
+ SocketDescriptor accepted_socket = kInvalidSocket;
TestCompletionCallback accept_callback;
EXPECT_EQ(net::ERR_IO_PENDING,
server_socket.Accept(&accepted_socket, accept_callback.callback()));
- EXPECT_FALSE(accepted_socket);
+ EXPECT_EQ(accepted_socket, kInvalidSocket);
UnixDomainClientSocket client_socket(socket_path_, kUseAbstractNamespace);
EXPECT_FALSE(client_socket.IsConnected());
@@ -108,7 +108,7 @@ TEST_F(UnixDomainServerSocketTest, AcceptWithForbiddenUser) {
// The server socket should not have called |accept_callback| or modified
// |accepted_socket|.
EXPECT_FALSE(accept_callback.have_result());
- EXPECT_FALSE(accepted_socket);
+ EXPECT_EQ(accepted_socket, kInvalidSocket);
}
// Normal cases including read/write are tested by UnixDomainClientSocketTest.
« no previous file with comments | « mojo/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698