Index: base/sync_socket_unittest.cc |
diff --git a/base/sync_socket_unittest.cc b/base/sync_socket_unittest.cc |
index b3aac6b54743123098e9cd5d1f6c92b1eb19257e..ff9b8bc8c2f0c7a932d034da2080335e19a7481c 100644 |
--- a/base/sync_socket_unittest.cc |
+++ b/base/sync_socket_unittest.cc |
@@ -89,14 +89,32 @@ |
SendReceivePeek(&socket_a, &socket_b); |
} |
+template <class SocketType> |
+void ClonedSendReceivePeek() { |
+ SocketType socket_a, socket_b; |
+ ASSERT_TRUE(SocketType::CreatePair(&socket_a, &socket_b)); |
+ |
+ // Create new SyncSockets from the paired handles. |
+ SocketType socket_c(socket_a.handle()), socket_d(socket_b.handle()); |
+ SendReceivePeek(&socket_c, &socket_d); |
+} |
+ |
} // namespace |
TEST(SyncSocket, NormalSendReceivePeek) { |
NormalSendReceivePeek<base::SyncSocket>(); |
} |
+TEST(SyncSocket, ClonedSendReceivePeek) { |
+ ClonedSendReceivePeek<base::SyncSocket>(); |
+} |
+ |
TEST(CancelableSyncSocket, NormalSendReceivePeek) { |
NormalSendReceivePeek<base::CancelableSyncSocket>(); |
+} |
+ |
+TEST(CancelableSyncSocket, ClonedSendReceivePeek) { |
+ ClonedSendReceivePeek<base::CancelableSyncSocket>(); |
} |
TEST(CancelableSyncSocket, CancelReceiveShutdown) { |