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

Unified Diff: webrtc/base/socket_unittest.h

Issue 1452903006: Keep listening if "accept" returns an invalid socket. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed presubmit Created 5 years 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 | « webrtc/base/physicalsocketserver_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/socket_unittest.h
diff --git a/webrtc/base/socket_unittest.h b/webrtc/base/socket_unittest.h
index d368afb3f53e2d8516ed58708f17b02e51201aa6..e4a6b327059d8098476356b717870145cfb93db9 100644
--- a/webrtc/base/socket_unittest.h
+++ b/webrtc/base/socket_unittest.h
@@ -21,8 +21,9 @@ namespace rtc {
// socketserver, and call the SocketTest test methods.
class SocketTest : public testing::Test {
protected:
- SocketTest() : ss_(NULL), kIPv4Loopback(INADDR_LOOPBACK),
- kIPv6Loopback(in6addr_loopback) {}
+ SocketTest() : kIPv4Loopback(INADDR_LOOPBACK),
+ kIPv6Loopback(in6addr_loopback),
+ ss_(nullptr) {}
virtual void SetUp() { ss_ = Thread::Current()->socketserver(); }
void TestConnectIPv4();
void TestConnectIPv6();
@@ -57,6 +58,10 @@ class SocketTest : public testing::Test {
void TestGetSetOptionsIPv4();
void TestGetSetOptionsIPv6();
+ static const int kTimeout = 5000; // ms
+ const IPAddress kIPv4Loopback;
+ const IPAddress kIPv6Loopback;
+
private:
void ConnectInternal(const IPAddress& loopback);
void ConnectWithDnsLookupInternal(const IPAddress& loopback,
@@ -77,12 +82,13 @@ class SocketTest : public testing::Test {
void UdpReadyToSend(const IPAddress& loopback);
void GetSetOptionsInternal(const IPAddress& loopback);
- static const int kTimeout = 5000; // ms
SocketServer* ss_;
- const IPAddress kIPv4Loopback;
- const IPAddress kIPv6Loopback;
};
+// For unbound sockets, GetLocalAddress / GetRemoteAddress return AF_UNSPEC
+// values on Windows, but an empty address of the same family on Linux/MacOS X.
+bool IsUnspecOrEmptyIP(const IPAddress& address);
+
} // namespace rtc
#endif // WEBRTC_BASE_SOCKET_UNITTEST_H_
« no previous file with comments | « webrtc/base/physicalsocketserver_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698