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_cache.h" | 5 #include "net/http/http_cache.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "net/base/upload_bytes_element_reader.h" | 22 #include "net/base/upload_bytes_element_reader.h" |
23 #include "net/base/upload_data_stream.h" | 23 #include "net/base/upload_data_stream.h" |
24 #include "net/cert/cert_status_flags.h" | 24 #include "net/cert/cert_status_flags.h" |
25 #include "net/disk_cache/disk_cache.h" | 25 #include "net/disk_cache/disk_cache.h" |
26 #include "net/http/http_byte_range.h" | 26 #include "net/http/http_byte_range.h" |
27 #include "net/http/http_request_headers.h" | 27 #include "net/http/http_request_headers.h" |
28 #include "net/http/http_request_info.h" | 28 #include "net/http/http_request_info.h" |
29 #include "net/http/http_response_headers.h" | 29 #include "net/http/http_response_headers.h" |
30 #include "net/http/http_response_info.h" | 30 #include "net/http/http_response_info.h" |
31 #include "net/http/http_transaction.h" | 31 #include "net/http/http_transaction.h" |
32 #include "net/http/http_transaction_unittest.h" | 32 #include "net/http/http_transaction_test_util.h" |
33 #include "net/http/http_util.h" | 33 #include "net/http/http_util.h" |
34 #include "net/http/mock_http_cache.h" | 34 #include "net/http/mock_http_cache.h" |
35 #include "net/socket/client_socket_handle.h" | 35 #include "net/socket/client_socket_handle.h" |
36 #include "net/ssl/ssl_cert_request_info.h" | 36 #include "net/ssl/ssl_cert_request_info.h" |
37 #include "net/websockets/websocket_handshake_stream_base.h" | 37 #include "net/websockets/websocket_handshake_stream_base.h" |
38 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
39 | 39 |
40 using base::Time; | 40 using base::Time; |
41 | 41 |
42 namespace { | 42 namespace { |
(...skipping 6366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6409 base::MessageLoop::current()->RunUntilIdle(); | 6409 base::MessageLoop::current()->RunUntilIdle(); |
6410 | 6410 |
6411 // Read bytes 20-29 and 50-59 from the network, bytes 30-49 from the cache. | 6411 // Read bytes 20-29 and 50-59 from the network, bytes 30-49 from the cache. |
6412 transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER; | 6412 transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER; |
6413 transaction.data = "rg: 20-29 rg: 30-39 rg: 40-49 rg: 50-59 "; | 6413 transaction.data = "rg: 20-29 rg: 30-39 rg: 40-49 rg: 50-59 "; |
6414 received_bytes = RunTransactionAndGetReceivedBytes(cache, transaction); | 6414 received_bytes = RunTransactionAndGetReceivedBytes(cache, transaction); |
6415 EXPECT_EQ(range_response_size * 2, received_bytes); | 6415 EXPECT_EQ(range_response_size * 2, received_bytes); |
6416 | 6416 |
6417 RemoveMockTransaction(&kRangeGET_TransactionOK); | 6417 RemoveMockTransaction(&kRangeGET_TransactionOK); |
6418 } | 6418 } |
OLD | NEW |