| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "net/base/cache_type.h" | 13 #include "net/base/cache_type.h" |
| 14 #include "net/base/cert_status_flags.h" | 14 #include "net/base/cert_status_flags.h" |
| 15 #include "net/base/host_port_pair.h" | 15 #include "net/base/host_port_pair.h" |
| 16 #include "net/base/load_flags.h" | 16 #include "net/base/load_flags.h" |
| 17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
| 18 #include "net/base/net_log_unittest.h" | 18 #include "net/base/net_log_unittest.h" |
| 19 #include "net/base/ssl_cert_request_info.h" | |
| 20 #include "net/base/upload_bytes_element_reader.h" | 19 #include "net/base/upload_bytes_element_reader.h" |
| 21 #include "net/base/upload_data_stream.h" | 20 #include "net/base/upload_data_stream.h" |
| 22 #include "net/disk_cache/disk_cache.h" | 21 #include "net/disk_cache/disk_cache.h" |
| 23 #include "net/http/http_byte_range.h" | 22 #include "net/http/http_byte_range.h" |
| 24 #include "net/http/http_request_headers.h" | 23 #include "net/http/http_request_headers.h" |
| 25 #include "net/http/http_request_info.h" | 24 #include "net/http/http_request_info.h" |
| 26 #include "net/http/http_response_headers.h" | 25 #include "net/http/http_response_headers.h" |
| 27 #include "net/http/http_response_info.h" | 26 #include "net/http/http_response_info.h" |
| 28 #include "net/http/http_transaction.h" | 27 #include "net/http/http_transaction.h" |
| 29 #include "net/http/http_transaction_delegate.h" | 28 #include "net/http/http_transaction_delegate.h" |
| 30 #include "net/http/http_transaction_unittest.h" | 29 #include "net/http/http_transaction_unittest.h" |
| 31 #include "net/http/http_util.h" | 30 #include "net/http/http_util.h" |
| 32 #include "net/http/mock_http_cache.h" | 31 #include "net/http/mock_http_cache.h" |
| 32 #include "net/ssl/ssl_cert_request_info.h" |
| 33 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
| 34 | 34 |
| 35 using base::Time; | 35 using base::Time; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class DeleteCacheCompletionCallback : public net::TestCompletionCallbackBase { | 39 class DeleteCacheCompletionCallback : public net::TestCompletionCallbackBase { |
| 40 public: | 40 public: |
| 41 explicit DeleteCacheCompletionCallback(MockHttpCache* cache) | 41 explicit DeleteCacheCompletionCallback(MockHttpCache* cache) |
| 42 : cache_(cache), | 42 : cache_(cache), |
| (...skipping 5470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5513 | 5513 |
| 5514 // Force this transaction to read from the cache. | 5514 // Force this transaction to read from the cache. |
| 5515 MockTransaction transaction(kSimpleGET_Transaction); | 5515 MockTransaction transaction(kSimpleGET_Transaction); |
| 5516 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE; | 5516 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE; |
| 5517 | 5517 |
| 5518 RunTransactionTestWithDelegate(cache.http_cache(), | 5518 RunTransactionTestWithDelegate(cache.http_cache(), |
| 5519 kSimpleGET_Transaction, | 5519 kSimpleGET_Transaction, |
| 5520 5, | 5520 5, |
| 5521 0); | 5521 0); |
| 5522 } | 5522 } |
| OLD | NEW |