From 96e272bcde178a2abe0b8008149c467630148f18 Mon Sep 17 00:00:00 2001 From: "gavinp@chromium.org" Date: Mon, 10 May 2010 14:13:34 +0000 Subject: Pass nulls through test sockets. Fixing 35050, one of the tests I wrote for EPSV required NULS go through the testing framework. That created issue 42432 which covers permitting NULs through our socket tests. I added an interface to SimulateRead which passes in an explicit length, and moved as much of that into ftp_network_transaction_unittest as possible. BUG=42432 TEST=see the modified Epsv test in ftp_network_transaction_unittest.cc Review URL: http://codereview.chromium.org/1949003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46813 0039d316-1c4b-4281-b951-d872f2087c98 --- net/socket/socket_test_util.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'net/socket/socket_test_util.h') diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index f50cf7d..6e0698f 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h @@ -5,6 +5,7 @@ #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ #define NET_SOCKET_SOCKET_TEST_UTIL_H_ +#include #include #include #include @@ -211,7 +212,10 @@ class DynamicSocketDataProvider : public SocketDataProvider { protected: // The next time there is a read from this socket, it will return |data|. // Before calling SimulateRead next time, the previous data must be consumed. - void SimulateRead(const char* data); + void SimulateRead(const char* data, size_t length); + void SimulateRead(const char* data) { + SimulateRead(data, std::strlen(data)); + } private: std::deque reads_; -- cgit v1.1