Increase testclient timeout from 1 to 5 seconds
BUG=4182
R=pthatcher@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38839004
Cr-Commit-Position: refs/heads/master@{#8285}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8285 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/base/testclient.h b/webrtc/base/testclient.h
index d56f948..52058e3 100644
--- a/webrtc/base/testclient.h
+++ b/webrtc/base/testclient.h
@@ -32,6 +32,9 @@
size_t size;
};
+ // Default timeout for NextPacket reads.
+ static const int kTimeoutMs = 5000;
+
// Creates a client that will send and receive with the given socket and
// will post itself messages with the given thread.
explicit TestClient(AsyncPacketSocket* socket);
@@ -55,9 +58,9 @@
int SendTo(const char* buf, size_t size, const SocketAddress& dest);
// Returns the next packet received by the client or 0 if none is received
- // within a reasonable amount of time. The caller must delete the packet
+ // within the specified timeout. The caller must delete the packet
// when done with it.
- Packet* NextPacket();
+ Packet* NextPacket(int timeout_ms);
// Checks that the next packet has the given contents. Returns the remote
// address that the packet was sent from.
@@ -72,7 +75,8 @@
bool ready_to_send() const;
private:
- static const int kTimeout = 1000;
+ // Timeout for reads when no packet is expected.
+ static const int kNoPacketTimeoutMs = 1000;
// Workaround for the fact that AsyncPacketSocket::GetConnState doesn't exist.
Socket::ConnState GetState();
// Slot for packets read on the socket.