| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 void RunToCompletion(StaticSocketDataProvider* data) { | 225 void RunToCompletion(StaticSocketDataProvider* data) { |
| 226 RunPreTestSetup(); | 226 RunPreTestSetup(); |
| 227 AddData(data); | 227 AddData(data); |
| 228 RunDefaultTest(); | 228 RunDefaultTest(); |
| 229 VerifyDataConsumed(); | 229 VerifyDataConsumed(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void AddData(StaticSocketDataProvider* data) { | 232 void AddData(StaticSocketDataProvider* data) { |
| 233 DCHECK(!deterministic_); | 233 DCHECK(!deterministic_); |
| 234 data_vector_.push_back(data); | 234 data_vector_.push_back(data); |
| 235 linked_ptr<SSLSocketDataProvider> ssl_( | 235 SSLSocketDataProvider* ssl_provider = |
| 236 new SSLSocketDataProvider(ASYNC, OK)); | 236 new SSLSocketDataProvider(ASYNC, OK); |
| 237 if (test_type_ == SPDYNPN) { | 237 if (test_type_ == SPDYNPN) |
| 238 ssl_->SetNextProto(kProtoSPDY3); | 238 ssl_provider->SetNextProto(kProtoSPDY3); |
| 239 } | 239 |
| 240 ssl_vector_.push_back(ssl_); | 240 ssl_vector_.push_back(ssl_provider); |
| 241 if (test_type_ == SPDYNPN || test_type_ == SPDYSSL) | 241 if (test_type_ == SPDYNPN || test_type_ == SPDYSSL) |
| 242 session_deps_->socket_factory->AddSSLSocketDataProvider(ssl_.get()); | 242 session_deps_->socket_factory->AddSSLSocketDataProvider(ssl_provider); |
| 243 |
| 243 session_deps_->socket_factory->AddSocketDataProvider(data); | 244 session_deps_->socket_factory->AddSocketDataProvider(data); |
| 244 if (test_type_ == SPDYNPN) { | 245 if (test_type_ == SPDYNPN) { |
| 245 MockConnect never_finishing_connect(SYNCHRONOUS, ERR_IO_PENDING); | 246 MockConnect never_finishing_connect(SYNCHRONOUS, ERR_IO_PENDING); |
| 246 linked_ptr<StaticSocketDataProvider> | 247 StaticSocketDataProvider* hanging_non_alternate_protocol_socket = |
| 247 hanging_non_alternate_protocol_socket( | 248 new StaticSocketDataProvider(NULL, 0, NULL, 0); |
| 248 new StaticSocketDataProvider(NULL, 0, NULL, 0)); | |
| 249 hanging_non_alternate_protocol_socket->set_connect_data( | 249 hanging_non_alternate_protocol_socket->set_connect_data( |
| 250 never_finishing_connect); | 250 never_finishing_connect); |
| 251 session_deps_->socket_factory->AddSocketDataProvider( | 251 session_deps_->socket_factory->AddSocketDataProvider( |
| 252 hanging_non_alternate_protocol_socket.get()); | 252 hanging_non_alternate_protocol_socket); |
| 253 alternate_vector_.push_back(hanging_non_alternate_protocol_socket); | 253 alternate_vector_.push_back(hanging_non_alternate_protocol_socket); |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 | 256 |
| 257 void AddDeterministicData(DeterministicSocketData* data) { | 257 void AddDeterministicData(DeterministicSocketData* data) { |
| 258 DCHECK(deterministic_); | 258 DCHECK(deterministic_); |
| 259 data_vector_.push_back(data); | 259 data_vector_.push_back(data); |
| 260 linked_ptr<SSLSocketDataProvider> ssl_( | 260 SSLSocketDataProvider* ssl_provider = |
| 261 new SSLSocketDataProvider(ASYNC, OK)); | 261 new SSLSocketDataProvider(ASYNC, OK); |
| 262 if (test_type_ == SPDYNPN) { | 262 if (test_type_ == SPDYNPN) |
| 263 ssl_->SetNextProto(kProtoSPDY3); | 263 ssl_provider->SetNextProto(kProtoSPDY3); |
| 264 } | 264 |
| 265 ssl_vector_.push_back(ssl_); | 265 ssl_vector_.push_back(ssl_provider); |
| 266 if (test_type_ == SPDYNPN || test_type_ == SPDYSSL) { | 266 if (test_type_ == SPDYNPN || test_type_ == SPDYSSL) { |
| 267 session_deps_->deterministic_socket_factory-> | 267 session_deps_->deterministic_socket_factory-> |
| 268 AddSSLSocketDataProvider(ssl_.get()); | 268 AddSSLSocketDataProvider(ssl_provider); |
| 269 } | 269 } |
| 270 session_deps_->deterministic_socket_factory->AddSocketDataProvider(data); | 270 session_deps_->deterministic_socket_factory->AddSocketDataProvider(data); |
| 271 if (test_type_ == SPDYNPN) { | 271 if (test_type_ == SPDYNPN) { |
| 272 MockConnect never_finishing_connect(SYNCHRONOUS, ERR_IO_PENDING); | 272 MockConnect never_finishing_connect(SYNCHRONOUS, ERR_IO_PENDING); |
| 273 scoped_refptr<DeterministicSocketData> | 273 DeterministicSocketData* hanging_non_alternate_protocol_socket = |
| 274 hanging_non_alternate_protocol_socket( | 274 new DeterministicSocketData(NULL, 0, NULL, 0); |
| 275 new DeterministicSocketData(NULL, 0, NULL, 0)); | |
| 276 hanging_non_alternate_protocol_socket->set_connect_data( | 275 hanging_non_alternate_protocol_socket->set_connect_data( |
| 277 never_finishing_connect); | 276 never_finishing_connect); |
| 278 session_deps_->deterministic_socket_factory->AddSocketDataProvider( | 277 session_deps_->deterministic_socket_factory->AddSocketDataProvider( |
| 279 hanging_non_alternate_protocol_socket); | 278 hanging_non_alternate_protocol_socket); |
| 280 alternate_deterministic_vector_.push_back( | 279 alternate_deterministic_vector_.push_back( |
| 281 hanging_non_alternate_protocol_socket); | 280 hanging_non_alternate_protocol_socket); |
| 282 } | 281 } |
| 283 } | 282 } |
| 284 | 283 |
| 285 // This can only be called after RunPreTestSetup. It adds a Data Provider, | 284 // This can only be called after RunPreTestSetup. It adds a Data Provider, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 306 scoped_ptr<SpdySessionDependencies>& session_deps() { | 305 scoped_ptr<SpdySessionDependencies>& session_deps() { |
| 307 return session_deps_; | 306 return session_deps_; |
| 308 } | 307 } |
| 309 int port() const { return port_; } | 308 int port() const { return port_; } |
| 310 SpdyNetworkTransactionSpdy3TestTypes test_type() const { | 309 SpdyNetworkTransactionSpdy3TestTypes test_type() const { |
| 311 return test_type_; | 310 return test_type_; |
| 312 } | 311 } |
| 313 | 312 |
| 314 private: | 313 private: |
| 315 typedef std::vector<StaticSocketDataProvider*> DataVector; | 314 typedef std::vector<StaticSocketDataProvider*> DataVector; |
| 316 typedef std::vector<linked_ptr<SSLSocketDataProvider> > SSLVector; | 315 typedef ScopedVector<SSLSocketDataProvider> SSLVector; |
| 317 typedef std::vector<linked_ptr<StaticSocketDataProvider> > AlternateVector; | 316 typedef ScopedVector<StaticSocketDataProvider> AlternateVector; |
| 318 typedef std::vector<scoped_refptr<DeterministicSocketData> > | 317 typedef ScopedVector<DeterministicSocketData> AlternateDeterministicVector; |
| 319 AlternateDeterministicVector; | |
| 320 HttpRequestInfo request_; | 318 HttpRequestInfo request_; |
| 321 scoped_ptr<SpdySessionDependencies> session_deps_; | 319 scoped_ptr<SpdySessionDependencies> session_deps_; |
| 322 scoped_refptr<HttpNetworkSession> session_; | 320 scoped_refptr<HttpNetworkSession> session_; |
| 323 TransactionHelperResult output_; | 321 TransactionHelperResult output_; |
| 324 scoped_ptr<StaticSocketDataProvider> first_transaction_; | 322 scoped_ptr<StaticSocketDataProvider> first_transaction_; |
| 325 SSLVector ssl_vector_; | 323 SSLVector ssl_vector_; |
| 326 TestCompletionCallback callback; | 324 TestCompletionCallback callback; |
| 327 scoped_ptr<HttpNetworkTransaction> trans_; | 325 scoped_ptr<HttpNetworkTransaction> trans_; |
| 328 scoped_ptr<HttpNetworkTransaction> trans_http_; | 326 scoped_ptr<HttpNetworkTransaction> trans_http_; |
| 329 DataVector data_vector_; | 327 DataVector data_vector_; |
| (...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 MockWrite(SYNCHRONOUS, 0, 0, 2), | 1773 MockWrite(SYNCHRONOUS, 0, 0, 2), |
| 1776 CreateMockWrite(*rst.get(), 3, SYNCHRONOUS), | 1774 CreateMockWrite(*rst.get(), 3, SYNCHRONOUS), |
| 1777 }; | 1775 }; |
| 1778 | 1776 |
| 1779 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 1777 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 1780 MockRead reads[] = { | 1778 MockRead reads[] = { |
| 1781 CreateMockRead(*resp.get(), 1, ASYNC), | 1779 CreateMockRead(*resp.get(), 1, ASYNC), |
| 1782 MockRead(ASYNC, 0, 0, 4) // EOF | 1780 MockRead(ASYNC, 0, 0, 4) // EOF |
| 1783 }; | 1781 }; |
| 1784 | 1782 |
| 1785 scoped_refptr<DeterministicSocketData> data( | 1783 DeterministicSocketData* data = |
| 1786 new DeterministicSocketData(reads, arraysize(reads), | 1784 new DeterministicSocketData(reads, arraysize(reads), |
| 1787 writes, arraysize(writes))); | 1785 writes, arraysize(writes)); |
| 1786 |
| 1788 NormalSpdyTransactionHelper helper(CreateGetRequest(), | 1787 NormalSpdyTransactionHelper helper(CreateGetRequest(), |
| 1789 BoundNetLog(), GetParam(), NULL); | 1788 BoundNetLog(), GetParam(), NULL); |
| 1790 helper.SetDeterministic(); | 1789 helper.SetDeterministic(); |
| 1791 helper.RunPreTestSetup(); | 1790 helper.RunPreTestSetup(); |
| 1792 helper.AddDeterministicData(data.get()); | 1791 helper.AddDeterministicData(data); |
| 1793 HttpNetworkTransaction* trans = helper.trans(); | 1792 HttpNetworkTransaction* trans = helper.trans(); |
| 1794 | 1793 |
| 1795 TestCompletionCallback callback; | 1794 TestCompletionCallback callback; |
| 1796 int rv = trans->Start( | 1795 int rv = trans->Start( |
| 1797 &CreateGetRequest(), callback.callback(), BoundNetLog()); | 1796 &CreateGetRequest(), callback.callback(), BoundNetLog()); |
| 1798 EXPECT_EQ(ERR_IO_PENDING, rv); | 1797 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 1799 | 1798 |
| 1800 data->SetStop(2); | 1799 data->SetStop(2); |
| 1801 data->Run(); | 1800 data->Run(); |
| 1802 helper.ResetTrans(); | 1801 helper.ResetTrans(); |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2545 CreateMockWrite(*req, 0, SYNCHRONOUS), | 2544 CreateMockWrite(*req, 0, SYNCHRONOUS), |
| 2546 CreateMockWrite(*rst, 2, SYNCHRONOUS), | 2545 CreateMockWrite(*rst, 2, SYNCHRONOUS), |
| 2547 }; | 2546 }; |
| 2548 | 2547 |
| 2549 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 2548 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 2550 MockRead reads[] = { | 2549 MockRead reads[] = { |
| 2551 CreateMockRead(*resp, 1, ASYNC), | 2550 CreateMockRead(*resp, 1, ASYNC), |
| 2552 MockRead(ASYNC, 0, 0, 3) // EOF | 2551 MockRead(ASYNC, 0, 0, 3) // EOF |
| 2553 }; | 2552 }; |
| 2554 | 2553 |
| 2555 scoped_refptr<DeterministicSocketData> data( | 2554 DeterministicSocketData* data = |
| 2556 new DeterministicSocketData(reads, arraysize(reads), | 2555 new DeterministicSocketData(reads, arraysize(reads), |
| 2557 writes, arraysize(writes))); | 2556 writes, arraysize(writes)); |
| 2558 | 2557 |
| 2559 NormalSpdyTransactionHelper helper(CreateGetRequest(), | 2558 NormalSpdyTransactionHelper helper(CreateGetRequest(), |
| 2560 BoundNetLog(), | 2559 BoundNetLog(), |
| 2561 GetParam(), NULL); | 2560 GetParam(), NULL); |
| 2562 helper.SetDeterministic(); | 2561 helper.SetDeterministic(); |
| 2563 helper.RunPreTestSetup(); | 2562 helper.RunPreTestSetup(); |
| 2564 helper.AddDeterministicData(data.get()); | 2563 helper.AddDeterministicData(data); |
| 2565 HttpNetworkTransaction* trans = helper.trans(); | 2564 HttpNetworkTransaction* trans = helper.trans(); |
| 2566 | 2565 |
| 2567 TestCompletionCallback callback; | 2566 TestCompletionCallback callback; |
| 2568 | 2567 |
| 2569 int rv = trans->Start( | 2568 int rv = trans->Start( |
| 2570 &CreateGetRequest(), callback.callback(), BoundNetLog()); | 2569 &CreateGetRequest(), callback.callback(), BoundNetLog()); |
| 2571 EXPECT_EQ(ERR_IO_PENDING, rv); | 2570 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 2572 | 2571 |
| 2573 data->SetStop(2); | 2572 data->SetStop(2); |
| 2574 data->Run(); | 2573 data->Run(); |
| (...skipping 2983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5558 CreateMockRead(*stream1_body, 3), | 5557 CreateMockRead(*stream1_body, 3), |
| 5559 CreateMockRead(*stream2_headers, 4), | 5558 CreateMockRead(*stream2_headers, 4), |
| 5560 MockRead(ASYNC, reinterpret_cast<const char*>(kPushBodyFrame), | 5559 MockRead(ASYNC, reinterpret_cast<const char*>(kPushBodyFrame), |
| 5561 arraysize(kPushBodyFrame), 5), | 5560 arraysize(kPushBodyFrame), 5), |
| 5562 MockRead(ASYNC, 0, 5), // EOF | 5561 MockRead(ASYNC, 0, 5), // EOF |
| 5563 }; | 5562 }; |
| 5564 | 5563 |
| 5565 HttpResponseInfo response; | 5564 HttpResponseInfo response; |
| 5566 HttpResponseInfo response2; | 5565 HttpResponseInfo response2; |
| 5567 std::string expected_push_result("pushed"); | 5566 std::string expected_push_result("pushed"); |
| 5568 scoped_refptr<DeterministicSocketData> data(new DeterministicSocketData( | 5567 DeterministicSocketData* data = |
| 5569 reads, | 5568 new DeterministicSocketData(reads, arraysize(reads), |
| 5570 arraysize(reads), | 5569 writes, arraysize(writes)); |
| 5571 writes, | |
| 5572 arraysize(writes))); | |
| 5573 | 5570 |
| 5574 NormalSpdyTransactionHelper helper(CreateGetRequest(), | 5571 NormalSpdyTransactionHelper helper(CreateGetRequest(), |
| 5575 BoundNetLog(), GetParam(), NULL); | 5572 BoundNetLog(), GetParam(), NULL); |
| 5576 helper.SetDeterministic(); | 5573 helper.SetDeterministic(); |
| 5577 helper.AddDeterministicData(static_cast<DeterministicSocketData*>(data)); | 5574 helper.AddDeterministicData(data); |
| 5578 helper.RunPreTestSetup(); | 5575 helper.RunPreTestSetup(); |
| 5579 | 5576 |
| 5580 HttpNetworkTransaction* trans = helper.trans(); | 5577 HttpNetworkTransaction* trans = helper.trans(); |
| 5581 | 5578 |
| 5582 // Run until we've received the primary SYN_STREAM, the pushed SYN_STREAM, | 5579 // Run until we've received the primary SYN_STREAM, the pushed SYN_STREAM, |
| 5583 // and the body of the primary stream, but before we've received the HEADERS | 5580 // and the body of the primary stream, but before we've received the HEADERS |
| 5584 // for the pushed stream. | 5581 // for the pushed stream. |
| 5585 data->SetStop(3); | 5582 data->SetStop(3); |
| 5586 | 5583 |
| 5587 // Start the transaction. | 5584 // Start the transaction. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5598 scoped_ptr<HttpNetworkTransaction> trans2( | 5595 scoped_ptr<HttpNetworkTransaction> trans2( |
| 5599 new HttpNetworkTransaction(helper.session())); | 5596 new HttpNetworkTransaction(helper.session())); |
| 5600 rv = trans2->Start( | 5597 rv = trans2->Start( |
| 5601 &CreateGetPushRequest(), callback.callback(), BoundNetLog()); | 5598 &CreateGetPushRequest(), callback.callback(), BoundNetLog()); |
| 5602 EXPECT_EQ(ERR_IO_PENDING, rv); | 5599 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 5603 data->RunFor(3); | 5600 data->RunFor(3); |
| 5604 MessageLoop::current()->RunAllPending(); | 5601 MessageLoop::current()->RunAllPending(); |
| 5605 | 5602 |
| 5606 // Read the server push body. | 5603 // Read the server push body. |
| 5607 std::string result2; | 5604 std::string result2; |
| 5608 ReadResult(trans2.get(), data.get(), &result2); | 5605 ReadResult(trans2.get(), data, &result2); |
| 5609 // Read the response body. | 5606 // Read the response body. |
| 5610 std::string result; | 5607 std::string result; |
| 5611 ReadResult(trans, data, &result); | 5608 ReadResult(trans, data, &result); |
| 5612 | 5609 |
| 5613 // Verify that we consumed all test data. | 5610 // Verify that we consumed all test data. |
| 5614 EXPECT_TRUE(data->at_read_eof()); | 5611 EXPECT_TRUE(data->at_read_eof()); |
| 5615 EXPECT_TRUE(data->at_write_eof()); | 5612 EXPECT_TRUE(data->at_write_eof()); |
| 5616 | 5613 |
| 5617 // Verify that the received push data is same as the expected push data. | 5614 // Verify that the received push data is same as the expected push data. |
| 5618 EXPECT_EQ(result2.compare(expected_push_result), 0) | 5615 EXPECT_EQ(result2.compare(expected_push_result), 0) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5710 CreateMockRead(*stream2_headers1, 4), | 5707 CreateMockRead(*stream2_headers1, 4), |
| 5711 CreateMockRead(*stream2_headers2, 5), | 5708 CreateMockRead(*stream2_headers2, 5), |
| 5712 MockRead(ASYNC, reinterpret_cast<const char*>(kPushBodyFrame), | 5709 MockRead(ASYNC, reinterpret_cast<const char*>(kPushBodyFrame), |
| 5713 arraysize(kPushBodyFrame), 6), | 5710 arraysize(kPushBodyFrame), 6), |
| 5714 MockRead(ASYNC, 0, 6), // EOF | 5711 MockRead(ASYNC, 0, 6), // EOF |
| 5715 }; | 5712 }; |
| 5716 | 5713 |
| 5717 HttpResponseInfo response; | 5714 HttpResponseInfo response; |
| 5718 HttpResponseInfo response2; | 5715 HttpResponseInfo response2; |
| 5719 std::string expected_push_result("pushed"); | 5716 std::string expected_push_result("pushed"); |
| 5720 scoped_refptr<DeterministicSocketData> data(new DeterministicSocketData( | 5717 DeterministicSocketData* data = |
| 5721 reads, | 5718 new DeterministicSocketData(reads, arraysize(reads), |
| 5722 arraysize(reads), | 5719 writes, arraysize(writes)); |
| 5723 writes, | |
| 5724 arraysize(writes))); | |
| 5725 | 5720 |
| 5726 NormalSpdyTransactionHelper helper(CreateGetRequest(), | 5721 NormalSpdyTransactionHelper helper(CreateGetRequest(), |
| 5727 BoundNetLog(), GetParam(), NULL); | 5722 BoundNetLog(), GetParam(), NULL); |
| 5728 helper.SetDeterministic(); | 5723 helper.SetDeterministic(); |
| 5729 helper.AddDeterministicData(static_cast<DeterministicSocketData*>(data)); | 5724 helper.AddDeterministicData(data); |
| 5730 helper.RunPreTestSetup(); | 5725 helper.RunPreTestSetup(); |
| 5731 | 5726 |
| 5732 HttpNetworkTransaction* trans = helper.trans(); | 5727 HttpNetworkTransaction* trans = helper.trans(); |
| 5733 | 5728 |
| 5734 // Run until we've received the primary SYN_STREAM, the pushed SYN_STREAM, | 5729 // Run until we've received the primary SYN_STREAM, the pushed SYN_STREAM, |
| 5735 // the first HEADERS frame, and the body of the primary stream, but before | 5730 // the first HEADERS frame, and the body of the primary stream, but before |
| 5736 // we've received the final HEADERS for the pushed stream. | 5731 // we've received the final HEADERS for the pushed stream. |
| 5737 data->SetStop(4); | 5732 data->SetStop(4); |
| 5738 | 5733 |
| 5739 // Start the transaction. | 5734 // Start the transaction. |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6167 MockRead reads[] = { | 6162 MockRead reads[] = { |
| 6168 CreateMockRead(*resp1, 1), | 6163 CreateMockRead(*resp1, 1), |
| 6169 CreateMockRead(*body1, 2), | 6164 CreateMockRead(*body1, 2), |
| 6170 CreateMockRead(*resp2, 5), | 6165 CreateMockRead(*resp2, 5), |
| 6171 CreateMockRead(*body2, 6), | 6166 CreateMockRead(*body2, 6), |
| 6172 CreateMockRead(*resp3, 7), | 6167 CreateMockRead(*resp3, 7), |
| 6173 CreateMockRead(*body3, 8), | 6168 CreateMockRead(*body3, 8), |
| 6174 MockRead(ASYNC, 0, 9) // EOF | 6169 MockRead(ASYNC, 0, 9) // EOF |
| 6175 }; | 6170 }; |
| 6176 | 6171 |
| 6177 scoped_refptr<DeterministicSocketData> data( | 6172 DeterministicSocketData* data = |
| 6178 new DeterministicSocketData(reads, arraysize(reads), | 6173 new DeterministicSocketData(reads, arraysize(reads), |
| 6179 writes, arraysize(writes))); | 6174 writes, arraysize(writes)); |
| 6175 |
| 6180 NormalSpdyTransactionHelper helper(CreateGetRequest(), | 6176 NormalSpdyTransactionHelper helper(CreateGetRequest(), |
| 6181 BoundNetLog(), GetParam(), NULL); | 6177 BoundNetLog(), GetParam(), NULL); |
| 6182 helper.SetDeterministic(); | 6178 helper.SetDeterministic(); |
| 6183 helper.RunPreTestSetup(); | 6179 helper.RunPreTestSetup(); |
| 6184 helper.AddDeterministicData(data.get()); | 6180 helper.AddDeterministicData(data); |
| 6185 | 6181 |
| 6186 // Start the first transaction to set up the SpdySession | 6182 // Start the first transaction to set up the SpdySession |
| 6187 HttpNetworkTransaction* trans = helper.trans(); | 6183 HttpNetworkTransaction* trans = helper.trans(); |
| 6188 TestCompletionCallback callback; | 6184 TestCompletionCallback callback; |
| 6189 HttpRequestInfo info1 = CreateGetRequest(); | 6185 HttpRequestInfo info1 = CreateGetRequest(); |
| 6190 info1.priority = LOWEST; | 6186 info1.priority = LOWEST; |
| 6191 int rv = trans->Start(&info1, callback.callback(), BoundNetLog()); | 6187 int rv = trans->Start(&info1, callback.callback(), BoundNetLog()); |
| 6192 EXPECT_EQ(ERR_IO_PENDING, rv); | 6188 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 6193 | 6189 |
| 6194 // Run the message loop, but do not allow the write to complete. | 6190 // Run the message loop, but do not allow the write to complete. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 6224 // And now we can allow everything else to run to completion. | 6220 // And now we can allow everything else to run to completion. |
| 6225 data->SetStop(10); | 6221 data->SetStop(10); |
| 6226 data->Run(); | 6222 data->Run(); |
| 6227 EXPECT_EQ(OK, callback2.WaitForResult()); | 6223 EXPECT_EQ(OK, callback2.WaitForResult()); |
| 6228 EXPECT_EQ(OK, callback3.WaitForResult()); | 6224 EXPECT_EQ(OK, callback3.WaitForResult()); |
| 6229 | 6225 |
| 6230 helper.VerifyDataConsumed(); | 6226 helper.VerifyDataConsumed(); |
| 6231 } | 6227 } |
| 6232 | 6228 |
| 6233 } // namespace net | 6229 } // namespace net |
| OLD | NEW |