| 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_transaction_unittest.h" | 5 #include "net/http/http_transaction_unittest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 net::LoadState MockNetworkTransaction::GetLoadState() const { | 319 net::LoadState MockNetworkTransaction::GetLoadState() const { |
| 320 if (data_cursor_) | 320 if (data_cursor_) |
| 321 return net::LOAD_STATE_READING_RESPONSE; | 321 return net::LOAD_STATE_READING_RESPONSE; |
| 322 return net::LOAD_STATE_IDLE; | 322 return net::LOAD_STATE_IDLE; |
| 323 } | 323 } |
| 324 | 324 |
| 325 net::UploadProgress MockNetworkTransaction::GetUploadProgress() const { | 325 net::UploadProgress MockNetworkTransaction::GetUploadProgress() const { |
| 326 return net::UploadProgress(); | 326 return net::UploadProgress(); |
| 327 } | 327 } |
| 328 | 328 |
| 329 void MockNetworkTransaction::SetQuicServerInfo( |
| 330 net::QuicServerInfo* quic_server_info) {} |
| 331 |
| 329 bool MockNetworkTransaction::GetLoadTimingInfo( | 332 bool MockNetworkTransaction::GetLoadTimingInfo( |
| 330 net::LoadTimingInfo* load_timing_info) const { | 333 net::LoadTimingInfo* load_timing_info) const { |
| 331 if (socket_log_id_ != net::NetLog::Source::kInvalidId) { | 334 if (socket_log_id_ != net::NetLog::Source::kInvalidId) { |
| 332 // The minimal set of times for a request that gets a response, assuming it | 335 // The minimal set of times for a request that gets a response, assuming it |
| 333 // gets a new socket. | 336 // gets a new socket. |
| 334 load_timing_info->socket_reused = false; | 337 load_timing_info->socket_reused = false; |
| 335 load_timing_info->socket_log_id = socket_log_id_; | 338 load_timing_info->socket_log_id = socket_log_id_; |
| 336 load_timing_info->connect_timing.connect_start = base::TimeTicks::Now(); | 339 load_timing_info->connect_timing.connect_start = base::TimeTicks::Now(); |
| 337 load_timing_info->connect_timing.connect_end = base::TimeTicks::Now(); | 340 load_timing_info->connect_timing.connect_end = base::TimeTicks::Now(); |
| 338 load_timing_info->send_start = base::TimeTicks::Now(); | 341 load_timing_info->send_start = base::TimeTicks::Now(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 484 |
| 482 if (rv > 0) | 485 if (rv > 0) |
| 483 content.append(buf->data(), rv); | 486 content.append(buf->data(), rv); |
| 484 else if (rv < 0) | 487 else if (rv < 0) |
| 485 return rv; | 488 return rv; |
| 486 } while (rv > 0); | 489 } while (rv > 0); |
| 487 | 490 |
| 488 result->swap(content); | 491 result->swap(content); |
| 489 return net::OK; | 492 return net::OK; |
| 490 } | 493 } |
| OLD | NEW |