summaryrefslogtreecommitdiffstats
path: root/net/socket/socket_test_util.cc
diff options
context:
space:
mode:
authorgavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-10 14:13:34 +0000
committergavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-10 14:13:34 +0000
commit96e272bcde178a2abe0b8008149c467630148f18 (patch)
tree1f4f8683341507dae46b023f43ef347f2a2b6394 /net/socket/socket_test_util.cc
parent04e3f3559dac2a7a5178e8f0d935d69970e2a33c (diff)
downloadchromium_src-96e272bcde178a2abe0b8008149c467630148f18.zip
chromium_src-96e272bcde178a2abe0b8008149c467630148f18.tar.gz
chromium_src-96e272bcde178a2abe0b8008149c467630148f18.tar.bz2
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
Diffstat (limited to 'net/socket/socket_test_util.cc')
-rw-r--r--net/socket/socket_test_util.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index 99a200f..5cae82e 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -475,11 +475,12 @@ void DynamicSocketDataProvider::Reset() {
reads_.clear();
}
-void DynamicSocketDataProvider::SimulateRead(const char* data) {
+void DynamicSocketDataProvider::SimulateRead(const char* data,
+ const size_t length) {
if (!allow_unconsumed_reads_) {
EXPECT_TRUE(reads_.empty()) << "Unconsumed read: " << reads_.front().data;
}
- reads_.push_back(MockRead(data));
+ reads_.push_back(MockRead(true, data, length));
}
DelayedSocketData::DelayedSocketData(