Index: net/spdy/spdy_network_transaction_spdy3_unittest.cc |
diff --git a/net/spdy/spdy_network_transaction_spdy3_unittest.cc b/net/spdy/spdy_network_transaction_spdy3_unittest.cc |
index 997d63399962bcd207fac11728bf3fc4448c2de4..179190b94f04568e714c04ae5e57fbd02911478b 100644 |
--- a/net/spdy/spdy_network_transaction_spdy3_unittest.cc |
+++ b/net/spdy/spdy_network_transaction_spdy3_unittest.cc |
@@ -175,7 +175,7 @@ class SpdyNetworkTransactionSpdy3Test |
} |
// We're now ready to use SSL-npn SPDY. |
- trans_.reset(new HttpNetworkTransaction(priority_, session_)); |
+ trans_.reset(new HttpNetworkTransaction(priority_, session_.get())); |
} |
// Start the transaction, read some data, finish. |
@@ -203,7 +203,7 @@ class SpdyNetworkTransactionSpdy3Test |
// Verify responses. |
const HttpResponseInfo* response = trans_->GetResponseInfo(); |
ASSERT_TRUE(response != NULL); |
- ASSERT_TRUE(response->headers != NULL); |
+ ASSERT_TRUE(response->headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
EXPECT_EQ(spdy_enabled_, response->was_fetched_via_spdy); |
if (HttpStreamFactory::spdy_enabled()) { |
@@ -492,7 +492,7 @@ class SpdyNetworkTransactionSpdy3Test |
scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(kSize)); |
TestCompletionCallback callback; |
while (true) { |
- int rv = trans->Read(buf, kSize, callback.callback()); |
+ int rv = trans->Read(buf.get(), kSize, callback.callback()); |
if (rv == ERR_IO_PENDING) { |
// Multiple transactions may be in the data set. Keep pulling off |
// reads until we complete our callback. |
@@ -549,7 +549,7 @@ class SpdyNetworkTransactionSpdy3Test |
// Request the pushed path. |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
rv = trans2->Start( |
&CreateGetPushRequest(), callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -592,7 +592,7 @@ class SpdyNetworkTransactionSpdy3Test |
const scoped_refptr<HttpNetworkSession>& session, |
int result) { |
scoped_ptr<HttpNetworkTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); |
TestCompletionCallback callback; |
HttpRequestInfo request; |
request.method = "GET"; |
@@ -632,7 +632,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Constructor) { |
scoped_refptr<HttpNetworkSession> session( |
SpdySessionDependencies::SpdyCreateSession(session_deps.get())); |
scoped_ptr<HttpTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); |
} |
TEST_P(SpdyNetworkTransactionSpdy3Test, Get) { |
@@ -778,11 +778,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGets) { |
helper.AddData(&data_placeholder); |
helper.AddData(&data_placeholder); |
scoped_ptr<HttpNetworkTransaction> trans1( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans3( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
TestCompletionCallback callback1; |
TestCompletionCallback callback2; |
@@ -805,7 +805,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGets) { |
ASSERT_EQ(OK, out.rv); |
const HttpResponseInfo* response1 = trans1->GetResponseInfo(); |
- EXPECT_TRUE(response1->headers != NULL); |
+ EXPECT_TRUE(response1->headers.get() != NULL); |
EXPECT_TRUE(response1->was_fetched_via_spdy); |
out.status_line = response1->headers->GetStatusLine(); |
out.response_info = *response1; |
@@ -865,9 +865,9 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBinding) { |
// there needs to be two sets of SSL connection data. |
helper.AddData(&data_placeholder); |
scoped_ptr<HttpNetworkTransaction> trans1( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
TestCompletionCallback callback1; |
TestCompletionCallback callback2; |
@@ -886,7 +886,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBinding) { |
ASSERT_EQ(OK, out.rv); |
const HttpResponseInfo* response1 = trans1->GetResponseInfo(); |
- EXPECT_TRUE(response1->headers != NULL); |
+ EXPECT_TRUE(response1->headers.get() != NULL); |
EXPECT_TRUE(response1->was_fetched_via_spdy); |
out.status_line = response1->headers->GetStatusLine(); |
out.response_info = *response1; |
@@ -896,7 +896,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBinding) { |
EXPECT_EQ("hello!hello!", out.response_data); |
const HttpResponseInfo* response2 = trans2->GetResponseInfo(); |
- EXPECT_TRUE(response2->headers != NULL); |
+ EXPECT_TRUE(response2->headers.get() != NULL); |
EXPECT_TRUE(response2->was_fetched_via_spdy); |
out.status_line = response2->headers->GetStatusLine(); |
out.response_info = *response2; |
@@ -954,9 +954,9 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBindingFromPreconnect) { |
helper.AddData(&data_placeholder); |
scoped_ptr<HttpNetworkTransaction> trans1( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
TestCompletionCallback callback1; |
TestCompletionCallback callback2; |
@@ -987,7 +987,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBindingFromPreconnect) { |
ASSERT_EQ(OK, out.rv); |
const HttpResponseInfo* response1 = trans1->GetResponseInfo(); |
- EXPECT_TRUE(response1->headers != NULL); |
+ EXPECT_TRUE(response1->headers.get() != NULL); |
EXPECT_TRUE(response1->was_fetched_via_spdy); |
out.status_line = response1->headers->GetStatusLine(); |
out.response_info = *response1; |
@@ -997,7 +997,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, TwoGetsLateBindingFromPreconnect) { |
EXPECT_EQ("hello!hello!", out.response_data); |
const HttpResponseInfo* response2 = trans2->GetResponseInfo(); |
- EXPECT_TRUE(response2->headers != NULL); |
+ EXPECT_TRUE(response2->headers.get() != NULL); |
EXPECT_TRUE(response2->was_fetched_via_spdy); |
out.status_line = response2->headers->GetStatusLine(); |
out.response_info = *response2; |
@@ -1078,11 +1078,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrent) { |
helper.AddData(&data_placeholder); |
helper.AddData(&data_placeholder); |
scoped_ptr<HttpNetworkTransaction> trans1( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans3( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
TestCompletionCallback callback1; |
TestCompletionCallback callback2; |
@@ -1112,7 +1112,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrent) { |
const HttpResponseInfo* response1 = trans1->GetResponseInfo(); |
ASSERT_TRUE(response1 != NULL); |
- EXPECT_TRUE(response1->headers != NULL); |
+ EXPECT_TRUE(response1->headers.get() != NULL); |
EXPECT_TRUE(response1->was_fetched_via_spdy); |
out.status_line = response1->headers->GetStatusLine(); |
out.response_info = *response1; |
@@ -1217,13 +1217,13 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, FourGetsWithMaxConcurrentPriority) { |
helper.AddData(&data_placeholder); |
helper.AddData(&data_placeholder); |
scoped_ptr<HttpNetworkTransaction> trans1( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans3( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans4( |
- new HttpNetworkTransaction(HIGHEST, helper.session())); |
+ new HttpNetworkTransaction(HIGHEST, helper.session().get())); |
TestCompletionCallback callback1; |
TestCompletionCallback callback2; |
@@ -1256,7 +1256,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, FourGetsWithMaxConcurrentPriority) { |
ASSERT_EQ(OK, out.rv); |
const HttpResponseInfo* response1 = trans1->GetResponseInfo(); |
- EXPECT_TRUE(response1->headers != NULL); |
+ EXPECT_TRUE(response1->headers.get() != NULL); |
EXPECT_TRUE(response1->was_fetched_via_spdy); |
out.status_line = response1->headers->GetStatusLine(); |
out.response_info = *response1; |
@@ -1350,11 +1350,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrentDelete) { |
helper.AddData(&data_placeholder); |
helper.AddData(&data_placeholder); |
scoped_ptr<HttpNetworkTransaction> trans1( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
scoped_ptr<HttpNetworkTransaction> trans3( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
TestCompletionCallback callback1; |
TestCompletionCallback callback2; |
@@ -1382,7 +1382,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrentDelete) { |
const HttpResponseInfo* response1 = trans1->GetResponseInfo(); |
ASSERT_TRUE(response1 != NULL); |
- EXPECT_TRUE(response1->headers != NULL); |
+ EXPECT_TRUE(response1->headers.get() != NULL); |
EXPECT_TRUE(response1->was_fetched_via_spdy); |
out.status_line = response1->headers->GetStatusLine(); |
out.response_info = *response1; |
@@ -1481,10 +1481,10 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrentSocketClose) { |
// there needs to be three sets of SSL connection data. |
helper.AddData(&data_placeholder); |
helper.AddData(&data_placeholder); |
- HttpNetworkTransaction trans1(DEFAULT_PRIORITY, helper.session()); |
- HttpNetworkTransaction trans2(DEFAULT_PRIORITY, helper.session()); |
+ HttpNetworkTransaction trans1(DEFAULT_PRIORITY, helper.session().get()); |
+ HttpNetworkTransaction trans2(DEFAULT_PRIORITY, helper.session().get()); |
HttpNetworkTransaction* trans3( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
TestCompletionCallback callback1; |
TestCompletionCallback callback2; |
@@ -1511,7 +1511,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ThreeGetsWithMaxConcurrentSocketClose) { |
const HttpResponseInfo* response1 = trans1.GetResponseInfo(); |
ASSERT_TRUE(response1 != NULL); |
- EXPECT_TRUE(response1->headers != NULL); |
+ EXPECT_TRUE(response1->headers.get() != NULL); |
EXPECT_TRUE(response1->was_fetched_via_spdy); |
out.status_line = response1->headers->GetStatusLine(); |
out.response_info = *response1; |
@@ -2080,7 +2080,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ResponseWithTwoSynReplies) { |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
ASSERT_TRUE(response != NULL); |
- EXPECT_TRUE(response->headers != NULL); |
+ EXPECT_TRUE(response->headers.get() != NULL); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
std::string response_data; |
rv = ReadTransaction(trans, &response_data); |
@@ -2253,14 +2253,14 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateSent) { |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
ASSERT_TRUE(response != NULL); |
- ASSERT_TRUE(response->headers != NULL); |
+ ASSERT_TRUE(response->headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
// Issue a read which will cause a WINDOW_UPDATE to be sent and window |
// size increased to default. |
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(body_data.size())); |
- rv = trans->Read(buf, body_data.size(), CompletionCallback()); |
+ rv = trans->Read(buf.get(), body_data.size(), CompletionCallback()); |
EXPECT_EQ(static_cast<int>(body_data.size()), rv); |
std::string content(buf->data(), buf->data() + body_data.size()); |
EXPECT_EQ(body_data, content); |
@@ -2877,7 +2877,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, StartTransactionOnReadCallback) { |
const int kSize = 3000; |
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kSize)); |
rv = trans->Read( |
- buf, kSize, |
+ buf.get(), |
+ kSize, |
base::Bind(&SpdyNetworkTransactionSpdy3Test::StartTransactionCallback, |
helper.session())); |
// This forces an err_IO_pending, which sets the callback. |
@@ -2924,7 +2925,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, DeleteSessionOnReadCallback) { |
const int kSize = 3000; |
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kSize)); |
rv = trans->Read( |
- buf, kSize, |
+ buf.get(), |
+ kSize, |
base::Bind(&SpdyNetworkTransactionSpdy3Test::DeleteSessionCallback, |
base::Unretained(&helper))); |
ASSERT_EQ(ERR_IO_PENDING, rv); |
@@ -3339,11 +3341,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushSingleDataFrame) { |
expected_push_result); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Verify the pushed stream. |
- EXPECT_TRUE(response2.headers != NULL); |
+ EXPECT_TRUE(response2.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
} |
@@ -3388,11 +3390,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushBeforeSynReply) { |
expected_push_result); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Verify the pushed stream. |
- EXPECT_TRUE(response2.headers != NULL); |
+ EXPECT_TRUE(response2.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
} |
@@ -3436,11 +3438,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushSingleDataFrame2) { |
expected_push_result); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Verify the pushed stream. |
- EXPECT_TRUE(response2.headers != NULL); |
+ EXPECT_TRUE(response2.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
} |
@@ -3500,7 +3502,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushServerAborted) { |
// Verify the SYN_REPLY. |
HttpResponseInfo response = *trans->GetResponseInfo(); |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
} |
@@ -3558,11 +3560,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushDuplicate) { |
expected_push_result); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Verify the pushed stream. |
- EXPECT_TRUE(response2.headers != NULL); |
+ EXPECT_TRUE(response2.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
} |
@@ -3617,11 +3619,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushMultipleDataFrame) { |
expected_push_result); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Verify the pushed stream. |
- EXPECT_TRUE(response2.headers != NULL); |
+ EXPECT_TRUE(response2.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
} |
@@ -3678,11 +3680,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, |
expected_push_result); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Verify the pushed stream. |
- EXPECT_TRUE(response2.headers != NULL); |
+ EXPECT_TRUE(response2.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
} |
@@ -3742,7 +3744,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushInvalidAssociatedStreamID0) { |
// Verify the SYN_REPLY. |
HttpResponseInfo response = *trans->GetResponseInfo(); |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
} |
@@ -3802,7 +3804,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushInvalidAssociatedStreamID9) { |
// Verify the SYN_REPLY. |
HttpResponseInfo response = *trans->GetResponseInfo(); |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
} |
@@ -3857,7 +3859,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushNoURL) { |
// Verify the SYN_REPLY. |
HttpResponseInfo response = *trans->GetResponseInfo(); |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
} |
@@ -4439,7 +4441,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferFull) { |
EXPECT_EQ(out.rv, OK); |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
- EXPECT_TRUE(response->headers != NULL); |
+ EXPECT_TRUE(response->headers.get() != NULL); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
out.status_line = response->headers->GetStatusLine(); |
out.response_info = *response; // Make a copy so we can verify. |
@@ -4452,7 +4454,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferFull) { |
// Read small chunks at a time. |
const int kSmallReadSize = 3; |
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kSmallReadSize)); |
- rv = trans->Read(buf, kSmallReadSize, read_callback.callback()); |
+ rv = trans->Read(buf.get(), kSmallReadSize, read_callback.callback()); |
if (rv == net::ERR_IO_PENDING) { |
data.CompleteRead(); |
rv = read_callback.WaitForResult(); |
@@ -4531,7 +4533,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Buffering) { |
EXPECT_EQ(out.rv, OK); |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
- EXPECT_TRUE(response->headers != NULL); |
+ EXPECT_TRUE(response->headers.get() != NULL); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
out.status_line = response->headers->GetStatusLine(); |
out.response_info = *response; // Make a copy so we can verify. |
@@ -4545,7 +4547,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Buffering) { |
// Read small chunks at a time. |
const int kSmallReadSize = 14; |
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kSmallReadSize)); |
- rv = trans->Read(buf, kSmallReadSize, read_callback.callback()); |
+ rv = trans->Read(buf.get(), kSmallReadSize, read_callback.callback()); |
if (rv == net::ERR_IO_PENDING) { |
data.CompleteRead(); |
rv = read_callback.WaitForResult(); |
@@ -4628,7 +4630,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedAll) { |
EXPECT_EQ(out.rv, OK); |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
- EXPECT_TRUE(response->headers != NULL); |
+ EXPECT_TRUE(response->headers.get() != NULL); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
out.status_line = response->headers->GetStatusLine(); |
out.response_info = *response; // Make a copy so we can verify. |
@@ -4642,7 +4644,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedAll) { |
// Read small chunks at a time. |
const int kSmallReadSize = 14; |
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kSmallReadSize)); |
- rv = trans->Read(buf, kSmallReadSize, read_callback.callback()); |
+ rv = trans->Read(buf.get(), kSmallReadSize, read_callback.callback()); |
if (rv > 0) { |
EXPECT_EQ(kSmallReadSize, rv); |
content.append(buf->data(), rv); |
@@ -4718,7 +4720,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedClosed) { |
EXPECT_EQ(out.rv, OK); |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
- EXPECT_TRUE(response->headers != NULL); |
+ EXPECT_TRUE(response->headers.get() != NULL); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
out.status_line = response->headers->GetStatusLine(); |
out.response_info = *response; // Make a copy so we can verify. |
@@ -4732,7 +4734,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedClosed) { |
// Read small chunks at a time. |
const int kSmallReadSize = 14; |
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kSmallReadSize)); |
- rv = trans->Read(buf, kSmallReadSize, read_callback.callback()); |
+ rv = trans->Read(buf.get(), kSmallReadSize, read_callback.callback()); |
if (rv == net::ERR_IO_PENDING) { |
data.CompleteRead(); |
rv = read_callback.WaitForResult(); |
@@ -4798,7 +4800,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedCancelled) { |
EXPECT_EQ(out.rv, OK); |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
- EXPECT_TRUE(response->headers != NULL); |
+ EXPECT_TRUE(response->headers.get() != NULL); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
out.status_line = response->headers->GetStatusLine(); |
out.response_info = *response; // Make a copy so we can verify. |
@@ -4809,7 +4811,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, BufferedCancelled) { |
do { |
const int kReadSize = 256; |
scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(kReadSize)); |
- rv = trans->Read(buf, kReadSize, read_callback.callback()); |
+ rv = trans->Read(buf.get(), kReadSize, read_callback.callback()); |
if (rv == net::ERR_IO_PENDING) { |
// Complete the read now, which causes buffering to start. |
data.CompleteRead(); |
@@ -5106,7 +5108,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, CloseWithActiveStream) { |
EXPECT_EQ(out.rv, OK); |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
- EXPECT_TRUE(response->headers != NULL); |
+ EXPECT_TRUE(response->headers.get() != NULL); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
out.rv = ReadTransaction(trans, &out.response_data); |
EXPECT_EQ(ERR_CONNECTION_CLOSED, out.rv); |
@@ -5206,7 +5208,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ProxyConnect) { |
// Verify the SYN_REPLY. |
HttpResponseInfo response = *trans->GetResponseInfo(); |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
std::string response_data; |
@@ -5266,7 +5268,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, DirectConnectProxyReconnect) { |
EXPECT_EQ(out.rv, OK); |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
- EXPECT_TRUE(response->headers != NULL); |
+ EXPECT_TRUE(response->headers.get() != NULL); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
out.rv = ReadTransaction(trans, &out.response_data); |
EXPECT_EQ(OK, out.rv); |
@@ -5383,7 +5385,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, DirectConnectProxyReconnect) { |
EXPECT_EQ(0, rv); |
HttpResponseInfo response_proxy = *trans_proxy->GetResponseInfo(); |
- EXPECT_TRUE(response_proxy.headers != NULL); |
+ EXPECT_TRUE(response_proxy.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response_proxy.headers->GetStatusLine()); |
std::string response_data; |
@@ -5438,7 +5440,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, VerifyRetryOnConnectionReset) { |
for (int i = 0; i < 2; ++i) { |
scoped_ptr<HttpNetworkTransaction> trans( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
TestCompletionCallback callback; |
int rv = trans->Start( |
@@ -5462,7 +5464,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, VerifyRetryOnConnectionReset) { |
const HttpResponseInfo* response = trans->GetResponseInfo(); |
ASSERT_TRUE(response != NULL); |
- EXPECT_TRUE(response->headers != NULL); |
+ EXPECT_TRUE(response->headers.get() != NULL); |
EXPECT_TRUE(response->was_fetched_via_spdy); |
std::string response_data; |
rv = ReadTransaction(trans.get(), &response_data); |
@@ -5583,7 +5585,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SpdyBasicAuth) { |
// Make sure the response has an auth challenge. |
const HttpResponseInfo* const response_start = trans->GetResponseInfo(); |
ASSERT_TRUE(response_start != NULL); |
- ASSERT_TRUE(response_start->headers != NULL); |
+ ASSERT_TRUE(response_start->headers.get() != NULL); |
EXPECT_EQ(401, response_start->headers->response_code()); |
EXPECT_TRUE(response_start->was_fetched_via_spdy); |
AuthChallengeInfo* auth_challenge = response_start->auth_challenge.get(); |
@@ -5604,7 +5606,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SpdyBasicAuth) { |
// data has changed. |
const HttpResponseInfo* const response_restart = trans->GetResponseInfo(); |
ASSERT_TRUE(response_restart != NULL); |
- ASSERT_TRUE(response_restart->headers != NULL); |
+ ASSERT_TRUE(response_restart->headers.get() != NULL); |
EXPECT_EQ(200, response_restart->headers->response_code()); |
EXPECT_TRUE(response_restart->auth_challenge.get() == NULL); |
} |
@@ -5681,11 +5683,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithHeaders) { |
expected_push_result); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Verify the pushed stream. |
- EXPECT_TRUE(response2.headers != NULL); |
+ EXPECT_TRUE(response2.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
} |
@@ -5782,7 +5784,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushClaimBeforeHeaders) { |
// Request the pushed path. At this point, we've received the push, but the |
// headers are not yet complete. |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
rv = trans2->Start( |
&CreateGetPushRequest(), callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -5811,11 +5813,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushClaimBeforeHeaders) { |
VerifyStreamsClosed(helper); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Verify the pushed stream. |
- EXPECT_TRUE(response2.headers != NULL); |
+ EXPECT_TRUE(response2.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
// Read the final EOF (which will close the session) |
@@ -5933,7 +5935,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithTwoHeaderFrames) { |
// Request the pushed path. At this point, we've received the push, but the |
// headers are not yet complete. |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
rv = trans2->Start( |
&CreateGetPushRequest(), callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -5962,11 +5964,11 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithTwoHeaderFrames) { |
VerifyStreamsClosed(helper); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Verify the pushed stream. |
- EXPECT_TRUE(response2.headers != NULL); |
+ EXPECT_TRUE(response2.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response2.headers->GetStatusLine()); |
// Verify we got all the headers |
@@ -6074,7 +6076,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithNoStatusHeaderFrames) { |
// Request the pushed path. At this point, we've received the push, but the |
// headers are not yet complete. |
scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session())); |
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get())); |
rv = trans2->Start( |
&CreateGetPushRequest(), callback.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
@@ -6100,7 +6102,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushWithNoStatusHeaderFrames) { |
VerifyStreamsClosed(helper); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
// Read the final EOF (which will close the session). |
@@ -6391,7 +6393,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushCrossOriginCorrectness) { |
VerifyStreamsClosed(helper); |
// Verify the SYN_REPLY. |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
} |
} |
@@ -6448,7 +6450,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RetryAfterRefused) { |
// Verify the SYN_REPLY. |
HttpResponseInfo response = *trans->GetResponseInfo(); |
- EXPECT_TRUE(response.headers != NULL); |
+ EXPECT_TRUE(response.headers.get() != NULL); |
EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
} |
@@ -6509,8 +6511,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, OutOfOrderSynStream) { |
// Now, start both new transactions |
HttpRequestInfo info2 = CreateGetRequest(); |
TestCompletionCallback callback2; |
- scoped_ptr<HttpNetworkTransaction> trans2( |
- new HttpNetworkTransaction(MEDIUM, helper.session())); |
+ scoped_ptr<HttpNetworkTransaction> trans2( |
+ new HttpNetworkTransaction(MEDIUM, helper.session().get())); |
rv = trans2->Start(&info2, callback2.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
base::MessageLoop::current()->RunUntilIdle(); |
@@ -6518,7 +6520,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, OutOfOrderSynStream) { |
HttpRequestInfo info3 = CreateGetRequest(); |
TestCompletionCallback callback3; |
scoped_ptr<HttpNetworkTransaction> trans3( |
- new HttpNetworkTransaction(HIGHEST, helper.session())); |
+ new HttpNetworkTransaction(HIGHEST, helper.session().get())); |
rv = trans3->Start(&info3, callback3.callback(), BoundNetLog()); |
EXPECT_EQ(ERR_IO_PENDING, rv); |
base::MessageLoop::current()->RunUntilIdle(); |