Commit 0aecfd86 authored by rch's avatar rch Committed by Commit bot

Remove unused SocketDataProvider argument from SpdyNetworkTransactionTest::ReadResult

Also clarify the split between Deterministic and non-Deterministic
socket data providers.

Review URL: https://codereview.chromium.org/1142893003

Cr-Commit-Position: refs/heads/master@{#330546}
parent 7636c5ad
...@@ -272,6 +272,10 @@ class SpdyNetworkTransactionTest ...@@ -272,6 +272,10 @@ class SpdyNetworkTransactionTest
EXPECT_TRUE(provider->AllReadDataConsumed()); EXPECT_TRUE(provider->AllReadDataConsumed());
EXPECT_TRUE(provider->AllWriteDataConsumed()); EXPECT_TRUE(provider->AllWriteDataConsumed());
} }
for (const SocketDataProvider* provider : deterministic_data_vector_) {
EXPECT_TRUE(provider->AllReadDataConsumed());
EXPECT_TRUE(provider->AllWriteDataConsumed());
}
} }
// Occasionally a test will expect to error out before certain reads are // Occasionally a test will expect to error out before certain reads are
...@@ -282,6 +286,10 @@ class SpdyNetworkTransactionTest ...@@ -282,6 +286,10 @@ class SpdyNetworkTransactionTest
EXPECT_FALSE(provider->AllReadDataConsumed()); EXPECT_FALSE(provider->AllReadDataConsumed());
EXPECT_FALSE(provider->AllWriteDataConsumed()); EXPECT_FALSE(provider->AllWriteDataConsumed());
} }
for (const SocketDataProvider* provider : deterministic_data_vector_) {
EXPECT_FALSE(provider->AllReadDataConsumed());
EXPECT_FALSE(provider->AllWriteDataConsumed());
}
} }
void RunToCompletion(SocketDataProvider* data) { void RunToCompletion(SocketDataProvider* data) {
...@@ -336,7 +344,7 @@ class SpdyNetworkTransactionTest ...@@ -336,7 +344,7 @@ class SpdyNetworkTransactionTest
void AddDeterministicData(DeterministicSocketData* data) { void AddDeterministicData(DeterministicSocketData* data) {
DCHECK(deterministic_); DCHECK(deterministic_);
data_vector_.push_back(data); deterministic_data_vector_.push_back(data);
SSLSocketDataProvider* ssl_provider = SSLSocketDataProvider* ssl_provider =
new SSLSocketDataProvider(ASYNC, OK); new SSLSocketDataProvider(ASYNC, OK);
ssl_provider->SetNextProto(test_params_.protocol); ssl_provider->SetNextProto(test_params_.protocol);
...@@ -354,7 +362,7 @@ class SpdyNetworkTransactionTest ...@@ -354,7 +362,7 @@ class SpdyNetworkTransactionTest
hanging_non_alt_svc_socket->set_connect_data(hanging_connect); hanging_non_alt_svc_socket->set_connect_data(hanging_connect);
session_deps_->deterministic_socket_factory->AddSocketDataProvider( session_deps_->deterministic_socket_factory->AddSocketDataProvider(
hanging_non_alt_svc_socket); hanging_non_alt_svc_socket);
alternate_vector_.push_back(hanging_non_alt_svc_socket); alternate_deterministic_vector_.push_back(hanging_non_alt_svc_socket);
} }
} }
...@@ -378,6 +386,7 @@ class SpdyNetworkTransactionTest ...@@ -378,6 +386,7 @@ class SpdyNetworkTransactionTest
private: private:
typedef std::vector<SocketDataProvider*> DataVector; typedef std::vector<SocketDataProvider*> DataVector;
typedef std::vector<DeterministicSocketData*> DeterministicDataVector;
typedef ScopedVector<SSLSocketDataProvider> SSLVector; typedef ScopedVector<SSLSocketDataProvider> SSLVector;
typedef ScopedVector<SocketDataProvider> AlternateVector; typedef ScopedVector<SocketDataProvider> AlternateVector;
typedef ScopedVector<DeterministicSocketData> AlternateDeterministicVector; typedef ScopedVector<DeterministicSocketData> AlternateDeterministicVector;
...@@ -392,6 +401,7 @@ class SpdyNetworkTransactionTest ...@@ -392,6 +401,7 @@ class SpdyNetworkTransactionTest
scoped_ptr<HttpNetworkTransaction> trans_; scoped_ptr<HttpNetworkTransaction> trans_;
scoped_ptr<HttpNetworkTransaction> trans_http_; scoped_ptr<HttpNetworkTransaction> trans_http_;
DataVector data_vector_; DataVector data_vector_;
DeterministicDataVector deterministic_data_vector_;
AlternateVector alternate_vector_; AlternateVector alternate_vector_;
AlternateDeterministicVector alternate_deterministic_vector_; AlternateDeterministicVector alternate_deterministic_vector_;
const BoundNetLog log_; const BoundNetLog log_;
...@@ -553,7 +563,6 @@ class SpdyNetworkTransactionTest ...@@ -553,7 +563,6 @@ class SpdyNetworkTransactionTest
// to skip over data destined for other transactions while we consume // to skip over data destined for other transactions while we consume
// the data for |trans|. // the data for |trans|.
int ReadResult(HttpNetworkTransaction* trans, int ReadResult(HttpNetworkTransaction* trans,
SocketDataProvider* data,
std::string* result) { std::string* result) {
const int kSize = 3000; const int kSize = 3000;
...@@ -621,10 +630,10 @@ class SpdyNetworkTransactionTest ...@@ -621,10 +630,10 @@ class SpdyNetworkTransactionTest
// Read the server push body. // Read the server push body.
std::string result2; std::string result2;
ReadResult(trans2.get(), data, &result2); ReadResult(trans2.get(), &result2);
// Read the response body. // Read the response body.
std::string result; std::string result;
ReadResult(trans, data, &result); ReadResult(trans, &result);
// Verify that we consumed all test data. // Verify that we consumed all test data.
EXPECT_TRUE(data->AllReadDataConsumed()); EXPECT_TRUE(data->AllReadDataConsumed());
...@@ -5144,10 +5153,10 @@ TEST_P(SpdyNetworkTransactionTest, ServerPushClaimBeforeHeaders) { ...@@ -5144,10 +5153,10 @@ TEST_P(SpdyNetworkTransactionTest, ServerPushClaimBeforeHeaders) {
// Read the server push body. // Read the server push body.
std::string result2; std::string result2;
ReadResult(trans2.get(), &data, &result2); ReadResult(trans2.get(), &result2);
// Read the response body. // Read the response body.
std::string result; std::string result;
ReadResult(trans, &data, &result); ReadResult(trans, &result);
// Verify that the received push data is same as the expected push data. // Verify that the received push data is same as the expected push data.
EXPECT_EQ(result2.compare(expected_push_result), 0) EXPECT_EQ(result2.compare(expected_push_result), 0)
...@@ -5282,10 +5291,10 @@ TEST_P(SpdyNetworkTransactionTest, ServerPushWithTwoHeaderFrames) { ...@@ -5282,10 +5291,10 @@ TEST_P(SpdyNetworkTransactionTest, ServerPushWithTwoHeaderFrames) {
// Read the server push body. // Read the server push body.
std::string result2; std::string result2;
ReadResult(trans2.get(), &data, &result2); ReadResult(trans2.get(), &result2);
// Read the response body. // Read the response body.
std::string result; std::string result;
ReadResult(trans, &data, &result); ReadResult(trans, &result);
// Verify that the received push data is same as the expected push data. // Verify that the received push data is same as the expected push data.
EXPECT_EQ(expected_push_result, result2); EXPECT_EQ(expected_push_result, result2);
...@@ -5398,10 +5407,10 @@ TEST_P(SpdyNetworkTransactionTest, ServerPushWithNoStatusHeaderFrames) { ...@@ -5398,10 +5407,10 @@ TEST_P(SpdyNetworkTransactionTest, ServerPushWithNoStatusHeaderFrames) {
// Read the server push body. // Read the server push body.
std::string result2; std::string result2;
ReadResult(trans2.get(), &data, &result2); ReadResult(trans2.get(), &result2);
// Read the response body. // Read the response body.
std::string result; std::string result;
ReadResult(trans, &data, &result); ReadResult(trans, &result);
EXPECT_EQ("hello!", result); EXPECT_EQ("hello!", result);
// Verify that we haven't received any push data. // Verify that we haven't received any push data.
...@@ -5603,7 +5612,7 @@ TEST_P(SpdyNetworkTransactionTest, ServerPushCrossOriginCorrectness) { ...@@ -5603,7 +5612,7 @@ TEST_P(SpdyNetworkTransactionTest, ServerPushCrossOriginCorrectness) {
// Read the response body. // Read the response body.
std::string result; std::string result;
ReadResult(trans, &data, &result); ReadResult(trans, &result);
// Verify that we consumed all test data. // Verify that we consumed all test data.
EXPECT_TRUE(data.AllReadDataConsumed()); EXPECT_TRUE(data.AllReadDataConsumed());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment