From 3f662f158a7ba94d3e1b235262a975474c117fad Mon Sep 17 00:00:00 2001 From: "ahendrickson@google.com" Date: Thu, 25 Mar 2010 19:56:12 +0000 Subject: SpdySession now sets the following fields in HttpResponseInfo: request_time response_time vary_data There is also a unit test to exercise the new functionality. - Changed CreateSpdyHeadersFromHttpRequest() to use std::string::append() rather than std::string::operator+() to append a single '\0' character to the string, as the former does nothing. - Now using SpdyFramer. - The unit tests now include all server push cases. BUG=34505 TEST=Run netunittests.exe --gtest_filter=SpdyNetworkTransactionTest.* Review URL: http://codereview.chromium.org/634002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42660 0039d316-1c4b-4281-b951-d872f2087c98 --- net/socket/socket_test_util.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'net/socket/socket_test_util.cc') diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 8b8153e..4a8311c 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -9,6 +9,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/message_loop.h" +#include "base/time.h" #include "net/base/address_family.h" #include "net/base/host_resolver_proc.h" #include "net/base/ssl_info.h" @@ -287,6 +288,7 @@ int MockSSLClientSocket::Write(net::IOBuffer* buf, int buf_len, MockRead StaticSocketDataProvider::GetNextRead() { DCHECK(!at_read_eof()); + reads_[read_index_].time_stamp = base::Time::Now(); return reads_[read_index_++]; } @@ -301,6 +303,7 @@ MockWriteResult StaticSocketDataProvider::OnWrite(const std::string& data) { // Check that what we are writing matches the expectation. // Then give the mocked return value. net::MockWrite* w = &writes_[write_index_++]; + w->time_stamp = base::Time::Now(); int result = w->result; if (w->data) { // Note - we can simulate a partial write here. If the expected data @@ -321,6 +324,26 @@ MockWriteResult StaticSocketDataProvider::OnWrite(const std::string& data) { return MockWriteResult(w->async, result); } +const MockRead& StaticSocketDataProvider::PeekRead() const { + DCHECK(!at_read_eof()); + return reads_[read_index_]; +} + +const MockWrite& StaticSocketDataProvider::PeekWrite() const { + DCHECK(!at_write_eof()); + return writes_[write_index_]; +} + +const MockRead& StaticSocketDataProvider::PeekRead(size_t index) const { + DCHECK_LT(index, read_count_); + return reads_[index]; +} + +const MockWrite& StaticSocketDataProvider::PeekWrite(size_t index) const { + DCHECK_LT(index, write_count_); + return writes_[index]; +} + void StaticSocketDataProvider::Reset() { read_index_ = 0; write_index_ = 0; -- cgit v1.1