| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); | 322 scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
| 323 scoped_ptr<HttpTransaction> trans( | 323 scoped_ptr<HttpTransaction> trans( |
| 324 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); | 324 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); |
| 325 | 325 |
| 326 for (size_t i = 0; i < data_count; ++i) { | 326 for (size_t i = 0; i < data_count; ++i) { |
| 327 session_deps_.socket_factory->AddSocketDataProvider(data[i]); | 327 session_deps_.socket_factory->AddSocketDataProvider(data[i]); |
| 328 } | 328 } |
| 329 | 329 |
| 330 TestCompletionCallback callback; | 330 TestCompletionCallback callback; |
| 331 | 331 |
| 332 EXPECT_TRUE(log.bound().GetCaptureMode().enabled()); | 332 EXPECT_TRUE(log.bound().HasObservers()); |
| 333 int rv = trans->Start(&request, callback.callback(), log.bound()); | 333 int rv = trans->Start(&request, callback.callback(), log.bound()); |
| 334 EXPECT_EQ(ERR_IO_PENDING, rv); | 334 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 335 | 335 |
| 336 out.rv = callback.WaitForResult(); | 336 out.rv = callback.WaitForResult(); |
| 337 | 337 |
| 338 // Even in the failure cases that use this function, connections are always | 338 // Even in the failure cases that use this function, connections are always |
| 339 // successfully established before the error. | 339 // successfully established before the error. |
| 340 EXPECT_TRUE(trans->GetLoadTimingInfo(&out.load_timing_info)); | 340 EXPECT_TRUE(trans->GetLoadTimingInfo(&out.load_timing_info)); |
| 341 TestLoadTimingNotReused(out.load_timing_info, CONNECT_TIMING_HAS_DNS_TIMES); | 341 TestLoadTimingNotReused(out.load_timing_info, CONNECT_TIMING_HAS_DNS_TIMES); |
| 342 | 342 |
| (...skipping 13663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14006 ASSERT_TRUE(response); | 14006 ASSERT_TRUE(response); |
| 14007 ASSERT_TRUE(response->headers.get()); | 14007 ASSERT_TRUE(response->headers.get()); |
| 14008 | 14008 |
| 14009 EXPECT_EQ(101, response->headers->response_code()); | 14009 EXPECT_EQ(101, response->headers->response_code()); |
| 14010 | 14010 |
| 14011 trans.reset(); | 14011 trans.reset(); |
| 14012 session->CloseAllConnections(); | 14012 session->CloseAllConnections(); |
| 14013 } | 14013 } |
| 14014 | 14014 |
| 14015 } // namespace net | 14015 } // namespace net |
| OLD | NEW |